IBM WebSphere Application ServerTM
Release 8

com.ibm.websphere.scheduler
Class TaskNotificationInfo

java.lang.Object
  extended by com.ibm.websphere.scheduler.TaskNotificationInfo
All Implemented Interfaces:
java.io.Serializable

public class TaskNotificationInfo
extends java.lang.Object
implements java.io.Serializable

The notification information sent to a NotificationSink bean.

When a notification is fired, the NotificationSink bean will receive an instance of this object and can then retrieve the TaskStatus and type of event that has occurred.

Several event types are available as constants within this class. The are used both when specifying a filter on the TaskInfo.setNotificationSink method and in the TaskNotificationInfo.getEventType method when receiving a notification.

Since:
5.0
Version:
5.0
See Also:
NotificationSink, TaskInfo.setNotificationSink(com.ibm.websphere.scheduler.NotificationSinkHome), Serialized Form

Field Summary
static int ALL_EVENTS
          Used in the TaskInfo.setNotificationSink method to indicate that all events should be captured.
static int CANCELLED
          The task has been cancelled.
static int COMPLETE
          The task has been completed.
protected  int eventType
          An event type constant defined in this class.
static int FIRE_DELAYED
          The task was unable to start by the designated time or interval and was skipped.
static int FIRE_FAILED
          The task has fired, but the TaskInfo threw an unexpected exception when executing.
static int FIRED
          The task has fired.
static int FIRING
          The task is firing.
static int PURGED
          The task was purged from the persistent store.
static int RESUMED
          The task was resumed.
static int SCHEDULED
          The task was currently scheduled.
static int SUSPENDED
          The task was suspended.
protected  TaskStatus taskStatus
          The TaskStatus of the task that fired this notification.
protected  java.util.Date time
          The date/time at which the notification fired or created
 
Constructor Summary
TaskNotificationInfo(TaskStatus taskStatus, int eventType)
          Main constructor for the TaskNotificationInfo
 
Method Summary
 int getEventType()
          The type of event that was fired.
 TaskStatus getTaskStatus()
          Get the TaskStatus of the task that fired this notification.
 java.util.Date getTime()
          The date/time at which the notification was fired.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SCHEDULED

public static final int SCHEDULED
The task was currently scheduled. This will occur either when a TaskInfo is scheduled for the first time using Scheduler.create or when the task reschedules itself when the TaskInfo.setNumberOfRepeats parameter is >1.

Since:
5.0
See Also:
Scheduler.create(com.ibm.websphere.scheduler.TaskInfo), Constant Field Values

PURGED

public static final int PURGED
The task was purged from the persistent store. This happens when the Scheduler.purge method is called, when Scheduler.cancel is called with the purgeAlso parameter set to true and when a task has completed and the TaskInfo.setAutoPurge property is set to true.

Since:
5.0
See Also:
Scheduler.purge(java.lang.String), TaskInfo.setAutoPurge(boolean), Constant Field Values

SUSPENDED

public static final int SUSPENDED
The task was suspended.

Since:
5.0
See Also:
Scheduler.suspend(java.lang.String), Constant Field Values

RESUMED

public static final int RESUMED
The task was resumed.

Since:
5.0
See Also:
Scheduler.resume(java.lang.String), Constant Field Values

COMPLETE

public static final int COMPLETE
The task has been completed. The number of repeats left on the scheduled TaskInfo have reached zero.

Since:
5.0
See Also:
Constant Field Values

CANCELLED

public static final int CANCELLED
The task has been cancelled.

Since:
5.0
See Also:
Scheduler.cancel(java.lang.String, boolean), Constant Field Values

FIRED

public static final int FIRED
The task has fired. The FIRED event occurs immediately after the task successfully executes. The FIRED event only occurs when task execution is successful, if the task throws an exeception during execution, then the notification event will be FIRE_FAILED rather than FIRED.

Since:
5.0
See Also:
TaskInfo, FIRE_FAILED, Constant Field Values

FIRE_FAILED

public static final int FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.

Since:
5.0
See Also:
TaskInfo, Constant Field Values

FIRE_DELAYED

public static final int FIRE_DELAYED
The task was unable to start by the designated time or interval and was skipped. This occurs when the scheduler daemon was unable to fire a task at the scheduled time and has exceeded the start-by interval set for the task. The task will be rescheduled for the next available time if the repeat count hasn't reached zero.

Since:
5.0
See Also:
TaskInfo.setStartByInterval(java.lang.String), Constant Field Values

FIRING

public static final int FIRING
The task is firing. The FIRING event occurs immediately before the task executes.

Since:
5.03
See Also:
Constant Field Values

ALL_EVENTS

public static final int ALL_EVENTS
Used in the TaskInfo.setNotificationSink method to indicate that all events should be captured.

Since:
5.0
See Also:
Constant Field Values

taskStatus

protected TaskStatus taskStatus
The TaskStatus of the task that fired this notification.

Since:
5.0

eventType

protected int eventType
An event type constant defined in this class.

Since:
5.0

time

protected java.util.Date time
The date/time at which the notification fired or created

Since:
5.0
Constructor Detail

TaskNotificationInfo

public TaskNotificationInfo(TaskStatus taskStatus,
                            int eventType)
Main constructor for the TaskNotificationInfo

Parameters:
taskStatus - the current TaskStatus.
eventType - the type of event to notify with.
Since:
5.0
Method Detail

getTaskStatus

public TaskStatus getTaskStatus()
Get the TaskStatus of the task that fired this notification.

Returns:
the TaskStatus of the task that fired this notification.
Since:
5.0

getEventType

public int getEventType()
The type of event that was fired.

Returns:
the event type that was fired. See the constants within this class for the possible values.
Since:
5.0
See Also:
SCHEDULED, PURGED, SUSPENDED, RESUMED, COMPLETE, CANCELLED, FIRING, FIRED, FIRE_FAILED

getTime

public java.util.Date getTime()
The date/time at which the notification was fired.

Returns:
the java.util.Date at which the notification was fired.
Since:
5.0

IBM WebSphere Application ServerTM
Release 8