com.ibm.websphere.scheduler

Interface TaskStatus

All Superinterfaces:
java.io.Serializable
All known subinterfaces:
BeanTaskInfo, MessageTaskInfo, TaskInfo

  1. public interface TaskStatus
  2. extends java.io.Serializable
The current state of a scheduled task.

The Scheduler interface has methods which allow modifying and viewing a task that was created using the Scheduler.create(TaskInfo) method. Throughout the lifetime of a task, the status will change and it might be useful to know what that state is.

A TaskStatus record that represents the current state can be obtained from various Scheduler methods, and can be specifically queried using the Scheduler.getStatus(String) method. TaskStatus is a snapshot of the task's state and does not change. To retrieve the current state of a task, the Scheduler.getStatus(String) method must be re-run.

The getStatus() method returns the current state of the task within its life cycle. The method in which the TaskStatus was retrieved and the semantics of the task itself determine if this state reflects the current state or the next effective state.

A task's normal life cycle, when using the quality of service TaskInfo.QOS_ATLEASTONCE or the task execution option of TaskInfo.EXECUTION_DELAYEDUPDATE, is:
SCHEDULED > RUNNING > COMPLETE

If a task is repeating:
SCHEDULED > RUNNING > SCHEDULED > RUNNING > ...

If a task is automatically purged:
SCHEDULED > RUNNING > INVALID

The SUSPENDED, CANCELLED and INVALID states can occur anytime during the task's life cycle.

If the task is using the default TaskInfo.QOS_ONLYONCE quality of service, the RUNNING state is never used. The task always reflects the next effective state.

Since:
5.0
See Also:
Scheduler

Field Summary

Modifier and Type Field and Description
  1. static
  2. int
CANCELLED
The scheduled task has been cancelled using the Scheduler.cancel method.
  1. static
  2. int
COMPLETE
The scheduled task has fired to completion.
  1. static
  2. int
INVALID
The scheduled task has been purged and is no longer valid.
  1. static
  2. int
RUNNING
The scheduled task is currently executing.
  1. static
  2. int
SCHEDULED
The scheduled task is currently scheduled to execute.
  1. static
  2. long
serialVersionUID
  1. static
  2. int
SUSPENDED
The scheduled task is suspended.

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
getName()
Get the name of the task.
  1. java.util.Date
getNextFireTime()
Get the date and time which this task is scheduled to fire next.
  1. int
getRepeatsLeft()
Get the number of repeats that are left for this task.
  1. int
getStatus()
Get the status of a task that is retrieved from a Scheduler.
  1. java.lang.String
getTaskId()
Get the task identifier for this task that was assigned when the task was created.
  1. java.util.Date
getTimeCreated()
Get the date and time which this task was originally created.

Field Detail

serialVersionUID

  1. static final long serialVersionUID
See Also:

SCHEDULED

  1. static final int SCHEDULED
The scheduled task is currently scheduled to execute.
Since:
5.0
See Also:

SUSPENDED

  1. static final int SUSPENDED
The scheduled task is suspended. The task will not fire until it is resumed.
Since:
5.0
See Also:

CANCELLED

  1. static final int CANCELLED
The scheduled task has been cancelled using the Scheduler.cancel method. The task will not fire and it cannot be resumed, but it can be purged.
Since:
5.0
See Also:

COMPLETE

  1. static final int COMPLETE
The scheduled task has fired to completion. Each time a task fires, the number of repeats is decremented until it reaches zero. Once it reaches this state, it cannot be resumed, but it can be purged.
Since:
5.0
See Also:

RUNNING

  1. static final int RUNNING
The scheduled task is currently executing.
Since:
5.0
See Also:

INVALID

  1. static final int INVALID
The scheduled task has been purged and is no longer valid.
Since:
5.0
See Also:

Method Detail

getStatus

  1. int getStatus()
Get the status of a task that is retrieved from a Scheduler.
Returns:
one of the several status constants defined in TaskStatus
Since:
5.0
See Also:

getTaskId

  1. java.lang.String getTaskId()
Get the task identifier for this task that was assigned when the task was created.
Returns:
the task identifier for this task.
Since:
5.0
See Also:

getName

  1. java.lang.String getName()
Get the name of the task.
Returns:
the name of the task which was set with TaskInfo.setName.
Since:
5.0
See Also:

getRepeatsLeft

  1. int getRepeatsLeft()
Get the number of repeats that are left for this task.
Returns:
the number of outstanding repeats for this task.
Since:
5.0

getNextFireTime

  1. java.util.Date getNextFireTime( )
Get the date and time which this task is scheduled to fire next.
Returns:
the date and time which this task is scheduled to fire next.
Since:
5.0

getTimeCreated

  1. java.util.Date getTimeCreated()
Get the date and time which this task was originally created.
Returns:
the date and time which this task was originally created.
Since:
5.0