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
ActivityState
TerminatedActivityState
is read-only; when changing the state a newActivityState
needs 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 class
TerminatedActivityState.TerminatedState
An 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 aTerminatedActivityState
for a signalled state having the designated suspend timeout.TerminatedActivityState(long suspendTimeout)
Creates a new aTerminatedActivityState
for a suspended state having the designated suspend timeout.TerminatedActivityState(TerminatedActivityState.TerminatedState state)
Creates a new aTerminatedActivityState
for the designated (simple) terminated state.TerminatedActivityState(String errorMessage, String errorState, long errorCode)
Creates a new aTerminatedActivityState
for a failed state having the designated error information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getErrorCode()
Gets the arbitrary code indicating the error in case the activity has failed.String
getErrorMessage()
Gets the arbitrary message indicating the error in case the activity has failed.String
getErrorState()
Gets the arbitrary state indicating the error in case the activity has failed.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.-
Methods inherited from class de.aristaflow.adept2.model.runtimeenvironment.ActivityState
getLastSignal, getState
-
-
-
-
Constructor Detail
-
TerminatedActivityState
public TerminatedActivityState(TerminatedActivityState.TerminatedState state)
Creates a new aTerminatedActivityState
for 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 aTerminatedActivityState
for 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 aTerminatedActivityState
for 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 aTerminatedActivityState
for 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 inSQLException
errorCode
- 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 benull
in 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
null
in 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 benull
in case the activity has not failed but another terminated state.- Returns:
- The arbitrary message indicating the error in case the activity has
failed or
null
in 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 benull
in case the activity has not failed but another terminated state.- Returns:
- The arbitrary state indicating the error in case the activity has
failed or
null
in 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 benull
in case the activity has not failed but another terminated state.- Returns:
- The arbitrary code indicating the error in case the activity has
failed or
null
in case the activity has not failed but another terminated state.
-
-