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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected final classprotected final classprotected final classprotected final classprotected final classstatic enumRepresents the possible states of an Action.protected final classprotected final classprotected final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TStartArgumentsDirecly changes the value of the Action starting arguments without regarding the synchronization cycle.protected Action.StateDirecly changes the value of the Action state without regarding the synchronization cycle. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the Action current State.Gets the Argument with which the action was started.protected voidhandleRequests(ion.Meta.IReadOnlyQueueSet<ion.Meta.Request> requests) Calls the appropriate handler according to the state of the action.voidprotected voidprotected voidprotected voidvoidpause()Pauses the Action.voidresume()Resumes the Action.voidstart()Starts the Action.voidstart(TStartArguments arguments) Starts the Action with a specific starting arguments.voidstop(boolean success) Stops the Action.Methods inherited from class ion.Meta.Element
destroy, getEventFilters, getEventHandlers, getRequestFilters, getRequestHandlers, getSimulation, getUID, raise, schedule, wasDestroyed
-
Field Details
-
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
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
-
onStart
-
onResume
-
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
Starts the Action with a specific starting arguments.- Parameters:
arguments- the starting arguments
-
getCurrentState
Gets the Action current State.- Returns:
- the current State of the Action.
-
getStartArguments
Gets the Argument with which the action was started.- Returns:
- the starting arguments of the Action
-
onDestroy
public void onDestroy()- Specified by:
onDestroyin classion.Meta.Element
-