Class TerminatedActivityState
java.lang.Object
de.aristaflow.adept2.model.runtimeenvironment.ActivityState
de.aristaflow.adept2.model.runtimeenvironment.TerminatedActivityState
- All Implemented Interfaces:
Serializable
This class distinguishes the several termination states of an activity as an
extension to the states of the component of an activity. This is closely
related to
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.
- Author:
- Ulrich Kreher
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumAn enumeration for the state of an activity after its termination.Nested classes/interfaces inherited from class de.aristaflow.adept2.model.runtimeenvironment.ActivityState
ActivityState.State -
Constructor Summary
ConstructorsConstructorDescriptionTerminatedActivityState(int signalledSignal) Creates a new aTerminatedActivityStatefor a signalled state having the designated suspend timeout.TerminatedActivityState(long suspendTimeout) Creates a new aTerminatedActivityStatefor a suspended state having the designated suspend timeout.Creates a new aTerminatedActivityStatefor the designated (simple) terminated state.TerminatedActivityState(String errorMessage, String errorState, long errorCode) Creates a new aTerminatedActivityStatefor a failed state having the designated error information. -
Method Summary
Modifier and TypeMethodDescriptionGets the arbitrary code indicating the error in case the activity has failed.Gets the arbitrary message indicating the error in case the activity has failed.Gets the arbitrary state indicating the error in case the activity has failed.Gets the timeout in case the activity has suspended and wants to be resumed after the designated time has elapsed.Gets the state of the activity after its termination.Methods inherited from class de.aristaflow.adept2.model.runtimeenvironment.ActivityState
getLastSignal, getState
-
Constructor Details
-
TerminatedActivityState
Creates a new aTerminatedActivityStatefor the designated (simple) terminated state. No signal, no suspend timeout and no error information will be set.- Parameters:
state- The (simple) terminated state for the createdActivityState.
-
TerminatedActivityState
public TerminatedActivityState(long suspendTimeout) Creates a new aTerminatedActivityStatefor a suspended state having the designated suspend timeout. No signal and no error information will be set.- Parameters:
suspendTimeout- The timeout in milliseconds the activity wants to be resumed after its suspension.
-
TerminatedActivityState
public TerminatedActivityState(int signalledSignal) Creates a new aTerminatedActivityStatefor a signalled state having the designated suspend timeout. No suspend timeout and no error information will be set.- Parameters:
signalledSignal- The signal the activity has received that led to the termination.
-
TerminatedActivityState
Creates a new aTerminatedActivityStatefor a failed state having the designated error information. No signal and no suspend timeout will be set.- Parameters:
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.SQLExceptionerrorCode- The error code specifying the type of error.
-
-
Method Details
-
getTerminatedState
Gets the state of the activity after its termination.- Returns:
- The state of the activity after its termination.
-
getSuspendTimeout
Gets the timeout in case the activity has suspended and wants to be resumed after the designated time has elapsed. This will benullin case the activity has not suspended or does not have a timeout for resume.- Returns:
- The timeout in case the activity has suspended and wants to be
resumed or
nullin case the activity has not suspended or does not have a timeout for resume.
-
getErrorMessage
Gets the arbitrary message indicating the error in case the activity has failed. This will benullin case the activity has not failed but another terminated state.- Returns:
- The arbitrary message indicating the error in case the activity has
failed or
nullin case the activity has not failed but another terminated state.
-
getErrorState
Gets the arbitrary state indicating the error in case the activity has failed. This will benullin case the activity has not failed but another terminated state.- Returns:
- The arbitrary state indicating the error in case the activity has
failed or
nullin case the activity has not failed but another terminated state.
-
getErrorCode
Gets the arbitrary code indicating the error in case the activity has failed. This will benullin case the activity has not failed but another terminated state.- Returns:
- The arbitrary code indicating the error in case the activity has
failed or
nullin case the activity has not failed but another terminated state.
-