public class Watcher
extends java.lang.Object
StateMachineEvent
s, i.e.
when the state machine:
Constructor and Description |
---|
Watcher(StateMachine stateMachine)
Builds a 'watcher' for a state machine.
|
Modifier and Type | Method and Description |
---|---|
void |
addSMEventListener(StateMachineEventListener l)
Registers a listener for StateMachineEvents.
|
void |
fireSMInited()
Fires a StateMachineEvent to all registered listeners notifying them the state machine has just been inited.
|
void |
fireSmReset(State previousState)
Fires a StateMachineEvent to all registered listeners notifying them the state machine has been restarted.
|
void |
fireSmResumed()
Fires a StateMachineEvent to all registered listeners notifying them the state machine has been resumed.
|
void |
fireSmSuspended()
Fires a StateMachineEvent to all registered listeners notifying them the state machine has been suspended.
|
void |
fireStateChanged(Transition t,
State previousState,
State currentState)
Fires a StateMachineEvent to all registered listeners notifying them the state machine has passed in another state.
|
void |
fireStateLooped(Transition t,
State state)
Fires a StateMachineEvent to all registered listeners notifying them the state machine has passed a transition but looped in its current state.
|
void |
removeSMEventListener(StateMachineEventListener l)
Removes a listener for SMEvents.
|
public Watcher(StateMachine stateMachine)
stateMachine
- The state machine to watch.public void addSMEventListener(StateMachineEventListener l)
l
- The listener to register.public void removeSMEventListener(StateMachineEventListener l)
l
- The listener to remove.public void fireSmSuspended()
public void fireSmResumed()
public void fireSmReset(State previousState)
previousState
- The active state before this machine being resetpublic void fireStateChanged(Transition t, State previousState, State currentState)
t
- The transition that has just been fired.previousState
- The state before the transition.currentState
- The current state (after the transition).public void fireStateLooped(Transition t, State state)
t
- The transition that has just been fired.state
- The current state.public void fireSMInited()