Synapta Services Builder for CICS Version 3.0

com.attachmate.tasks
Class TaskStatusChangeEvent

java.lang.Object
  extended byjava.util.EventObject
      extended bycom.attachmate.tasks.TaskStatusChangeEvent
All Implemented Interfaces:
java.io.Serializable

public class TaskStatusChangeEvent
extends java.util.EventObject

This class represents an event fired by a task bean when a task bean status changes.

This same object can also be retrieved via ITask.getStatus. The TaskStatusChangeEvent's state consists of

See Also:
ITask, ITaskListener, Serialized Form

Field Summary
protected  java.lang.Exception m_exception
          Optional exception object describing the cause of failure.
protected  int m_status
          Status code (from task status constants).
static int TASK_CANCELED
          Task status constant indicating task execution was canceled by the user.
static int TASK_CREATED
          Task status constant indicating task is created but executeSync or executeAsync has not been called yet.
static int TASK_FAILED
          Task status constant indicating unsuccessful completion of the task execution.
static int TASK_STARTED
          Task status constant indicating task started.
static int TASK_SUCCESSFUL
          Task status constant indicating successful completion of the task execution.
static int TASK_TIMEOUT
          Task status constant indicating task execution could not complete within the specified timeout.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TaskStatusChangeEvent(java.lang.Object source)
          Constructs a new TaskStatusChangeEvent using default status information and no exception.
TaskStatusChangeEvent(java.lang.Object source, int status)
          Constructs a new TaskStatusChangeEvent with status information.
TaskStatusChangeEvent(java.lang.Object source, int status, java.lang.Exception exception)
          Constructs a new TaskStatusChangeEvent with status and exception information.
 
Method Summary
 java.lang.Exception getException()
          Optional event information.
 int getStatus()
          Task completion status
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TASK_CREATED

public static final int TASK_CREATED
Task status constant indicating task is created but executeSync or executeAsync has not been called yet. A task listener event is not fired with this status. However, this status may be received if a client calls getStatus on the task bean before executing it.

See Also:
Constant Field Values

TASK_STARTED

public static final int TASK_STARTED
Task status constant indicating task started. This happens when executeSync or executeAsync is called on the task bean.

See Also:
Constant Field Values

TASK_SUCCESSFUL

public static final int TASK_SUCCESSFUL
Task status constant indicating successful completion of the task execution.

See Also:
Constant Field Values

TASK_FAILED

public static final int TASK_FAILED
Task status constant indicating unsuccessful completion of the task execution.

See Also:
Constant Field Values

TASK_CANCELED

public static final int TASK_CANCELED
Task status constant indicating task execution was canceled by the user.

See Also:
Constant Field Values

TASK_TIMEOUT

public static final int TASK_TIMEOUT
Task status constant indicating task execution could not complete within the specified timeout.

See Also:
Constant Field Values

m_status

protected int m_status
Status code (from task status constants).


m_exception

protected java.lang.Exception m_exception
Optional exception object describing the cause of failure.

Constructor Detail

TaskStatusChangeEvent

public TaskStatusChangeEvent(java.lang.Object source)
Constructs a new TaskStatusChangeEvent using default status information and no exception. This has the effect of creating an event object that reports successful completion status.

Parameters:
source - reference to the object that fired this event

TaskStatusChangeEvent

public TaskStatusChangeEvent(java.lang.Object source,
                             int status)
Constructs a new TaskStatusChangeEvent with status information.

Parameters:
source - reference to the object that fired this event
status - event status information (one of the task status constants)

TaskStatusChangeEvent

public TaskStatusChangeEvent(java.lang.Object source,
                             int status,
                             java.lang.Exception exception)
Constructs a new TaskStatusChangeEvent with status and exception information.

Parameters:
source - reference to the object that fired this event
status - event status information (one of the task status constants)
exception - optional exception describing a task failure in more detail
Method Detail

getStatus

public int getStatus()
Task completion status

Returns:
one of the task status constants

getException

public java.lang.Exception getException()
Optional event information. The event dispatcher may wish to forward an exception that was thrown during task execution containing more information about a task failure.

Returns:
exception object or null if the task completed successfully or exception was not set by dispatcher

Synapta Services Builder for CICS Version 3.0