This page describes the general case The following diagram illustrates the process of creating and scheduling a custom task. See also: Writing Tasks Sample. implementation.
The main steps while writing a task are as follows:
...
Step 1. Write the Task Class
Anchor | ||||
---|---|---|---|---|
|
...
The custom Task class should implement org.apache.synapse.startup.Task
. Each task should therefore implement the Task
interface. This interface has a single execute()
method. This method contains the code that is to be run at the specified intervals.
...
In addition to the execute()
method, it is also possible to make the class implement a JavaBean
interface. The WSO2 ESB console can then be used to configure the properties of this JavaBean
.
See Writing Tasks Sample to learn more information on how to write tasks in Java. You can also use JavaScript, Ruby, Groovy or other Apache BSF scripting languages for this purpose.
...
Step 2. Customize the Task
Anchor | ||||
---|---|---|---|---|
|
...