return _state;
}
public synchronized void attainState(State desired)
{
Transition transition = null;
final Map<State, Transition> stateTransitionMap = _validTransitions.get(_state);
if(stateTransitionMap != null)
{
transition = stateTransitionMap.get(desired);
}
if(transition == null)
{
throw new IllegalStateException("No valid transition from state " + _state + " to state " + desired);
}
_state = desired;
_eventListener.event(transition.getEvent());
}