Why does my Asynchronous Task not start?
I have created an Asynchronous Task and am attempting to test it. However, the task does not appear to start. I set the fixed delay to 10 mins. I started the server and launched the client and waited for over 15 mins the breakpoint to stop the application but it never happened. I checked the component status and found that the component was not listed.
- I used the com.ibm.team.repository.service.Asyncronous Task extension point
- I added the plugin to the Debug/Run Configuration.
- The class in the plugin extended AbstractAutoScheduledTask
Is there something I missed?
One answer
Hi Andrew,
in general what you mention sounds right. I assume you specified the delay using a task configuration property, am I right? Just in case, the following is a skeleton for an asyncTask extension declaration to make it run every 30 seconds:
With a component declaration as the example above, the method "runTask()" in the task implementation class <myClass> will be called every 30 seconds. This should give you a clue of what is not working in your implementation.
Note that normally the actual logic is carried out by a repository service and the task will be used to trigger the service in your timely defined manner. As such the service will have to be declared in the prerrequisites section as well.
Regards,
Jorge.
in general what you mention sounds right. I assume you specified the delay using a task configuration property, am I right? Just in case, the following is a skeleton for an asyncTask extension declaration to make it run every 30 seconds:
<extension point="com.ibm.team.repository.service.asynchronousTask"> <asynchronousTask taskId="myTaskID"> <extensionService componentId="com.ibm.team.repository" implementationClass="myClass"> <prerequisites> <configurationProperties> <configurationProperty accessPolicy="OPEN" default="30" description="Desc" displayableName="Name" name="myTaskID.fixedDelay" required="true" type="LONG" updatePolicy="FRAMEWORK_RESTART_REQUIRED"> </configurationProperty> <configurationProperties> </prerequisites> </extensionService> </asynchronousTask> </extension>
With a component declaration as the example above, the method "runTask()" in the task implementation class <myClass> will be called every 30 seconds. This should give you a clue of what is not working in your implementation.
Note that normally the actual logic is carried out by a repository service and the task will be used to trigger the service in your timely defined manner. As such the service will have to be declared in the prerrequisites section as well.
Regards,
Jorge.
Comments
Jorge
Thanks for the template. I made sure my plugin.xml matched the template. I also added the service: com.ibm.team.repository.service.IRepositoryItemService. However, the task still does not start.
Andrew, note that the sample skeleton defines a task belonging to repository component. If you are defining a task of your own component, make sure it's referring to an actual declared component ("com.ibm.team.repository.common.components" extension point).
This is an update for this question.