Miscellaneous Task Definitions
Timed task registration
To register a task as a 'timed' task, contribute to the net.sourceforge.basher.TimedTasks configuration point (in your Gaderian module.xml file). Here, the interval specifies the number of seconds between executing the task.
... <service-point id="HelloWorldTask" interface="net.sourceforge.basher.Task"> Example Hello World Task for demonstration purposes. <create-instance class="net.sourceforge.basher.tasks.HelloWorldTask"/> </service-point> <contribution configuration-id="net.sourceforge.basher.TimedTasks"> <timed-task service="service:HelloWorldTask" interval="10"/> </contribution> ...
Defining followers to a task
To provide a task with a set of followers, the contribution made to the net.sourceforge.basher.TaskContributions configuration point should include the following:
... <service-point id="HelloWorldTask" interface="net.sourceforge.basher.Task"> Example Hello World Task for demonstration purposes. <create-instance class="net.sourceforge.basher.tasks.HelloWorldTask"/> </service-point> <service-point id="HelloWorldTask2" interface="net.sourceforge.basher.Task"> Example Hello World Task for demonstration purposes. <create-instance class="net.sourceforge.basher.tasks.HelloWorldTask"/> </service-point> <contribution configuration-id="net.sourceforge.basher.TaskContributions"> Contributes the hello world task which in turn registers it with the task manager. <task service="service:HelloWorldTask"> <!-- Defines the follower for the HelloWorldTask --> <follower service="service:HelloWorldTask2"/> </task> </contribution> <contribution configuration-id="net.sourceforge.basher.TaskContributions"> <!-- Contributes a POJO task task, defined as a simple bean. The --> <!-- name of the bean is PlainClassTask --> <task-contribution task="service:HelloWorldTask"> <configuration max-invocations="10" task-name="PlainClassTask""/> <phases> <phase name="SETUP"/> <phase name="RUN"/> </phases> </task-contribution> </contribution> ...
Note: that the HelloWorldTask is not registered directly with the task manager as a separately running task.