Class TerminatedActivityState
- java.lang.Object
-
- de.aristaflow.adept2.model.runtimeenvironment.ActivityState
-
- de.aristaflow.adept2.model.runtimeenvironment.TerminatedActivityState
-
- All Implemented Interfaces:
Serializable
public class TerminatedActivityState extends ActivityState
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 toNodeStates. 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
ActivityStateTerminatedActivityStateis read-only; when changing the state a newActivityStateneeds to be created. This also avoids the need for synchronising access to this class.- Author:
- Ulrich Kreher
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTerminatedActivityState.TerminatedStateAn 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
Constructors Constructor Description TerminatedActivityState(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.TerminatedActivityState(TerminatedActivityState.TerminatedState state)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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LonggetErrorCode()Gets the arbitrary code indicating the error in case the activity has failed.StringgetErrorMessage()Gets the arbitrary message indicating the error in case the activity has failed.StringgetErrorState()Gets the arbitrary state indicating the error in case the activity has failed.LonggetSuspendTimeout()Gets the timeout in case the activity has suspended and wants to be resumed after the designated time has elapsed.TerminatedActivityState.TerminatedStategetTerminatedState()Gets the state of the activity after its termination.-
Methods inherited from class de.aristaflow.adept2.model.runtimeenvironment.ActivityState
getLastSignal, getState
-
-
-
-
Constructor Detail
-
TerminatedActivityState
public TerminatedActivityState(TerminatedActivityState.TerminatedState state)
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
public TerminatedActivityState(String errorMessage, String errorState, long errorCode)
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 Detail
-
getTerminatedState
public TerminatedActivityState.TerminatedState getTerminatedState()
Gets the state of the activity after its termination.- Returns:
- The state of the activity after its termination.
-
getSuspendTimeout
public Long 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
public String 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
public String 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
public Long 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.
-
-