Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.able.agents
Class AbleScriptAgent

    java.lang.Object
      com.ibm.able.AbleObject
          com.ibm.able.AbleDefaultAgent
              com.ibm.able.agents.AbleScriptAgent

All Implemented Interfaces:
  AbleAgent, AbleBean, AbleBeanContainer, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, AbleUserDefinedFunctionManager, java.util.EventListener, java.beans.PropertyChangeListener, java.io.Serializable

Direct Known Subclasses:
  AbleJavaScriptAgent

public class AbleScriptAgent
extends AbleDefaultAgent

The AbleScriptAgent behavior is defined by (up to) 3 separate AbleRuleSets

1. defines the init() behavior
2. defines the process() behavior
3. defines the processTimer() behavior

The control rule sets can be defined by filename or by reference to the object.

See Also:
  Serialized Form

Field Summary
`static java.lang.String` | `defaultName` Value assigned to name by default.
`protected AbleRuleSet` | `initScript` The initScript object is created from a ruleset named by the initScriptFileName when the agent is initialized.
`protected java.lang.String` | `initScriptFileName` A String used to construct and initialize the bean used to initialize the agent.
`protected AbleRuleSet` | `processScript` The processScript object is created from a ruleset named by the processScriptFileName when the agent is initialized.
`protected java.lang.String` | `processScriptFileName` A String used to construct and initialize the bean used to process the agent.
`protected AbleRuleSet` | `processTimerScript` The processTimerScript object is created from a ruleset named by the processTimerScriptFileName when the agent is initialized.
`protected java.lang.String` | `processTimerScriptFileName` A String used to construct and initialize the bean used to process agent timer events.
`protected static long` | `serialVersionUID` Serialized version identifier in form YYYYMMDDVerRelModxx

Fields inherited from class com.ibm.able.AbleDefaultAgent
`activeDataSource, eventConnections, myBeans, numEpochs, processList, processListOK, userDefinedFunctions`

Fields inherited from class com.ibm.able.AbleObject
`changed, chgSupport, comment, dataFlowEnabled, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace`

Constructor Summary
`AbleScriptAgent()`
`AbleScriptAgent(java.lang.String aName)`

Method Summary
`java.lang.Object` | `getInitScript()` Get the object processed when the agent is initialized.
`java.lang.String` | `getInitScriptFileName()` Get the file name used to construct and initialize the bean called when the agent is initialized.
`java.lang.Object` | `getProcessScript()` Get the object processed when the agent is processed.
`java.lang.String` | `getProcessScriptFileName()` Get the file name used to construct and initialize the bean called when the agent is processed.
`java.lang.Object` | `getProcessTimerScript()` Get the object processed when the agent receives a timer event.
`java.lang.String` | `getProcessTimerScriptFileName()` Get the file name used to construct and initialize the bean called when the agent is is to process a timer event.
`void` | `init()` Initialize the Script agent by constructing and initializing the init, process, and processTimer beans if they are specified.
`void` | `process()` Invoke the processRuleSet so user can completely define the process() behavior of this agent (and contained beans) The AbleScriptAgent inputBuffer is passed to the processRuleSet (if any) The processRuleSet outputBuffer (if any) is passed to the Agent's outputBuffer
`void` | `processTimerEvent()` Invoke the process method on the processTimerScript.
`void` | `reset()` Reset the init, process, and processTimerEvent ruleset beans in the agent if they exist.
`protected void` | `setDefaults()` Set processing options to default values.
`void` | `setInitScriptFileName(java.lang.String fileName)` Set the file name used to construct and initialize the bean called when the agent is initialized.
`void` | `setProcessScriptFileName(java.lang.String fileName)` Set the file name used to construct and initialize the bean called when the agent is processed.
`void` | `setProcessTimerScriptFileName(java.lang.String fileName)` Set the file name used to construct and initialize the bean called when the agent is is to process a timer event.

