Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This sample explains how to create a task that can be scheduled to run on WSO2 Governance Registry in few easy steps. Once successfully deployed this sample will print Hello World once every 10 seconds on the Command Prompt of the WSO2 Governance Registry. We will be reusing the code of the Handler Sample in this example. This sample requires Apache Maven. See Installation PrerequisitesSystem Requirements for links on how to install it.

...

Code Block
languagehtml/xml
<dependency>
    <groupId>org.wso2.carbon<carbon.commons</groupId>
    <artifactId>org.wso2.carbon.ntask.core</artifactId>
    <version>4<version>${carbon.0commons.0<version}</version>
</dependency>

3. Add a new Java Class named SampleTask at GREG_HOME/samples/handler/src/src/main/java/org/wso2/carbon/registry/samples/task/SampleTask.java with the following source:

...

Info

The command mvn clean install will trigger an Apache Maven Build in your command line. This requires you having installed Apache Maven. See Installation PrerequisitesSystem Requirements for links on how to install it.

...