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
org.apache.mina.statemachine#StateMachineFactory create a
StateMachine for you.
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.Object[] |
EMPTY_ARGUMENTS |
private static org.slf4j.Logger |
LOGGER |
private java.lang.reflect.Method |
method |
private java.lang.Object |
target |
| Constructor and Description |
|---|
MethodSelfTransition(java.lang.reflect.Method method,
java.lang.Object target) |
MethodSelfTransition(java.lang.String methodName,
java.lang.Object target)
Creates a new instance
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
doExecute(StateContext stateContext,
State state)
Executes this
SelfTransition. |
java.lang.reflect.Method |
getMethod()
Returns the target
Method. |
private void |
invokeMethod(java.lang.Object[] arguments) |
executeprivate static final org.slf4j.Logger LOGGER
private java.lang.reflect.Method method
private final java.lang.Object target
private static final java.lang.Object[] EMPTY_ARGUMENTS
public MethodSelfTransition(java.lang.reflect.Method method,
java.lang.Object target)
public MethodSelfTransition(java.lang.String methodName,
java.lang.Object target)
methodName - the target method.target - the target object.public java.lang.reflect.Method getMethod()
Method.public boolean doExecute(StateContext stateContext, State state)
AbstractSelfTransitionSelfTransition.doExecute in class AbstractSelfTransitiontrue if the SelfTransition has been executed
successfullyprivate void invokeMethod(java.lang.Object[] arguments)