public class TerminatedActivityState extends ActivityState
NodeStates. However, the termination state provides additional information
depending on the state. This includes the timeout for a suspended activity
that wants to be resumed after a specific time, the error information
(message, state, code) for a failed activity and the signal in case the
activity terminated due to an arbitrary signal. This arbitrary signal is
handled by the superclass.
Note that just like ActivityState
TerminatedActivityState is read-only; when changing the state a
new ActivityState needs to be created. This also avoids the need
for synchronising access to this class.
| Modifier and Type | Class and Description |
|---|---|
static class |
TerminatedActivityState.TerminatedState
An enumeration for the state of an activity after its termination.
|
ActivityState.State| Constructor and Description |
|---|
TerminatedActivityState(int signalledSignal)
Creates a new a
TerminatedActivityState for a signalled state
having the designated suspend timeout. |
TerminatedActivityState(long suspendTimeout)
Creates a new a
TerminatedActivityState for a suspended state
having the designated suspend timeout. |
TerminatedActivityState(java.lang.String errorMessage,
java.lang.String errorState,
long errorCode)
Creates a new a
TerminatedActivityState for a failed state
having the designated error information. |
TerminatedActivityState(TerminatedActivityState.TerminatedState state)
Creates a new a
TerminatedActivityState for the designated
(simple) terminated state. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Long |
getErrorCode()
Gets the arbitrary code indicating the error in case the activity has
failed.
|
java.lang.String |
getErrorMessage()
Gets the arbitrary message indicating the error in case the activity has
failed.
|
java.lang.String |
getErrorState()
Gets the arbitrary state indicating the error in case the activity has
failed.
|
java.lang.Long |
getSuspendTimeout()
Gets the timeout in case the activity has suspended and wants to be resumed
after the designated time has elapsed.
|
TerminatedActivityState.TerminatedState |
getTerminatedState()
Gets the state of the activity after its termination.
|
getLastSignal, getStatepublic TerminatedActivityState(TerminatedActivityState.TerminatedState state)
TerminatedActivityState for the designated
(simple) terminated state. No signal, no suspend timeout and no error
information will be set.state - The (simple) terminated state for the created
ActivityState.public TerminatedActivityState(long suspendTimeout)
TerminatedActivityState for a suspended state
having the designated suspend timeout. No signal and no error information
will be set.suspendTimeout - The timeout in milliseconds the activity wants to be
resumed after its suspension.public TerminatedActivityState(int signalledSignal)
TerminatedActivityState for a signalled state
having the designated suspend timeout. No suspend timeout and no error
information will be set.signalledSignal - The signal the activity has received that led to the
termination.public TerminatedActivityState(java.lang.String errorMessage,
java.lang.String errorState,
long errorCode)
TerminatedActivityState for a failed state
having the designated error information. No signal and no suspend timeout
will be set.errorMessage - The error message to be interpreted by a user or by a
failure handling routine.errorState - Arbitrary state information specific to the instance,
comparable to the vendor code in
SQLException.errorCode - The error code specifying the type of error.public TerminatedActivityState.TerminatedState getTerminatedState()
public java.lang.Long getSuspendTimeout()
null in
case the activity has not suspended or does not have a timeout for resume.null in case the activity has not suspended
or does not have a timeout for resume.public java.lang.String getErrorMessage()
null in case the activity has not failed
but another terminated state.null in case the activity has not failed but
another terminated state.public java.lang.String getErrorState()
null in case the activity has not failed
but another terminated state.null in case the activity has not
failed but another terminated state.public java.lang.Long getErrorCode()
null in case the activity has not failed
but another terminated state.null in case the activity has not failed but
another terminated state.