|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
S - the type of states the activator will transition betweenL - the type of label that decorates transitionsP - the type of parameter accepted during state transitions (should be ?
if parameters are not supported)public interface StateActivator<S,L,P>
Implementations of this interface are supplied to StateEngine
instances for the purpose of performing actions during state transitions.
Only activators are able to prevent a transition or state change from
completing. If a state activator instance is to be shared between many
concurrently operating state engines it must be thread safe, otherwise a
single engine will guarantee single threaded access to its methods.
| Method Summary | |
|---|---|
void |
changeState(S state)
This method is called to indicate that the current state is to be changed directly (ie. |
void |
transitionState(StateTransition<S,L> transition,
P parameter)
This method is called to indicate that the state is being changed via a state transition. |
| Method Detail |
|---|
void changeState(S state)
throws ProntoStateException,
java.lang.RuntimeException
state - the state to which the engine is moving
ProntoStateException - if the state change should not occur
java.lang.RuntimeException - if the change of state failed
void transitionState(StateTransition<S,L> transition,
P parameter)
throws ProntoStateException,
java.lang.RuntimeException
transition - the transition which the engine is to makeparameter - a parameter for the transition, may be null
ProntoStateException - if the transition should not be made
java.lang.RuntimeException - if transition into the new state failed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||