public class TaskNotificationInfo
extends java.lang.Object
implements java.io.Serializable
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.
NotificationSink
,
TaskInfo.setNotificationSink(com.ibm.websphere.scheduler.NotificationSinkHome)
,
Serialized FormModifier and Type | Field and Description |
---|---|
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 and Description |
---|
TaskNotificationInfo(TaskStatus taskStatus,
int eventType)
Main constructor for the TaskNotificationInfo
|
Modifier and Type | Method and Description |
---|---|
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.
|
public static final int SCHEDULED
Scheduler.create
or when the task reschedules itself when
the TaskInfo.setNumberOfRepeats
parameter is >1.Scheduler.create(com.ibm.websphere.scheduler.TaskInfo)
,
Constant Field Valuespublic static final int PURGED
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.Scheduler.purge(java.lang.String)
,
TaskInfo.setAutoPurge(boolean)
,
Constant Field Valuespublic static final int SUSPENDED
Scheduler.suspend(java.lang.String)
,
Constant Field Valuespublic static final int RESUMED
Scheduler.resume(java.lang.String)
,
Constant Field Valuespublic static final int COMPLETE
public static final int CANCELLED
Scheduler.cancel(java.lang.String, boolean)
,
Constant Field Valuespublic static final int FIRED
TaskInfo
,
FIRE_FAILED
,
Constant Field Valuespublic static final int FIRE_FAILED
TaskInfo
,
Constant Field Valuespublic static final int FIRE_DELAYED
TaskInfo.setStartByInterval(java.lang.String)
,
Constant Field Valuespublic static final int FIRING
public static final int ALL_EVENTS
TaskInfo.setNotificationSink
method to
indicate that all events should be captured.protected TaskStatus taskStatus
protected int eventType
protected java.util.Date time
public TaskNotificationInfo(TaskStatus taskStatus, int eventType)
taskStatus
- the current TaskStatus.eventType
- the type of event to notify with.public TaskStatus getTaskStatus()
public int getEventType()
public java.util.Date getTime()