Methods inherited from class com.ibm.able.AbleDefaultAgent
`addBean, addBeans, addEventConnection, addUserDefinedFunction, buildProcessList, clsNm, containsBean, containsBean, containsUserDefinedFunction, debugTrace, generateUniqueName, getBean, getBeans, getDataSource, getEventConnections, getNumEpochs, getProcessList, getUserDefinedFunction, getUserDefinedFunctions, handleAbleEvent, initAllBeans, invokeUserDefinedFunction, isActiveDataSource, propertyChange, quitAll, quitEnabledEventProcessing, removeAllBeans, removeAllConnections, removeAllEventConnections, removeBean, removeBean, removeBeans, removeEventConnection, removeUserDefinedFunction, resetAllBeans, resumeAll, setActiveDataSource, setDataFlowEnabled, setProcessList, setUserDefinedFunctions, suspendAll`

Methods inherited from class com.ibm.able.AbleObject
`addAbleEventListener, addDestBufferConnection, addPropertyChangeListener, addPropertyConnection, addSourceBufferConnection, addStateChangeListener, dataChanged, firePropertyChange, flushAbleEventQueue, getAbleEventListeners, getAbleEventProcessingEnabled, getAbleEventQueueSize, getComment, getDestBufferConnections, getFileName, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getParent, getProperties, getProperty, getPropertyChangeListeners, getPropertyConnectionManager, getSleepTime, getSourceBufferConnections, getState, getTraceLogger, hasInputBuffer, hasOutputBuffer, init, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isChanged, isConnectable, isDataFlowEnabled, isTimerEventProcessingEnabled, notifyAbleEventListeners, process, processAbleEvent, processBufferConnections, processNoEventProcessingEnabledSituation, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllPropertyConnections, removeDestBufferConnection, removeProperty, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setProperties, setProperty, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendEnabledEventProcessing`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface com.ibm.able.AbleBean
`getComment, getLogger, getName, getParent, getProperties, getProperty, getState, getTraceLogger, init, isChanged, process, removeProperty, setChanged, setComment, setLogger, setName, setParent, setProperties, setProperty, setState, setTraceLogger`

Methods inherited from interface com.ibm.able.AbleDataBufferManager
`addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsString, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, getOutputBufferAsString, getOutputBufferAsStringArray, getOutputBufferContents, getSourceBufferConnections, hasInputBuffer, hasOutputBuffer, isConnectable, isDataFlowEnabled, processBufferConnections, removeAllBufferConnections, removeDestBufferConnection, removeSourceBufferConnection, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer`

Methods inherited from interface com.ibm.able.AbleEventListenerManager
`addAbleEventListener, dataChanged, getAbleEventListeners, notifyAbleEventListeners, removeAbleEventListener`

Methods inherited from interface com.ibm.able.AbleEventQueueManager
`flushAbleEventQueue, getAbleEventProcessingEnabled, getAbleEventQueueSize, getSleepTime, isAbleEventPostingEnabled, isAbleEventProcessingEnabled, isTimerEventProcessingEnabled, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing`

Methods inherited from interface com.ibm.able.AbleEventQueueProcessor
`processAbleEvent, processNoEventProcessingEnabledSituation`

Methods inherited from interface com.ibm.able.AblePropertyChangeManager
`addPropertyChangeListener, addPropertyConnection, getPropertyChangeListeners, getPropertyConnectionManager, removeAllPropertyConnections, removePropertyChangeListener, removePropertyConnection`

Methods inherited from interface com.ibm.able.AbleSerializable
`getFileName, restoreFromFile, restoreFromFile, saveToFile, saveToFile, setFileName`

Methods inherited from interface com.ibm.able.AbleBeanContainer
`getName`

Field Detail

### defaultName

    public static final java.lang.String defaultName

  Value assigned to name by default.

### serialVersionUID

    protected static final long serialVersionUID

  Serialized version identifier in form YYYYMMDDVerRelModxx

  See Also:
    Constant Field Values

### initScript

    protected AbleRuleSet initScript

  The initScript object is created from a ruleset named by the initScriptFileName when the agent is initialized.

### processScript

    protected AbleRuleSet processScript

  The processScript object is created from a ruleset named by the processScriptFileName when the agent is initialized.

