org.apache.commons.scxml.model
Class Action

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

public abstract class Action
extends java.lang.Object
implements NamespacePrefixesHolder, java.io.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, java.util.Collection derivedEvents)
          Execute this action instance.
 java.util.Map getNamespaces()
          Get the XML namespaces at this action node in the SCXML document.
protected static java.lang.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()
          Return the parent state.
 void setNamespaces(java.util.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 java.util.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(java.util.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
Return the parent state.

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

execute

public abstract void execute(EventDispatcher evtDispatcher,
                             ErrorReporter errRep,
                             SCInstance scInstance,
                             org.apache.commons.logging.Log appLog,
                             java.util.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 java.lang.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.