Class 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 be 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:
    Serialized Form
    • Constructor Detail

      • ActivityState

        public ActivityState​(ActivityState.State state)
        Creates a new ActivityState for the designated (simple) state. No signal will be set.
        Parameters:
        state - The (simple) state for the created ActivityState.
      • ActivityState

        public ActivityState​(int signal)
        Creates a new ActivityState for a RUNNING component having received the designated signal.
        Parameters:
        signal - The signal sent to the running component.
      • ActivityState

        protected ActivityState​(ActivityState.State state,
                                int signal)
        Creates a new ActivityState having 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 created ActivityState.
        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 or null in case no signal has been sent yet.
        Returns:
        The last signal sent to the component of an activity or null in case no signal has been sent yet.