### processTimerScript

    protected AbleRuleSet processTimerScript

  The processTimerScript object is created from a ruleset named by the processTimerScriptFileName when the agent is initialized.

### initScriptFileName

    protected java.lang.String initScriptFileName

  A String used to construct and initialize the bean used to initialize the agent.

### processScriptFileName

    protected java.lang.String processScriptFileName

  A String used to construct and initialize the bean used to process the agent.

### processTimerScriptFileName

    protected java.lang.String processTimerScriptFileName

  A String used to construct and initialize the bean used to process agent timer events.

Constructor Detail

### AbleScriptAgent

    public AbleScriptAgent()
                    throws AbleException

### AbleScriptAgent

    public AbleScriptAgent(java.lang.String aName)
                    throws AbleException

Method Detail

### setInitScriptFileName

    public void setInitScriptFileName(java.lang.String fileName)

  Set the file name used to construct and initialize the bean called when the agent is initialized.

### getInitScriptFileName

    public java.lang.String getInitScriptFileName()

  Get the file name used to construct and initialize the bean called when the agent is initialized.

### setProcessScriptFileName

    public void setProcessScriptFileName(java.lang.String fileName)

  Set the file name used to construct and initialize the bean called when the agent is processed.

### getProcessScriptFileName

    public java.lang.String getProcessScriptFileName()

  Get the file name used to construct and initialize the bean called when the agent is processed.

### setProcessTimerScriptFileName

    public void setProcessTimerScriptFileName(java.lang.String fileName)

  Set the file name used to construct and initialize the bean called when the agent is is to process a timer event.

### getProcessTimerScriptFileName

    public java.lang.String getProcessTimerScriptFileName()

  Get the file name used to construct and initialize the bean called when the agent is is to process a timer event.

### getInitScript

    public java.lang.Object getInitScript()

  Get the object processed when the agent is initialized.

### getProcessScript

    public java.lang.Object getProcessScript()

  Get the object processed when the agent is processed.

### getProcessTimerScript

    public java.lang.Object getProcessTimerScript()

  Get the object processed when the agent receives a timer event.

### init

    public void init()
              throws AbleException

  Initialize the Script agent by constructing and initializing the init, process, and processTimer beans if they are specified.
  1. If initScriptFileName is set, create the initScript.
  2. If processScriptFileName is set, create the processScript.
  3. if processTimerScriptFileName is set, create the processTimerScript.
  4. Call the initScript.init() to do dynamical initialization of this agent.
  All specified scripts are initialized. Other beans in the container are not initialized.

  Specified by:
    `init` in interface `AbleBean`
  Overrides:
    `init` in class `AbleDefaultAgent`
  Throws:
    `AbleException`
  See Also:
    `AbleObject.init()`

### reset

    public void reset()
               throws AbleException

  Reset the init, process, and processTimerEvent ruleset beans in the agent if they exist. Restore processing options to default values.

  Specified by:
    `reset` in interface `AbleBean`
  Overrides:
    `reset` in class `AbleDefaultAgent`
  Throws:
    `AbleException` - If an error occurs when resetting a contained bean. All errors are collected and insert into the exception so that one bean's error does not prevent another from being reset.

### setDefaults

    protected void setDefaults()
                        throws AbleException

  Set processing options to default values.

  Throws:
    `AbleException`

### process

    public void process()
                 throws AbleException

  Invoke the processRuleSet so user can completely define the process() behavior of this agent (and contained beans) The AbleScriptAgent inputBuffer is passed to the processRuleSet (if any) The processRuleSet outputBuffer (if any) is passed to the Agent's outputBuffer

  Specified by:
    `process` in interface `AbleBean`
  Overrides:
    `process` in class `AbleDefaultAgent`
  Throws:
    `AbleException` - If an error occurs. Errors from each contained bean are accumulated.

### processTimerEvent

    public void processTimerEvent()
                           throws AbleException

  Invoke the process method on the processTimerScript.

  Specified by:
    `processTimerEvent` in interface `AbleEventQueueProcessor`
  Overrides:
    `processTimerEvent` in class `AbleObject`
  Throws:
    `AbleException` - If an error occurs.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005