Using application scheduler

Presented here is information to manage, develop and interoperate with application schedulers and subsequent tasks.

Before you begin

Application schedulers enable J2EE application tasks to run at a requested time.

You can schedule the following types of tasks:

In addition to the two tasks listed above, application schedulers enable application developers to create their own stateless session EJB components and receive event notifications during a task lifecycle. By creating stateless sessions, these components allow custom logging utilities or workflow applications to be used without extensive development time or effort. Stateless session EJB components provide generic calendar schedulings. Developers can either use the supplied calendar bean or create their own calendar bean for their existing business calendars. For example, one of your business processes might involve invoicing for services. With the application scheduler's use of stateless EJB components, you can schedule periodic email distributions to your customers who have received invoices. The application scheduler performs these tasks, repeating as necessary, according to the metadata for that task.

A application scheduler is the mechanism by which the timer service for Enterprise Java Beans 2.1 runs. You can configure the EJB timer service to use many of the features that application schedulers provide. See the timer service for Enterprise Java Beans 2.1 documentation for more details.

Why and when to perform this task

Use the following table to determine which persistent timer service is best for you:
Table 1. Timer Services Table
Schedulers EJB Timers
Run stateless session EJB components and sends JMS messages Run all EJB types except for stateful session beans
Persistent, transactional and highly available. Persistent, transactional and highly available.
Tasks guaranteed to run only once Timers guaranteed to run only once, if the timer EJB uses a container-managed global transaction
Run repeating tasks using any calculation rules Run repeating tasks using a repeating interval defined in milliseconds
Uses a modified fixed-delay time calculation to determine repeating intervals (next run time based on the start-time of the previous task) Uses a fixed-rate time calculation to determine repeating intervals (time of the next task is based on the original scheduled time).
Programmatic task monitoring capability with the use of the NotificationSink stateless session EJB No programmatic timer monitoring
Abort late or time-sensitive tasks from running Abort late or time-sensitive tasks from running (achieved through manual detection within the javax.ejb.TimedObject implementation).
Manage any task lifecycle (find, suspend, resume, cancel and purge tasks programmatically and through Java Management Extensions (JMX)). Find and cancel its timers programmatically. Administrators find and cancel timers using a command-line utility.
Store a limited amount of text with the data, like a Name (arbitrary data stored externally.) Store arbitrary data with a timer

Listed here are three topics the cover managing, developing and interoperating with schedulers and subsequent tasks.

What to do next


Copyright IBM Corp. 2003, 2005 |