| java.lang.Object org.apache.mina.statemachine.transition.AbstractTransition org.apache.mina.statemachine.transition.MethodTransition
MethodTransition | public class MethodTransition extends AbstractTransition (Code) | | Transition which invokes a
Method . The
Method will
only be invoked if its argument types actually matches a subset of the
Event 's argument types. The argument types are matched in order so
you must make sure the order of the method's arguments corresponds to the
order of the event's arguments.
If the first method argument type matches
Event the current
Event will be bound to that argument. In
the same manner the second argument (or first if the method isn't interested
in the current
Event ) can have the
StateContext type and will
in that case be bound to the current
StateContext .
Normally you wouldn't create instances of this class directly but rather use the
Transition 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: The Apache MINA Project (dev@mina.apache.org) version: $Rev: 592122 $, $Date: 2007-11-05 12:10:32 -0700 (Mon, 05 Nov 2007) $ |
Constructor Summary | |
public | MethodTransition(Object eventId, State nextState, Method method, Object target) Creates a new instance with the specified
State as next state
and for the specified
Event id. | public | MethodTransition(Object eventId, Method method, Object target) Creates a new instance which will loopback to the same
State
for the specified
Event id. | public | MethodTransition(Object eventId, State nextState, Object target) Creates a new instance with the specified
State as next state
and for the specified
Event id. | public | MethodTransition(Object eventId, Object target) Creates a new instance which will loopback to the same
State
for the specified
Event id. | public | MethodTransition(Object eventId, String methodName, Object target) Creates a new instance which will loopback to the same
State
for the specified
Event id. | public | MethodTransition(Object eventId, State nextState, String methodName, Object target) Creates a new instance with the specified
State as next state
and for the specified
Event id. |
MethodTransition | public MethodTransition(Object eventId, State nextState, Method method, Object target)(Code) | | Creates a new instance with the specified
State as next state
and for the specified
Event id.
Parameters: eventId - the Event id. Parameters: nextState - the next State. Parameters: method - the target method. Parameters: target - the target object. |
MethodTransition | public MethodTransition(Object eventId, Method method, Object target)(Code) | | Creates a new instance which will loopback to the same
State
for the specified
Event id.
Parameters: eventId - the Event id. Parameters: method - the target method. Parameters: target - the target object. |
MethodTransition | public MethodTransition(Object eventId, State nextState, Object target)(Code) | | Creates a new instance with the specified
State as next state
and for the specified
Event id. The target
Method will
be the method in the specified target object with the same name as the
specified
Event id.
Parameters: eventId - the Event id. Parameters: nextState - the next State. Parameters: target - the target object. throws: NoSuchMethodException - if no method could be found with a name equal to the Event id. throws: AmbiguousMethodException - if more than one method was found with a name equal to the Event id. |
MethodTransition | public MethodTransition(Object eventId, Object target)(Code) | | Creates a new instance which will loopback to the same
State
for the specified
Event id. The target
Method will
be the method in the specified target object with the same name as the
specified
Event id.
Parameters: eventId - the Event id. Parameters: target - the target object. throws: NoSuchMethodException - if no method could be found with a name equal to the Event id. throws: AmbiguousMethodException - if more than one method was found with a name equal to the Event id. |
MethodTransition | public MethodTransition(Object eventId, String methodName, Object target)(Code) | | Creates a new instance which will loopback to the same
State
for the specified
Event id.
Parameters: eventId - the Event id. Parameters: methodName - the name of the target Method. Parameters: target - the target object. throws: NoSuchMethodException - if the method could not be found. throws: AmbiguousMethodException - if there are more than one method with the specified name. |
MethodTransition | public MethodTransition(Object eventId, State nextState, String methodName, Object target)(Code) | | Creates a new instance with the specified
State as next state
and for the specified
Event id.
Parameters: eventId - the Event id. Parameters: nextState - the next State. Parameters: methodName - the name of the target Method. Parameters: target - the target object. throws: NoSuchMethodException - if the method could not be found. throws: AmbiguousMethodException - if there are more than one method with the specified name. |
getTarget | public Object getTarget()(Code) | | Returns the target object.
the target object. |
hashCode | public int hashCode()(Code) | | |
|
|