The scheduler framework is an EJB component that provides
the ability to configure different types of scheduled tasks. The tasks
are controlled by scheduler configuration XML files.
You can configure the following types of task:
- Timed
- A task is executed at a specified interval.
- Message
- A task is executed at a specified interval. The task then processes
messages on the WSRR JMS message queue, by setting up durable subscriptions.
The
processing of all messages can be performed in a single EJB transaction,
or each message can be processed in its own transaction.
Tasks are defined in a Java™ class
that is loaded into WSRR as a plug-in. The Java class implements one of the following interfaces
that relate to the type of task to be executed. The interfaces are
supplied in the ServiceRegistryClient.jar file.
- ServiceRegistryTimedTask
- This has one method, execute(), which is called whenever the task
is executed, at the time interval specified in the scheduler configuration
XML file.
- ServiceRegistryMessageTask
- This interface has three methods.
- preExecute(), which is called once at the start of the task that
is being executed. This method returns a boolean value that determines
whether the execute() method is run:
- true. Run the execute() method.
- false. Do not run the execute() method.
- execute(), which is called once for each message on the JMS topic
(configured in the scheduler configuration XML file). This method
takes multiple parameters for all the relevant items on the JMS message: String
type, String event, String bsruri, String name, String namespace,
String version, String transition, String classificationURIs
- postExecute(), which is called at the end of the task after all
the messages have been processed.
The scheduler framework is described in detail in the following
subtopics: