com.tomgibara.pronto.state
Interface StateListener<S,L>

Type Parameters:
S - the type of state the listener observes
L - the type of labels the listener observes

public interface StateListener<S,L>

State listeners may be attached to state engines to observe the completion of state changes and state transitions. Notifications of transition and state change are guaranteed to arrive sequentially (though not necessarily on the same thread) in the order they occured on the engine. Implementations of this interface that are shared between engines should be safe for concurrent access.

Author:
Tom Gibara

Method Summary
 void stateChanged(S state)
          This methopd is called after the state of an engine has been set directly (ie.
 void stateTransitioned(StateTransition<S,L> transition)
          This method is called after every successful state transition made by the state engine.
 

Method Detail

stateChanged

void stateChanged(S state)
This methopd is called after the state of an engine has been set directly (ie. not via a transition).

Parameters:
state - the new state of the state engine, never null

stateTransitioned

void stateTransitioned(StateTransition<S,L> transition)
This method is called after every successful state transition made by the state engine.

Parameters:
transition - a transition that has been made by an engine


Copyright © 2006-2007 Tom Gibara. All Rights Reserved.