org.apache.taglibs.rdc.scxml
Class SCXMLExecutor

java.lang.Object
  extended by org.apache.taglibs.rdc.scxml.SCXMLExecutor

public class SCXMLExecutor
extends java.lang.Object

The SCXML "engine" that executes SCXML documents. The particular semantics used by this engine for executing the SCXML are encapsulated in SCXMLSemantics.

Author:
Jaroslav Gergic
See Also:
SCXMLSemantics

Constructor Summary
SCXMLExecutor()
           
SCXMLExecutor(Evaluator evaluator, EventDispatcher evtDisp, ErrorReporter errRep)
          Constructor
 
Method Summary
 Status getCurrentStatus()
          Get the current status
 ErrorReporter getErrorReporter()
          Get the environment specific error reporter
 Evaluator getEvaluator()
          Get the expression evaluator
 EventDispatcher getEventdispatcher()
          Get the event dispatcher
 SCXML getStateMachine()
          Get the state machine that is being executed
 boolean isSuperStep()
          Use "super-step", default is true (that is, run-to-completion is default)
 void reset()
          Clear all state and begin from "initialstate" indicated on root SCXML element.
 void setErrorReporter(ErrorReporter errorReporter)
          Set the environment specific error reporter
 void setEvaluator(Evaluator evaluator)
           
 void setEventdispatcher(EventDispatcher eventdispatcher)
          Set the event dispatcher
 void setStateMachine(SCXML statemachine)
          Set the state machine to be executed
 void setSuperStep(boolean superStep)
          Set the super step
 void triggerEvents(TriggerEvent[] evts)
          The worker method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SCXMLExecutor

public SCXMLExecutor()
              throws ModelException
Throws:
ModelException

SCXMLExecutor

public SCXMLExecutor(Evaluator evaluator,
                     EventDispatcher evtDisp,
                     ErrorReporter errRep)
              throws ModelException
Constructor

Parameters:
stateMachine - The stateMachine to execute
evaluator - The expression evaluator
evtDisp - The event dispatcher
errRep - The error reporter
Throws:
ModelException - in case there is a fatal SCXML object model problem.
Method Detail

triggerEvents

public void triggerEvents(TriggerEvent[] evts)
                   throws ModelException
The worker method. Re-evaluates current status whenever any events are triggered.

Parameters:
evts - an array of external events which triggered during the last time quantum
Throws:
ModelException - in case there is a fatal SCXML object model problem.

reset

public void reset()
           throws ModelException
Clear all state and begin from "initialstate" indicated on root SCXML element.

Throws:
ModelException - in case there is a fatal SCXML object model problem.

getCurrentStatus

public Status getCurrentStatus()
Get the current status

Returns:
The current Status

getEvaluator

public Evaluator getEvaluator()
Get the expression evaluator

Returns:
Returns the evaluator.

setEvaluator

public void setEvaluator(Evaluator evaluator)
Parameters:
evaluator - The evaluator to set.

getStateMachine

public SCXML getStateMachine()
Get the state machine that is being executed

Returns:
Returns the stateMachine.

setStateMachine

public void setStateMachine(SCXML statemachine)
                     throws ModelException
Set the state machine to be executed

Parameters:
stateMachine - The stateMachine to set.
Throws:
ModelException - in case there is a fatal SCXML object model problem.

getErrorReporter

public ErrorReporter getErrorReporter()
Get the environment specific error reporter

Returns:
Returns the errorReporter.

setErrorReporter

public void setErrorReporter(ErrorReporter errorReporter)
Set the environment specific error reporter

Parameters:
errorReporter - The errorReporter to set.

getEventdispatcher

public EventDispatcher getEventdispatcher()
Get the event dispatcher

Returns:
Returns the eventdispatcher.

setEventdispatcher

public void setEventdispatcher(EventDispatcher eventdispatcher)
Set the event dispatcher

Parameters:
eventdispatcher - The eventdispatcher to set.

isSuperStep

public boolean isSuperStep()
Use "super-step", default is true (that is, run-to-completion is default)

Returns:
Returns the superStep property.
See Also:
setSuperStep(boolean)

setSuperStep

public void setSuperStep(boolean superStep)
Set the super step

Parameters:
superStep - if true, the internal derived events are also processed (run-to-completion); if false, the internal derived events are stored in the CurrentStatus property and processed within the next triggerEvents() invocation, also the immediate (empty event) transitions are deferred until the next step


Copyright ? 2000-2004 The Apache Software Foundation. All Rights Reserved.