com.ibm.websphere.scheduler

Class TaskNotificationInfo

  1. java.lang.Object
  2. extended bycom.ibm.websphere.scheduler.TaskNotificationInfo
All implemented interfaces:
java.io.Serializable

  1. public class TaskNotificationInfo
  2. extends java.lang.Object
  3. 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

Modifier and Type Field and Description
  1. static
  2. int
ALL_EVENTS
Used in the TaskInfo.setNotificationSink method to indicate that all events should be captured.
  1. static
  2. int
CANCELLED
The task has been cancelled.
  1. static
  2. int
COMPLETE
The task has been completed.
  1. protected
  2. int
eventType
An event type constant defined in this class.
  1. static
  2. int
FIRE_DELAYED
The task was unable to start by the designated time or interval and was skipped.
  1. static
  2. int
FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.
  1. static
  2. int
FIRED
The task has fired.
  1. static
  2. int
FIRING
The task is firing.
  1. static
  2. int
PURGED
The task was purged from the persistent store.
  1. static
  2. int
RESUMED
The task was resumed.
  1. static
  2. int
SCHEDULED
The task was currently scheduled.
  1. static
  2. int
SUSPENDED
The task was suspended.
  1. protected
  2. TaskStatus
taskStatus
The TaskStatus of the task that fired this notification.
  1. protected
  2. java.util.Date
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
  1. int
getEventType()
The type of event that was fired.
  1. TaskStatus
getTaskStatus()
Get the TaskStatus of the task that fired this notification.
  1. 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

  1. 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:

PURGED

  1. 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

  1. public static final int SUSPENDED
The task was suspended.
Since:
5.0
See Also:

RESUMED

  1. public static final int RESUMED
The task was resumed.
Since:
5.0
See Also:

COMPLETE

  1. 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:

CANCELLED

  1. public static final int CANCELLED
The task has been cancelled.
Since:
5.0
See Also:

FIRED

  1. 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:

FIRE_FAILED

  1. public static final int FIRE_FAILED
The task has fired, but the TaskInfo threw an unexpected exception when executing.
Since:
5.0
See Also:

FIRE_DELAYED

  1. 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:

FIRING

  1. public static final int FIRING
The task is firing. The FIRING event occurs immediately before the task executes.
Since:
5.03
See Also:

ALL_EVENTS

  1. 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:

taskStatus

  1. protected TaskStatus taskStatus
The TaskStatus of the task that fired this notification.
Since:
5.0

eventType

  1. protected int eventType
An event type constant defined in this class.
Since:
5.0

time

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

Constructor Detail

TaskNotificationInfo

  1. public TaskNotificationInfo(TaskStatus taskStatus,
  2. 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

  1. 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

  1. 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

  1. 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