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.examples.ableagent
Class SimpleAbleAgent

    java.lang.Object
      com.ibm.able.AbleObject
          com.ibm.able.AbleDefaultAgent
              com.ibm.able.examples.ableagent.SimpleAbleAgent

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

public class SimpleAbleAgent
extends AbleDefaultAgent

This class is an example of an AbleAgent created by extending AbleDefaultAgent. It uses timer event processing to set a new value in its outputBuffer, and sends a data event indicating its outputBuffer contents have changed.

See Also:
  `AbleDefaultAgent`, Serialized Form

Field Summary
`static java.lang.String[]` | `colors`
`protected static long` | `serialVersionUID` Serialized version identifier in form YYYYMMDDVerRelModxx

Fields inherited from class com.ibm.able.AbleDefaultAgent
`activeDataSource, defaultName, 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
`SimpleAbleAgent()` Construct a simple AbleAgent and initialize it.
`SimpleAbleAgent(java.lang.String aName)` Construct a simple AbleAgent with specified name.

Method Summary
`java.lang.String` | `getSimpleBeanColor()` Get the color attribute
`void` | `init()` Initialize the agent to a known initialized state.
`void` | `process()` Perform the standard processing function performed by this agent.
`void` | `processTimerEvent()` This method gets called from the asych thread (if running) Default behavior is to just call the process() method
`void` | `reset()` Reset the agent to default processing settings.
`void` | `setSimpleBeanColor(java.lang.String newBeanColor)` Set the color attribute Also fire a propertyChange event and a dataChanged AbleEvent

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

### serialVersionUID

    protected static final long serialVersionUID

  Serialized version identifier in form YYYYMMDDVerRelModxx

  See Also:
    Constant Field Values

### colors

    public static final java.lang.String[] colors

Constructor Detail

### SimpleAbleAgent

    public SimpleAbleAgent()
                    throws AbleException

  Construct a simple AbleAgent and initialize it.

### SimpleAbleAgent

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

  Construct a simple AbleAgent with specified name.

Parameters:
  `aName` - A String object specifying the object name

Method Detail

### init

    public void init()
              throws AbleException

  Initialize the agent to a known initialized state. Start processing any events enabled.

  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 agent to default processing settings.

  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.

### process

    public void process()
                 throws AbleException

  Perform the standard processing function performed by this agent. This typically takes data from the inputBuffer, processes it, and places it in the output buffer.

  Specified by:
    `process` in interface `AbleBean`
  Overrides:
    `process` in class `AbleDefaultAgent`
  Throws:
    `AbleException` - either AbleException or process error

### processTimerEvent

    public void processTimerEvent()
                           throws AbleException

  This method gets called from the asych thread (if running) Default behavior is to just call the process() method

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

### setSimpleBeanColor

    public void setSimpleBeanColor(java.lang.String newBeanColor)

  Set the color attribute Also fire a propertyChange event and a dataChanged AbleEvent

### getSimpleBeanColor

    public java.lang.String getSimpleBeanColor()

  Get the color attribute

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