org.osesb.scheduledjobs.databasepoller
Class DefaultDatabasePollerScheduledJob

java.lang.Object
  extended by org.osesb.scheduledjobs.ScheduledJob
      extended by org.osesb.scheduledjobs.databasepoller.DefaultDatabasePollerScheduledJob
All Implemented Interfaces:
java.lang.Runnable, org.quartz.Job, org.quartz.StatefulJob

public class DefaultDatabasePollerScheduledJob
extends ScheduledJob

DefaultDatabasePollerScheduledJob is the default database poller class.

DefaultDatabasePollerScheduledJob extends org.osesb.scheduledjobs.ScheduledJob.

ScheduledJob(s) can be configured as Quartz-based Jobs or as Runnable(s).

ScheduledJob(s) implement the org.quartz.StatefulJob and Runnable interfaces. ScheduledJob(s) include a method named executeJob(), which descendents override to do real work.

When configured as a Quartz Job, org.quartz.Job#execute() invokes executeJob(). When configured as a Runnable job, run() invokes executeJob().

DefaultDatabasePollerScheduledJob#executeJob() method does the following:

A TableSet is a configurable connector for interacting with relational databases. TableSet(s) are included in the the org.osesb.connectors.jdbc package. A TableSet uses a TableSetAdapter to accomplish specific interactions, such as selecting rows from a database, updating rows in a database, or converting data in database rows to XML. A TableSet exposes two methods:

For example, a TableSet that is used to update a database might return an Integer with a value that is equal to the number of rows that were updated while a TableSet that executes a query might return a java.sql.ResultSet or a com.sun.rowset.CachedRowSetImpl.

Database poller scheduled jobs expect a <job-configuration> ScheduledJobConfiguration element that contains a DatabasePollerConfiguration, which includes a org.osesb.connectors.jdbc.TableSetConfiguration and a org.osesb.msgrouting.configuration.ClientGatewayConfiguration.

For Quartz-based database pollers, databasePollerConfiguration is set by execute(). For Runnable ScheduledJob(s), databasePollerConfiguration is set by the constructor that takes a ScheduledJobConfiguration as the parameter.

The TableSetConfiguration is used for processing database changes. A TableSetConfiguration includes:

The following TableSetAdapter classes are provided out of the box:

The ClientGatewayConfiguration configures a org.osesb.msgrouting.configuration.ClientGateway, which is used to send messages to osESB. Typically, the ClientGateway configures a org.osesb.messagepipeline.MessagePipeline with org.osesb.messagepipeline.PipelineStage(s) that: