|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.resource.spi.work Class WorkEvent
java.lang.Object java.util.EventObject javax.resource.spi.work.WorkEvent
- All Implemented Interfaces:
- Serializable
public class WorkEvent
- extends EventObject
Extends:
java.util.EventObject
此类模型在处理
Work
实例期间发生的各种事件。
version | 1.0 |
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 |
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 |
Constructor Summary | |
---|---|
WorkEvent(Object source,
int type,
Work work,
WorkException exc)
Constructor. |
|
WorkEvent(Object source,
int type,
Work work,
WorkException exc,
long startDuration)
Constructor. |
Method Summary | |
---|---|
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. |
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 |
---|
英文文档:
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
- TheWork
object on which the event occured.exc
- The exception that occured duringWork
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
- TheWork
object on which the event occured.exc
- The exception that occured duringWork
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 theWork
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 |
WorkRejectedException 或 WorkCompletedException (如果有)。 |
getException
public WorkException getException()
- Return the
WorkException
. The actualWorkException
subtype returned depends on the type of the event. - Returns:
- a
WorkRejectedException
or aWorkCompletedException
, if any.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!