com.googlecode.jinahya.util.fsm
Class MachineContext

java.lang.Object
  extended by com.googlecode.jinahya.util.fsm.MachineContext

public class MachineContext
extends Object

The machine context which performs tasks for every transition.

Author:
Jin Kwon

Field Summary
protected  TaskContext taskContext
          task context.
 
Constructor Summary
MachineContext(TaskContext taskContext)
          Creates a new instance.
 
Method Summary
protected  void perform(TransitionContext context, Task... tasks)
          Perform tasks.
 void transited(Transition transition)
          Notifies a state transition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

taskContext

protected final TaskContext taskContext
task context.

Constructor Detail

MachineContext

public MachineContext(TaskContext taskContext)
Creates a new instance.

Parameters:
taskContext - tasks
Method Detail

transited

public void transited(Transition transition)
               throws FSMException
Notifies a state transition.

Parameters:
transition - transition transition.
Throws:
FSMException - if an error occurs.

perform

protected void perform(TransitionContext context,
                       Task... tasks)
                throws FSMException
Perform tasks. Each task can be performed concurrently. Overriding classes must guarantee that all tasks performed before this method returns. Default implementation performs tasks one by one.

Parameters:
context - transition context
tasks - tasks to be performed
Throws:
FSMException - if an error occurs


Copyright © 2011. All Rights Reserved.