IBM WebSphere Application ServerTM
Release 6

Package  com.ibm.websphere.scheduler

Interface Summary
UserCalendarHomeThe home interface used for all UserCalendar beans.
UserCalendarThe remote interface for all UserCalendar stateless session beans.
SchedulerThe central object for managing and creating tasks.
MessageTaskInfoUsed to create a scheduled task which sends a JMS message to either a Queue or Topic.
NotificationSinkThe remote interface for all NotificationSink stateless session beans.
TaskHandlerThe remote interface for all TaskHandler stateless session beans.
NotificationSinkHomeThe home interface for all NotificationSink stateless session beans.
TaskHandlerHomeThe home interface for all TaskHandler stateless session beans.
TaskStatusThe current state of a scheduled task.
TaskInfoInterface for all scheduled tasks.
BeanTaskInfoUsed to create a scheduled task which executes a TaskHandler bean.

Class Summary
TaskNotificationInfoThe notification information sent to a NotificationSink bean.

Exception Summary
SchedulerRuntimeExceptionA general unplanned Scheduler exception.
TaskPendingA task update is pending.
TaskInfoInvalidException thrown when a task interface used to create a TaskInfo object is not a registered type.
SchedulerNotAvailableExceptionThe persistent store is unavailable.
NotificationExceptionA NotficationSink failed to fire.
IllegalTaskStateInvalid operation for current task state.
TaskInvalidThe specified task identifier is not valid.
UserCalendarPeriodInvalidThe UserCalendar period value is incorrect.
UserCalendarSpecifierInvalidThe UserCalendar specifier value is unknown.
NotificationSinkInvalidInvalid NotificationSink object detected.
SchedulerExceptionA general Scheduler exception.
UserCalendarExceptionA general UserCalendar exception.
UserCalendarInvalidInvalid UserCalendar object detected.



Package Description

The scheduler adds a persistent, transactional timer service to J2EE applications. It allows a server application to periodically invoke a session bean or send a JMS message using a flexible pluggable calendar mechanism.

Required jars

Applications that use these APIs must have the scheduler-client.jar JAR in the Java classpath. This is located in the lib directory of the WebSphere Application Server.

Scheduler

A scheduler allows an application to schedule a single or repeating task. This is done persistently and transactionally using the Scheduler interface. Each task is guaranteed to run exactly once. The task can either call a stateless session bean or the send a JMS message to a queue or topic.

The time at which the task runs can be specified using a java.util.Date or a calendar interval. See the calendars section below for more information.

EJB Task

When a task calls a session bean using the BeanTaskInfo interface, the target session bean must use a specific home and remote interface (TaskHandler and TaskHandlerHome). These interfaces cannot be extended and must be used as-is. Once the session bean is called, it can call any business logic that it chooses. It is called inside a transaction provided by the scheduler. If it fails or rolls back then it will be rolled back and will automatically be retried until successful or cancelled.

JMS Task

When a task sends a JMS message using the MessageTaskInfo interface, the body and headers can be provided along with the queue connection factory or topic connection factory and queue/topic to use. This will be sent within the scheduler transaction.

Calendars

The scheduler allows applications to specify a time based interval for the tasks to run. The scheduler provides a set of calendars in the SchedulerCalendars system application that all applications can use. Additional calendars can be created and are implemented as stateless session beans. Each bean must specify the UserCalendar remote interface and UserCalendarHome home interface. Once a bean is created and deployed, applications can specify which calendar EJB to use on a task by task basis. These calendar EJBs must be made available to each server that could potentially run the task.
IBM WebSphere Application ServerTM
Release 6