Quartz is a powerful job scheduling system for Java. Here you can find a XML-RPC plugin that can enable you to use the Quartz as a web service using XML-RPC protocol. You can use this plugin for accessing Quartz API from other languages than Java, such as PHP for example. Also, you can use it from your distributed Java application if you find this way more appropriate than RMI.
Prerequisites #
-
This is plugin for Quartz, java job scheduling system
-
It relays on Apache XML-RPC library.
-
In order to easily build quartz with this plugin according to the ‘Installation’ procedure, you would also need to have Ant installed.
Installation #
-
Download the source code of the Quartz and extract to the desired location
-
Download the plugin archieve from here and extract to in the same folder as Quartz
-
Make sure that Apache XMLRPC library is in the classpath. The best approach is too copy jar file in the $QUARTZ_HOME/lib directory (needed for running the examples) and type something like this (just an example)
export CLASSPATH=$CLASSPATH:$QUARTZ_HOME/lib/xmlrpc-1.1.jar -
Run ant
$ ant
Quartz library ready for use will be at the $QUARTZ_HOME/lib/quartz.jar
Usage #
There are fully functional example that shows how to use this plugin:
-
org.quartz.examples.XmlRpcServerTest - class that shows how to initialize server side of the plugin
-
org.quartz.examples.XmlRpcClientTest - class that shows how use plugin on the client side
-
examples/xmlrpc.properties - configuration file for this example
-
examples/xmlRpcServerExample.sh - shell script for running the server example
-
examples/xmlRpcClientExample.sh - shell script for running the client example
To run this example, you should:
-
Build example jar by running
$ ant jar-ex -
Edit .sh files and set
QRTZ = ...variable to point to your quartz home
-
If you didn’t copy XML-RPC jar in the lib/ directory, do it now
-
Run xmlRpcServerExample.sh
-
Run xmlRpcClientExample.sh in another terminal window
After this, in the server (first) terminal you should see something like the following:
---dumb.dumb executing.[Mon Nov 03 22:01:18 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:01:28 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:01:38 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:01:48 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:01:58 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:02:08 CET 2003]
---dumb.dumb executing.[Mon Nov 03 22:02:18 CET 2003]