WorkEvent (Java EE 5)

Java EE API


javax.resource.spi.work Class WorkEvent

java.lang.Object
  extended by java.util.EventObject
      extended by javax.resource.spi.work.WorkEvent
All Implemented Interfaces:
Serializable

public class WorkEvent
extends EventObject

Extends: java.util.EventObject

此类模型在处理 Work 实例期间发生的各种事件。
英文文档:

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

Version:
1.0
Author:
Ram Jeyaraman
See Also:
Serialized Form

Field Summary
static int
static int
static int
static int
 
Fields inherited from class java.util.EventObject
 
Constructor Summary
 
Method Summary
 WorkException
 long
 int
 Work
 
Methods inherited from class java.util.EventObject
 
Methods inherited from class java.lang.Object
 

Field Detail

英文文档:

WORK_ACCEPTED

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

See Also:
Constant Field Values


英文文档:

WORK_REJECTED

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

See Also:
Constant Field Values


英文文档:

WORK_STARTED

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

See Also:
Constant Field Values


英文文档:

WORK_COMPLETED

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

See Also:
Constant Field Values

Constructor Detail

public WorkEvent(Object source, int type, Work work, WorkException exc)
构造方法。
source 最初发生事件的对象。
type 事件类型。
work 发生事件的 Work 对象。
exc 处理 Work 时发生的异常。
英文文档:

WorkEvent

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

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


public WorkEvent(Object source, int type, Work work, WorkException exc, long startDuration)
构造方法。
source 最初发生事件的对象。
type 事件类型。
work 发生事件的 Work 对象。
exc 处理 Work 时发生的异常。
startDuration 开始延迟期限(以毫秒为单位)。
英文文档:

WorkEvent

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

Parameters:
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).

Method Detail

public int getType()
返回此事件的类型。
return 事件类型。
英文文档:

getType

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

Returns:
the event type.

public Work getWork()
返回作为事件原因的 Work 实例。
return Work 实例。
英文文档:

getWork

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

Returns:
the Work instance.

public long getStartDuration()
返回开始时间间隔期限。
return 从接受 Work 开始直到开始执行 Work 所经过的时间(以毫秒为单位)。注意,此方法不提供实时保证。如果实际开始时间间隔期限未知,则返回 -1 是有效的。
英文文档:

getStartDuration

public long getStartDuration()
Return the start interval duration.

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

public WorkException getException()
返回 WorkException。根据事件类型返回的实际 WorkException 子类型。
return WorkRejectedExceptionWorkCompletedException(如果有)。
英文文档:

getException

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

Returns:
a WorkRejectedException or a WorkCompletedException, if any.


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!