Why and when to perform this task
Various notification events are generated by a scheduler when it performs an operation on a task. These events include:
To receive notification events, call the setNotificationSink() method on the TaskInfo interface before creating the event. The setNotificationSink() method enables you to specify the session bean that is to act as the callback, and a mask that restricts which events are generated.
Steps for this task
com.ibm.websphere.scheduler.NotificationSinkHome com.ibm.websphere.scheduler.NotificationSink
public void handleEvent(TaskNotificationInfo task) throws java.rmi.RemoteException;
TaskInfo taskInfo = ... Object o = new InitialContext().lookup("java:comp/env/ejb/NotificationSink"); NotificationSinkHome home = (NotificationSinkHome )javax.rmi.PortableRemoteObject.narrow(o,NotificationSinkHome.class); taskInfo.setNotificationSink(home,TaskNotificationInfo.ALL_EVENTS);
int eventMask = TaskNotificationInfo.CREATED+TaskNotificationInfo.PURGED;