Package ion.Core

Class Action<TStartArguments>

java.lang.Object
ion.Meta.Element
ion.Core.Action<TStartArguments>
Type Parameters:
TStartArguments -

public class Action<TStartArguments> extends ion.Meta.Element
An Action is an Element that represents an ongoing operation. During this process it can be in three possible states: Running, Idle or Paused.
Author:
GAIPS
  • Field Details

    • startArguments

      protected TStartArguments startArguments
      Direcly changes the value of the Action starting arguments without regarding the synchronization cycle. Only change this value if you know what you are doing!!!
    • state

      protected Action.State state
      Direcly changes the value of the Action state without regarding the synchronization cycle. Only change this value if you know what you are doing!!!
  • Constructor Details

    • Action

      public Action()
  • Method Details

    • handleRequests

      protected void handleRequests(ion.Meta.IReadOnlyQueueSet<ion.Meta.Request> requests) throws Exception
      Calls the appropriate handler according to the state of the action. Has the following policy: Idle State Request Priorities: Start > Other requests Running State Request Priorities: Stop Fail > Stop Sucess > Pause > Step > Other Requests Paused State Request Priorities: Stop Fail > Stop Success > Resume > Other Requests
      Parameters:
      requests - the set of request queues to be processed
      Throws:
      Exception
    • onStep

      protected void onStep(IStepped evt)
    • onStart

      protected void onStart(IStarted evt)
    • onResume

      protected void onResume(IResumed evt)
    • start

      public void start()
      Starts the Action.
    • stop

      public void stop(boolean success)
      Stops the Action.
      Parameters:
      success - Indicates whether the Action stops successfully or not.
    • pause

      public void pause()
      Pauses the Action.
    • resume

      public void resume()
      Resumes the Action.
    • start

      public void start(TStartArguments arguments)
      Starts the Action with a specific starting arguments.
      Parameters:
      arguments - the starting arguments
    • getCurrentState

      public Action.State getCurrentState()
      Gets the Action current State.
      Returns:
      the current State of the Action.
    • getStartArguments

      public TStartArguments getStartArguments()
      Gets the Argument with which the action was started.
      Returns:
      the starting arguments of the Action
    • onDestroy

      public void onDestroy()
      Specified by:
      onDestroy in class ion.Meta.Element