A Finite State Machine Supporting Concurrent States
Friday, October 30th, 2009A finite state machine (FSM) models a predefined number of application states, which are changed (transitioned) according to actions that occur when triggered by runtime events. The FSM serves as a control point for validating state transitions and initiating callbacks.
A typical application will go through multiple states during a runtime session, e.g., RUNNING → PAUSED → RESTARTED, or (in the case of a data entry form) ENTER → VALIDATE → SAVE. The state transitions are initiated by runtime events, such as when a user presses an PAUSE button or hits the ENTER key after entering data in a field. The FSM determines what actions occur when an event is received, and the resulting state. The transition to a new state will invoke a change in the immediate or subsequent behavior of an application.
The article demonstrates how Java enums and EnumSets can be used as a basis to define and validate application states and state transitions
Jeff Lowery
http://today.java.net/article/2009/09/06/finite-state-machine-supporting-concurrent-states
200910 java programming