org.apache.activemq.apollo.util.StateMachine
Changes to the new state only if it is still the current state.
Executes the code block only if we are still the current state.