TaskHandler interface
A task handler is a user-defined stateless session bean that is called by tasks created using a BeanTaskInfo object. A task handler bean uses the following home and remote interfaces, which are defined in the deployment descriptor using an assembly tool, such as the Application Server Toolkit (AST) or Rational Web Developer
com.ibm.websphere.scheduler.TaskHandlerHome com.ibm.websphere.scheduler.TaskHandlerThe bean itself needs to implement the process() method defined in the remote interface. For details, see the Interface TaskHandler in the Javadoc.
Once an EJB is created and available within an enterprise application, it can be called by a BeanTaskInfo task when it runs. See the Developing a task that calls a session bean topic for details.
When a task is created using a BeanTaskInfo object, the process() method on the TaskHandler session bean is called whenever the task runs. Because the TaskStatus object for the task is passed as a parameter to the process() method, the task handler determines different types of information about the task, such as when it will fire next, the number of repeats remaining, its name and its ID.
The process() method can also change its own state. However, the task must be running within the same transaction as the scheduler. Therefore, a running task can only modify itself if it is using the Required or Mandatory container managed transaction types. If the Requires New transaction type is specified on the process()method, all management functions deadlock.
Related Tasks
Developing a task that calls a session bean
See Also
Javadoc
Rational is a trademark of the IBM Corporation in the United States, other countries, or both.