org.squirrelframework.foundation.fsm
Interface ActionExecutionService<T extends StateMachine<T,S,E,C>,S,E,C>

Type Parameters:
T - type of State Machine
S - type of State
E - type of Event
C - type of Context
All Superinterfaces:
Observable
All Known Implementing Classes:
AbstractExecutionService, ActionExecutionServiceImpl

public interface ActionExecutionService<T extends StateMachine<T,S,E,C>,S,E,C>
extends Observable

State machine action executor. The action defined during state entry/exit and transition will be collected by action executor, and executed later together. The executor can execute actions in synchronize and synchronize manner.

Author:
Henry.He

Nested Class Summary
static interface ActionExecutionService.ActionEvent<T extends StateMachine<T,S,E,C>,S,E,C>
          Action execution event
static interface ActionExecutionService.AfterExecActionEvent<T extends StateMachine<T,S,E,C>,S,E,C>
           
static interface ActionExecutionService.AfterExecActionListener<T extends StateMachine<T,S,E,C>,S,E,C>
          After Action execution listener
static interface ActionExecutionService.BeforeExecActionEvent<T extends StateMachine<T,S,E,C>,S,E,C>
           
static interface ActionExecutionService.BeforeExecActionListener<T extends StateMachine<T,S,E,C>,S,E,C>
          Before Action execution listener
static interface ActionExecutionService.ExecActionExceptionEvent<T extends StateMachine<T,S,E,C>,S,E,C>
           
static interface ActionExecutionService.ExecActionExceptionListener<T extends StateMachine<T,S,E,C>,S,E,C>
           
 
Method Summary
 void addExecActionExceptionListener(ActionExecutionService.ExecActionExceptionListener<T,S,E,C> listener)
          Add action execution exception listener which can be used for monitoring execution
 void addExecActionListener(ActionExecutionService.AfterExecActionListener<T,S,E,C> listener)
          Add after action execution listener which can be used for monitoring execution
 void addExecActionListener(ActionExecutionService.BeforeExecActionListener<T,S,E,C> listener)
          Add before action execution listener which can be used for monitoring execution
 void begin(String bucketName)
          Begin a action execution collection in the bucket.
 void defer(Action<T,S,E,C> action, S from, S to, E event, C context, T stateMachine)
          Add action and all the execution parameters into execution context;
 void execute()
          Execute all the actions collected by front bucket.
 void removeExecActionExceptionListener(ActionExecutionService.ExecActionExceptionListener<T,S,E,C> listener)
          Remove action execution exception listener
 void removeExecActionListener(ActionExecutionService.AfterExecActionListener<T,S,E,C> listener)
          Remove after action execution listener
 void removeExecActionListener(ActionExecutionService.BeforeExecActionListener<T,S,E,C> listener)
          Remove before action execution listener
 void reset()
          Reset all deferred actions and its count
 void setDummyExecution(boolean dummyExecution)
          Set dummy execution true will cause no action being actually invoked when calling execute().
 
Methods inherited from interface org.squirrelframework.foundation.component.Observable
addListener, addListener, fireEvent, getListenerSize, isNotifiable, removeAllListeners, removeListener, removeListener, removeListener, removeListener, setNotifiable
 

Method Detail

begin

void begin(String bucketName)
Begin a action execution collection in the bucket.


execute

void execute()
Execute all the actions collected by front bucket.


reset

void reset()
Reset all deferred actions and its count


setDummyExecution

void setDummyExecution(boolean dummyExecution)
Set dummy execution true will cause no action being actually invoked when calling execute().

Parameters:
dummyExecution -

defer

void defer(Action<T,S,E,C> action,
           S from,
           S to,
           E event,
           C context,
           T stateMachine)
Add action and all the execution parameters into execution context;

Parameters:
action - activity to be executed
from - source state
to - target state
event - activity cause
context - external environment context
stateMachine - state machine reference

addExecActionListener

void addExecActionListener(ActionExecutionService.BeforeExecActionListener<T,S,E,C> listener)
Add before action execution listener which can be used for monitoring execution

Parameters:
listener - action execution listener

removeExecActionListener

void removeExecActionListener(ActionExecutionService.BeforeExecActionListener<T,S,E,C> listener)
Remove before action execution listener

Parameters:
listener - action execution listener

addExecActionListener

void addExecActionListener(ActionExecutionService.AfterExecActionListener<T,S,E,C> listener)
Add after action execution listener which can be used for monitoring execution

Parameters:
listener - action execution listener

removeExecActionListener

void removeExecActionListener(ActionExecutionService.AfterExecActionListener<T,S,E,C> listener)
Remove after action execution listener

Parameters:
listener - action execution listener

addExecActionExceptionListener

void addExecActionExceptionListener(ActionExecutionService.ExecActionExceptionListener<T,S,E,C> listener)
Add action execution exception listener which can be used for monitoring execution

Parameters:
listener - action execution exception listener

removeExecActionExceptionListener

void removeExecActionExceptionListener(ActionExecutionService.ExecActionExceptionListener<T,S,E,C> listener)
Remove action execution exception listener

Parameters:
listener - action execution exception listener


Copyright © 2013-2014. All Rights Reserved.