Class ActivityState
- java.lang.Object
-
- de.aristaflow.adept2.model.runtimeenvironment.ActivityState
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
TerminatedActivityState
public class ActivityState extends Object implements Serializable
This class represents the different states of the component of an activity. At first an activity will beREGISTERED. Meanwhile the corresponding component is being instantiated and the runtime environment is prepared for the execution of the component. Afterwards the component itself isINITIALISINGwhich is reflected in the corresponding state. As soon as the initialisation has successfully finished, the component executes and the state changes toRUNNING. When the component has terminated (finished, suspended, aborted, reset) or an exception occurred either during normal execution or even while initialising, the state changes toTERMINATINGwhile the runtime environment is performing the necessary clean-up. At last the state isTERMINATED.
Terminated activities of which the termination signal is still pending within the runtime manager (using a persisting activity termination) will be in the stateTERMINATED_PENDING.Note that an
ActivityStateis 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 classActivityState.StateAn enumeration for the state of the component of an activity.
-
Constructor Summary
Constructors Modifier Constructor Description ActivityState(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetLastSignal()Gets the last signal sent to the component of an activity ornullin case no signal has been sent yet.ActivityState.StategetState()Gets the current (simple) state of the component of an activity.
-
-
-
Constructor Detail
-
ActivityState
public ActivityState(ActivityState.State state)
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
protected ActivityState(ActivityState.State state, int signal)
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 Detail
-
getState
public ActivityState.State getState()
Gets the current (simple) state of the component of an activity.- Returns:
- The current (simple) state of the component of an activity.
-
getLastSignal
public Integer 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.
-
-