Represents a complete state machine. Contains a collection of
State objects connected by
Transition s. Normally you wouldn't create
instances of this class directly but rather use the
org.apache.mina.statemachine.annotation.State annotation to define
your states and then let
StateMachineFactory create a
StateMachine for you.
author: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 588579 $, $Date: 2007-10-26 03:21:01 -0600 (Fri, 26 Oct 2007) $
Constructor Summary
public
StateMachine(State[] states, String startStateId) Creates a new instance using the specified
State s and start
state.
handle(Event event) Processes the specified
Event through this
StateMachine .
Normally you wouldn't call this directly but rather use
StateMachineProxyFactory to create a proxy for an interface of
your choice.
Creates a new instance using the specified
State s and start
state.
Parameters: states - the States. Parameters: startStateId - the id of the start State.
Creates a new instance using the specified
State s and start
state.
Parameters: states - the States. Parameters: startStateId - the id of the start State.
Returns the
State with the specified id.
Parameters: id - the id of the State to return. the State throws: NoSuchStateException - if no matching State could be found.
Processes the specified
Event through this
StateMachine .
Normally you wouldn't call this directly but rather use
StateMachineProxyFactory to create a proxy for an interface of
your choice. Any method calls on the proxy will be translated into
Event objects and then fed to the
StateMachine by the
proxy using this method.
Parameters: event - the Event to be handled.