com.ibm.websphere.scheduler
Class TaskNotificationInfo
- java.lang.Object
com.ibm.websphere.scheduler.TaskNotificationInfo
All implemented interfaces:
java.io.Serializable
- 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.
Since:
5.0
Version:
5.0
See Also:
NotificationSink
,
TaskInfo.setNotificationSink(com.ibm.websphere.scheduler.NotificationSinkHome)
,
Serialized FormField Summary
Modifier and Type | Field and Description |
---|---|
|
ALL_EVENTS
Used in the
TaskInfo.setNotificationSink method to
indicate that all events should be captured.
|
|
CANCELLED
The task has been cancelled.
|
|
COMPLETE
The task has been completed.
|
|
eventType
An event type constant defined in this class.
|
|
FIRE_DELAYED
The task was unable to start by the designated time or interval and was skipped.
|
|
FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.
|
|
FIRED
The task has fired.
|
|
FIRING
The task is firing.
|
|
PURGED
The task was purged from the persistent store.
|
|
RESUMED
The task was resumed.
|
|
SCHEDULED
The task was currently scheduled.
|
|
SUSPENDED
The task was suspended.
|
|
taskStatus
The TaskStatus of the task that fired this notification.
|
|
time
The date/time at which the notification fired or created
|
Constructor Summary
Constructor and Description |
---|
TaskNotificationInfo(TaskStatus taskStatus,int eventType)
Main constructor for the TaskNotificationInfo
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
getEventType()
The type of event that was fired.
|
getTaskStatus()
Get the TaskStatus of the task that fired this notification.
|
|
|
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
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:
SUSPENDED
- public static final int SUSPENDED
The task was suspended.
RESUMED
- public static final int RESUMED
The task was resumed.
COMPLETE
- public static final int COMPLETE
The task has been completed. The number of repeats left on the scheduled TaskInfo
have reached zero.
CANCELLED
- public static final int CANCELLED
The task has been cancelled.
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.
FIRE_FAILED
- public static final int FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.
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.
FIRING
- public static final int FIRING
The task is firing. The FIRING event occurs immediately before the task executes.
ALL_EVENTS
- public static final int ALL_EVENTS
Used in the
TaskInfo.setNotificationSink
method to
indicate that all events should be captured.
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:
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
Scheduler.create
or when the task reschedules itself when theTaskInfo.setNumberOfRepeats
parameter is >1.