org.apache.commons.scxml.model
Class Action

java.lang.Object
  extended by org.apache.commons.scxml.model.Action
All Implemented Interfaces:
Serializable, NamespacePrefixesHolder
Direct Known Subclasses:
Assign, Cancel, ElseIf, Event, Exit, If, Log, Send, Var

public abstract class Action
extends Object
implements NamespacePrefixesHolder, Serializable

An abstract base class for executable elements in SCXML, such as <assign>, <log> etc.

See Also:
Serialized Form

Constructor Summary
Action()
          Constructor.
 
Method Summary
abstract  void execute(EventDispatcher evtDispatcher, ErrorReporter errRep, SCInstance scInstance, org.apache.commons.logging.Log appLog, Collection derivedEvents)
          Execute this action instance.
 Map getNamespaces()
          Get the XML namespaces at this action node in the SCXML document.
protected static String getNamespacesKey()
          Return the key under which the current document namespaces are saved in the parent state's context.
 Executable getParent()
          Get the Executable parent.
 State getParentState()
          Deprecated. Use getParentTransitionTarget() instead.
 TransitionTarget getParentTransitionTarget()
          Return the TransitionTarget whose Context this action executes in.
 void setNamespaces(Map namespaces)
          Set the XML namespaces at this action node in the SCXML document.
 void setParent(Executable parent)
          Set the Executable parent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Action

public Action()
Constructor.

Method Detail

getParent

public final Executable getParent()
Get the Executable parent.

Returns:
Returns the parent.

setParent

public final void setParent(Executable parent)
Set the Executable parent.

Parameters:
parent - The parent to set.

getNamespaces

public final Map getNamespaces()
Get the XML namespaces at this action node in the SCXML document.

Specified by:
getNamespaces in interface NamespacePrefixesHolder
Returns:
Returns the map of namespaces.

setNamespaces

public final void setNamespaces(Map namespaces)
Set the XML namespaces at this action node in the SCXML document.

Specified by:
setNamespaces in interface NamespacePrefixesHolder
Parameters:
namespaces - The document namespaces.

getParentState

public final State getParentState()
                           throws ModelException
Deprecated. Use getParentTransitionTarget() instead.

Return the parent state.

Returns:
The parent State
Throws:
ModelException - For an unknown TransitionTarget subclass

getParentTransitionTarget

public final TransitionTarget getParentTransitionTarget()
                                                 throws ModelException
Return the TransitionTarget whose Context this action executes in.

Returns:
The parent TransitionTarget
Throws:
ModelException - For an unknown TransitionTarget subclass
Since:
0.9

execute

public abstract void execute(EventDispatcher evtDispatcher,
                             ErrorReporter errRep,
                             SCInstance scInstance,
                             org.apache.commons.logging.Log appLog,
                             Collection derivedEvents)
                      throws ModelException,
                             SCXMLExpressionException
Execute this action instance.

Parameters:
evtDispatcher - The EventDispatcher for this execution instance
errRep - The ErrorReporter to broadcast any errors during execution.
scInstance - The state machine execution instance information.
appLog - The application Log.
derivedEvents - The collection to which any internal events arising from the execution of this action must be added.
Throws:
ModelException - If the execution causes the model to enter a non-deterministic state.
SCXMLExpressionException - If the execution involves trying to evaluate an expression which is malformed.

getNamespacesKey

protected static String getNamespacesKey()
Return the key under which the current document namespaces are saved in the parent state's context.

Returns:
The namespaces key


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.