Public Member Functions | |
AcsDoActivity (String name, AcsSimpleState nextState, AcsSimpleState errorState, AcsLogger logger, ThreadPoolExecutor executor) | |
void | execute () |
abstract void | runActions () throws AcsStateActionException |
void | terminateActions () |
Package Functions | |
void | logActionFailure (String sourceStateName, String targetStateName, String actionName, Throwable thr) |
Represents an Activity in state (do-activity).
Implementation note: uses a single instance of ExecutorService for cheaply reusing a thread in execute() for all do activities.
alma.acs.genfw.runtime.sm.AcsDoActivity.AcsDoActivity | ( | String | name, | |
AcsSimpleState | nextState, | |||
AcsSimpleState | errorState, | |||
AcsLogger | logger, | |||
ThreadPoolExecutor | executor | |||
) |
name | name for the activity | |
nextState | state to which the implicit "completion transition" will go. | |
errorState | error state to which we'll go in case of errors. | |
logger | Logger used by this class. | |
threadFactory | The thread factory used for asynchronous execution of the runActions() method. |
void alma.acs.genfw.runtime.sm.AcsDoActivity.execute | ( | ) |
Runs runActions() in a separate thread and returns immediately. When the actions are completed, a transition to the next state is triggered, as specified in the constructor.
References alma.acs.genfw.runtime.sm.AcsSimpleState.activate(), alma.acs.logging.AcsLogger.log(), and alma.acs.genfw.runtime.sm.AcsDoActivity.runActions().
Referenced by alma.ACS.MasterComponentImpl.statemachine.ShuttingdownPass2State.entry(), alma.ACS.MasterComponentImpl.statemachine.ShuttingdownPass1State.entry(), alma.ACS.MasterComponentImpl.statemachine.ReinitializingState.entry(), alma.ACS.MasterComponentImpl.statemachine.InitializingPass2State.entry(), and alma.ACS.MasterComponentImpl.statemachine.InitializingPass1State.entry().
void alma.acs.genfw.runtime.sm.AcsDoActivity.logActionFailure | ( | String | sourceStateName, | |
String | targetStateName, | |||
String | actionName, | |||
Throwable | thr | |||
) | [package] |
sourceStateName | beginning of transition, or activity state | |
targetStateName | end of transition, or null if the action comes from the do/ method of an activity state. | |
actionName |
References alma.acs.logging.AcsLogger.log().
abstract void alma.acs.genfw.runtime.sm.AcsDoActivity.runActions | ( | ) | throws AcsStateActionException [pure virtual] |
Must call the action methods associated with this activity.
Referenced by alma.acs.genfw.runtime.sm.AcsDoActivity.execute().
void alma.acs.genfw.runtime.sm.AcsDoActivity.terminateActions | ( | ) |
Terminates the actions if they are still running.
Referenced by alma.ACS.MasterComponentImpl.statemachine.ShuttingdownPass2State.exit(), alma.ACS.MasterComponentImpl.statemachine.ShuttingdownPass1State.exit(), alma.ACS.MasterComponentImpl.statemachine.ReinitializingState.exit(), alma.ACS.MasterComponentImpl.statemachine.InitializingPass2State.exit(), and alma.ACS.MasterComponentImpl.statemachine.InitializingPass1State.exit().