org.jactr.core.production.action
Class ExecuteAction

java.lang.Object
  extended by org.jactr.core.production.action.DefaultAction
      extended by org.jactr.core.production.action.ExecuteAction
All Implemented Interfaces:
IAction

public class ExecuteAction
extends DefaultAction

The ExecuteAction is a convenience IAction that permits the execution of an arbitrary Runnable class?s run method. When the ExecuteAction is fired, the class is instantiated and the reflection mechanism is used to get the run method and calls it.

Author:
harrison

Field Summary
 java.lang.String _className
          Description of the Field
 
Constructor Summary
ExecuteAction()
          Constructor for the ExecuteAction object
ExecuteAction(java.lang.String className)
          Constructor that takes the fully qualified class name of the Runnable class.
 
Method Summary
 IAction bind(java.util.Map<java.lang.String,java.lang.Object> variableBindings)
          Bind is called during the creation of an instantiation of a produciton.
 double fire(IInstantiation instantiation, double firingTime)
          Description of the Method
 java.lang.String getClassName()
          Gets the className attribute of the ExecuteAction object
 void setClassName(java.lang.String name)
          Sets the className attribute of the ExecuteAction object
 
Methods inherited from class org.jactr.core.production.action.DefaultAction
dispose, resolve
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_className

public java.lang.String _className
Description of the Field

Constructor Detail

ExecuteAction

public ExecuteAction(java.lang.String className)
Constructor that takes the fully qualified class name of the Runnable class. Note: the class must use an empty constructor. Later implementations will support the specification of specific class instances. [Why not already? Everything needs to be serializable to XML. Providing access to arbitrary objects violates this requirement]

Parameters:
className - Description of the Parameter

ExecuteAction

public ExecuteAction()
Constructor for the ExecuteAction object

Method Detail

bind

public IAction bind(java.util.Map<java.lang.String,java.lang.Object> variableBindings)
Description copied from interface: IAction
Bind is called during the creation of an instantiation of a produciton. By the time this gets called, we know that all the conditions are matched and all the variables have been assigned. This method merely creates a copy of this action and applies those bindings. the IAction returned by this method will be the actual one that is fired. Normally, an action should not change the contents of variableBindings

Returns:

getClassName

public java.lang.String getClassName()
Gets the className attribute of the ExecuteAction object

Returns:
The className value

setClassName

public void setClassName(java.lang.String name)
Sets the className attribute of the ExecuteAction object

Parameters:
name - The new className value

fire

public double fire(IInstantiation instantiation,
                   double firingTime)
Description of the Method

Specified by:
fire in interface IAction
Specified by:
fire in class DefaultAction
Parameters:
instantiation - Description of the Parameter
firingTime - when this production was fired
Returns:
Description of the Return Value