public class WorkEvent
extends java.util.EventObject
Work instance.| Modifier and Type | Field and Description |
|---|---|
private static int |
DURATION_IDX |
private WorkException |
e
The exception that occured during
Work processing. |
private static int |
EXCPEPTION_IDX |
private static java.io.ObjectStreamField[] |
serialPersistentFields
Persistence fields information
|
private static long |
serialVersionUID
Serial version uid
|
private long |
startDuration
The start delay duration (in milliseconds).
|
private int |
type
The event type.
|
private static int |
TYPE_IDX |
private Work |
work
The
Work object on which the event occured. |
static int |
WORK_ACCEPTED
Indicates
Work instance has been accepted. |
static int |
WORK_COMPLETED
Indicates
Work instance has completed execution. |
private static int |
WORK_IDX |
static int |
WORK_REJECTED
Indicates
Work instance has been rejected. |
static int |
WORK_STARTED
Indicates
Work instance has started execution. |
| Constructor and Description |
|---|
WorkEvent(java.lang.Object source,
int type,
Work work,
WorkException exc)
Constructor.
|
WorkEvent(java.lang.Object source,
int type,
Work work,
WorkException exc,
long startDuration)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
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. |
private void |
readObject(java.io.ObjectInputStream ois)
Read object
|
private void |
writeObject(java.io.ObjectOutputStream oos)
Write object
|
private static final long serialVersionUID
private static final java.io.ObjectStreamField[] serialPersistentFields
private static final int TYPE_IDX
private static final int WORK_IDX
private static final int EXCPEPTION_IDX
private static final int DURATION_IDX
public static final int WORK_ACCEPTED
Work instance has been accepted.public static final int WORK_REJECTED
Work instance has been rejected.public static final int WORK_STARTED
Work instance has started execution.public static final int WORK_COMPLETED
Work instance has completed execution.private int type
private Work work
Work object on which the event occured.private WorkException e
Work processing.private long startDuration
public WorkEvent(java.lang.Object source,
int type,
Work work,
WorkException exc)
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(java.lang.Object source,
int type,
Work work,
WorkException exc,
long startDuration)
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).public int getType()
public Work getWork()
Work instance which is the cause of the event.Work instance.public long getStartDuration()
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. The actual
WorkException subtype returned depends on the type of the
event.WorkRejectedException or a
WorkCompletedException, if any.private void readObject(java.io.ObjectInputStream ois)
throws java.lang.ClassNotFoundException,
java.io.IOException
ois - The object input streamjava.lang.ClassNotFoundException - If a class can not be foundjava.io.IOException - Thrown if an error occursprivate void writeObject(java.io.ObjectOutputStream oos)
throws java.io.IOException
oos - The object output streamjava.io.IOException - Thrown if an error occurs