Class StateMachine

java.lang.Object
org.apache.mina.statemachine.StateMachine

public class StateMachine extends Object
Represents a complete state machine. Contains a collection of State objects connected by Transitions. Normally you wouldn't create instances of this class directly but rather use the State annotation to define your states and then let StateMachineFactory create a StateMachine for you.
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • CALL_STACK

      private static final String CALL_STACK
    • startState

      private final State startState
    • states

      private final Map<String,State> states
    • processingThreadLocal

      private final ThreadLocal<Boolean> processingThreadLocal
    • eventQueueThreadLocal

      private final ThreadLocal<LinkedList<Event>> eventQueueThreadLocal
  • Constructor Details

    • StateMachine

      public StateMachine(State[] states, String startStateId)
      Creates a new instance using the specified States and start state.
      Parameters:
      states - the States.
      startStateId - the id of the start State.
    • StateMachine

      public StateMachine(Collection<State> states, String startStateId)
      Creates a new instance using the specified States and start state.
      Parameters:
      states - the States.
      startStateId - the id of the start State.
  • Method Details