This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Configuration for Scheduled Tasks
To schedule tasks using Governanace Registry and the following configuration at $GREG_HOME/repository/conf/registry.xml
.Â
<tasks> <task name="SampleTask" class="org.wso2.carbon.registry.samples.task.SampleTask"> <trigger cron="0/10 * * * * ?"/> <property key="foo" value="FooVal" /> <property key="bar" value="BarVal" /> </task> </tasks>
The attributes of the given above configuration can be defined as below.
- name - A name to distinguish this task from other tasks. This has to be a unique name in a single clustered or non-clustered deployment.
- class - The fully qualified name of the class implementing theÂ
org.wso2.carbon.ntask.core.Task
interface. You can have more than one task having the same class. - cron - http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger
- property - a property that is passed into the
setProperties
method of the Task implementation class. You can have more than zero or more properties for you task.- key - the name of the property.
- value - the value of the property.
It is important to restart the server after a configuration change.
See also Scheduled Task Sample.