WorkEvent (Java EE 5 SDK)

Java

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


javax.resource.spi.work Class WorkEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.resource.spi.work.WorkEvent
所有已实现的接口:
Serializable

public class WorkEvent
extends EventObject

This class models the various events that occur during the processing of a Work instance.

版本:
1.0
作者:
Ram Jeyaraman
另请参见:
Serialized Form

字段摘要
static int WORK_ACCEPTED
          Indicates Work instance has been accepted.
static int WORK_COMPLETED
          Indicates Work instance has completed execution.
static int WORK_REJECTED
          Indicates Work instance has been rejected.
static int WORK_STARTED
          Indicates Work instance has started execution.
 
Fields inherited from class java.util.EventObject
source
 
构造器摘要
WorkEvent(Object source, int type, Work work, WorkException exc)
          Constructor.
WorkEvent(Object source, int type, Work work, WorkException exc, long startDuration)
          Constructor.
 
方法摘要
 WorkException getException()
          Return the WorkException.
 long getStartDuration()
          Return the start interval duration.
 int getType()
          Return the type of this event.
 Work getWork()
          Return the Work instance which is the cause of the event.
 
类方法继承 java.util.EventObject
getSource, toString
 
类方法继承 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

字段详细信息

WORK_ACCEPTED

public static final int WORK_ACCEPTED
Indicates Work instance has been accepted.

另请参见:
常量字段


WORK_REJECTED

public static final int WORK_REJECTED
Indicates Work instance has been rejected.

另请参见:
常量字段


WORK_STARTED

public static final int WORK_STARTED
Indicates Work instance has started execution.

另请参见:
常量字段


WORK_COMPLETED

public static final int WORK_COMPLETED
Indicates Work instance has completed execution.

另请参见:
常量字段

构造器详细信息

WorkEvent

public WorkEvent(Object source,
                 int type,
                 Work work,
                 WorkException exc)
Constructor.

参数:
source - The object on which the event initially occurred.
type - The event type.
work - The Work object on which the event occured.
exc - The exception that occured during Work processing.


WorkEvent

public WorkEvent(Object source,
                 int type,
                 Work work,
                 WorkException exc,
                 long startDuration)
Constructor.

参数:
source - The object on which the event initially occurred.
type - The event type.
work - The Work object on which the event occured.
exc - The exception that occured during Work processing.
startDuration - The start delay duration (in milliseconds).

方法详细信息

getType

public int getType()
Return the type of this event.

返回:
the event type.

getWork

public Work getWork()
Return the Work instance which is the cause of the event.

返回:
the Work instance.

getStartDuration

public long getStartDuration()
Return the start interval duration.

返回:
the time elapsed (in milliseconds) since the Work was accepted, until the Work execution started. Note, this does not offer real-time guarantees. It is valid to return -1, if the actual start interval duration is unknown.

getException

public WorkException getException()
Return the WorkException. The actual WorkException subtype returned depends on the type of the event.

返回:
a WorkRejectedException or a WorkCompletedException, if any.

Java EE 5 SDK

深圳电信培训中心.徐海蛟老师.


提交错误或意见

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。深圳电信培训中心.徐海蛟老师教学参考.