org.apache.mina.statemachine
Class StateMachineFactory

java.lang.Object
  extended by org.apache.mina.statemachine.StateMachineFactory

public class StateMachineFactory
extends Object

Creates StateMachines by reading State, Transition and Transitions (or equivalent) annotations from one or more arbitrary objects.

Version:
$Rev: 592479 $, $Date: 2007-11-06 17:26:11 +0100 (mar, 06 nov 2007) $
Author:
The Apache MINA Project (dev@mina.apache.org)

Constructor Summary
protected StateMachineFactory(Class<? extends Annotation> transitionAnnotation, Class<? extends Annotation> transitionsAnnotation)
           
 
Method Summary
 StateMachine create(Object handler)
          Creates a new StateMachine from the specified handler object and using a start state with id start.
 StateMachine create(Object handler, Object... handlers)
          Creates a new StateMachine from the specified handler objects and using a start state with id start.
 StateMachine create(String start, Object handler)
          Creates a new StateMachine from the specified handler object and using the State with the specified id as start state.
 StateMachine create(String start, Object handler, Object... handlers)
          Creates a new StateMachine from the specified handler objects and using the State with the specified id as start state.
static StateMachineFactory getInstance(Class<? extends Annotation> transitionAnnotation)
          Returns a new StateMachineFactory instance which creates StateMachines by reading the specified Transition equivalent annotation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateMachineFactory

protected StateMachineFactory(Class<? extends Annotation> transitionAnnotation,
                              Class<? extends Annotation> transitionsAnnotation)
Method Detail

getInstance

public static StateMachineFactory getInstance(Class<? extends Annotation> transitionAnnotation)
Returns a new StateMachineFactory instance which creates StateMachines by reading the specified Transition equivalent annotation.

Parameters:
transitionAnnotation - the Transition equivalent annotation.
Returns:
the StateMachineFactory.

create

public StateMachine create(Object handler)
Creates a new StateMachine from the specified handler object and using a start state with id start.

Parameters:
handler - the object containing the annotations describing the state machine.
Returns:
the StateMachine object.

create

public StateMachine create(String start,
                           Object handler)
Creates a new StateMachine from the specified handler object and using the State with the specified id as start state.

Parameters:
start - the id of the start State to use.
handler - the object containing the annotations describing the state machine.
Returns:
the StateMachine object.

create

public StateMachine create(Object handler,
                           Object... handlers)
Creates a new StateMachine from the specified handler objects and using a start state with id start.

Parameters:
handler - the first object containing the annotations describing the state machine.
handlers - zero or more additional objects containing the annotations describing the state machine.
Returns:
the StateMachine object.

create

public StateMachine create(String start,
                           Object handler,
                           Object... handlers)
Creates a new StateMachine from the specified handler objects and using the State with the specified id as start state.

Parameters:
start - the id of the start State to use.
handler - the first object containing the annotations describing the state machine.
handlers - zero or more additional objects containing the annotations describing the state machine.
Returns:
the StateMachine object.


Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.