Package jakarta.resource.spi.work
Class WorkEvent
- java.lang.Object
- 
- java.util.EventObject
- 
- jakarta.resource.spi.work.WorkEvent
 
 
- 
- All Implemented Interfaces:
- Serializable
 
 public class WorkEvent extends EventObject This class models the various events that occur during the processing of aWorkinstance.- Version:
- 1.0
- Author:
- Ram Jeyaraman
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static intWORK_ACCEPTEDIndicatesWorkinstance has been accepted.static intWORK_COMPLETEDIndicatesWorkinstance has completed execution.static intWORK_REJECTEDIndicatesWorkinstance has been rejected.static intWORK_STARTEDIndicatesWorkinstance has started execution.- 
Fields inherited from class java.util.EventObjectsource
 
- 
 - 
Constructor SummaryConstructors Constructor Description WorkEvent(Object source, int type, Work work, WorkException exc)Constructor.WorkEvent(Object source, int type, Work work, WorkException exc, long startDuration)Constructor.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description WorkExceptiongetException()Return theWorkException.longgetStartDuration()Return the start interval duration.intgetType()Return the type of this event.WorkgetWork()Return theWorkinstance which is the cause of the event.- 
Methods inherited from class java.util.EventObjectgetSource, toString
 
- 
 
- 
- 
- 
Field Detail- 
WORK_ACCEPTEDpublic static final int WORK_ACCEPTED IndicatesWorkinstance has been accepted.- See Also:
- Constant Field Values
 
 - 
WORK_REJECTEDpublic static final int WORK_REJECTED IndicatesWorkinstance has been rejected.- See Also:
- Constant Field Values
 
 - 
WORK_STARTEDpublic static final int WORK_STARTED IndicatesWorkinstance has started execution.- See Also:
- Constant Field Values
 
 - 
WORK_COMPLETEDpublic static final int WORK_COMPLETED IndicatesWorkinstance has completed execution.- See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
WorkEventpublic 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- Workobject on which the event occured.
- exc- The exception that occured during- Workprocessing.
 
 - 
WorkEventpublic 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- Workobject on which the event occured.
- exc- The exception that occured during- Workprocessing.
- startDuration- The start delay duration (in milliseconds).
 
 
- 
 - 
Method Detail- 
getTypepublic int getType() Return the type of this event.- Returns:
- the event type.
 
 - 
getWorkpublic Work getWork() Return theWorkinstance which is the cause of the event.- Returns:
- the Workinstance.
 
 - 
getStartDurationpublic long getStartDuration() Return the start interval duration.- Returns:
- the time elapsed (in milliseconds) since the Workwas accepted, until theWorkexecution started. Note, this does not offer real-time guarantees. It is valid to return -1, if the actual start interval duration is unknown.
 
 - 
getExceptionpublic WorkException getException() Return theWorkException. The actualWorkExceptionsubtype returned depends on the type of the event.- Returns:
- a WorkRejectedExceptionor aWorkCompletedException, if any.
 
 
- 
 
-