Class ActivityState
java.lang.Object
de.aristaflow.adept2.model.runtimeenvironment.ActivityState
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TerminatedActivityState
This class represents the different states of the component of an activity.
At first an activity will be
Terminated activities of which the termination signal is still pending within the runtime manager (using a persisting activity termination) will be in the state
REGISTERED. Meanwhile the
corresponding component is being instantiated and the runtime environment is
prepared for the execution of the component. Afterwards the component itself
is INITIALISING which is reflected in the corresponding state.
As soon as the initialisation has successfully finished, the component
executes and the state changes to RUNNING. When the component
has terminated (finished, suspended, aborted, reset) or an exception occurred
either during normal execution or even while initialising, the state changes
to TERMINATING while the runtime environment is performing the
necessary clean-up. At last the state is TERMINATED. Terminated activities of which the termination signal is still pending within the runtime manager (using a persisting activity termination) will be in the state
TERMINATED_PENDING.
Note that an ActivityState 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 the component of an activity. -
Constructor Summary
ConstructorsModifierConstructorDescriptionActivityState(int signal) Creates a newActivityStatefor aRUNNINGcomponent having received the designated signal.ActivityState(ActivityState.State state) Creates a newActivityStatefor the designated (simple) state.protectedActivityState(ActivityState.State state, int signal) Creates a newActivityStatehaving the designated state and the designated signal. -
Method Summary
Modifier and TypeMethodDescriptionGets the last signal sent to the component of an activity ornullin case no signal has been sent yet.getState()Gets the current (simple) state of the component of an activity.
-
Constructor Details
-
ActivityState
Creates a newActivityStatefor the designated (simple) state. No signal will be set.- Parameters:
state- The (simple) state for the createdActivityState.
-
ActivityState
public ActivityState(int signal) Creates a newActivityStatefor aRUNNINGcomponent having received the designated signal.- Parameters:
signal- The signal sent to the running component.
-
ActivityState
Creates a newActivityStatehaving the designated state and the designated signal. This is for subclasses only that need more control over the state and the signal.- Parameters:
state- The (simple) state for the createdActivityState.signal- The signal sent to the running component.
-
-
Method Details
-
getState
Gets the current (simple) state of the component of an activity.- Returns:
- The current (simple) state of the component of an activity.
-
getLastSignal
Gets the last signal sent to the component of an activity ornullin case no signal has been sent yet.- Returns:
- The last signal sent to the component of an activity or
nullin case no signal has been sent yet.
-