org.apache.mina.statemachine.transition
Class MethodSelfTransition

java.lang.Object
  extended by org.apache.mina.statemachine.transition.AbstractSelfTransition
      extended by org.apache.mina.statemachine.transition.MethodSelfTransition
All Implemented Interfaces:
SelfTransition

public class MethodSelfTransition
extends AbstractSelfTransition

SelfTransition which invokes a Method. The Method can have zero or any number of StateContext and State regarding order

Normally you wouldn't create instances of this class directly but rather use the SelfTransition annotation to define the methods which should be used as transitions in your state machine and then let StateMachineFactory create a StateMachine for you.

Author:
Apache MINA Project

Constructor Summary
MethodSelfTransition(Method method, Object target)
           
MethodSelfTransition(String methodName, Object target)
          Creates a new instance
 
Method Summary
 boolean doExecute(StateContext stateContext, State state)
          Executes this SelfTransition.
 Method getMethod()
          Returns the target Method.
 
Methods inherited from class org.apache.mina.statemachine.transition.AbstractSelfTransition
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodSelfTransition

public MethodSelfTransition(Method method,
                            Object target)

MethodSelfTransition

public MethodSelfTransition(String methodName,
                            Object target)
Creates a new instance

Parameters:
method - the target method.
target - the target object.
Method Detail

getMethod

public Method getMethod()
Returns the target Method.

Returns:
the method.

doExecute

public boolean doExecute(StateContext stateContext,
                         State state)
Description copied from class: AbstractSelfTransition
Executes this SelfTransition.

Specified by:
doExecute in class AbstractSelfTransition
Returns:
true if the SelfTransition has been executed successfully


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