ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able.examples
Class AbleBeanWrapper

java.lang.Object
  extended bycom.ibm.able.AbleObject
      extended bycom.ibm.able.examples.AbleBeanWrapper
All Implemented Interfaces:
AbleBean, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

public class AbleBeanWrapper
extends AbleObject

This class is a wrapper for custom algorithms. Its intended to allow the developer to implement the interfaces needed to incorporate an algorithm in Able with minimal changes to the original class. To use this class, substitute your own package in place of com\ibm\able\examples, and globally change the string BeanWrapper with the name of your algorithm's class in these class and html files. This class should include an instance variable for your custom algorithm, called myBeanWrapper in this template.

See Also:
Serialized Form

Field Summary
static java.lang.String Copyright
          Provide a copyright statement for your package to satisfy intellectual property requirements.
protected static long serialVersionUID
          Required for serializable.
 
Fields inherited from class com.ibm.able.AbleObject
changed, chgSupport, comment, dataFlowEnabled, defaultName, destBufferConnections, eventQueue, fileName, inputBuffer, listeners, logger, name, outputBuffer, parent, properties, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleBeanWrapper()
          Construct an AbleBeanWrapper.
AbleBeanWrapper(java.lang.String aName)
          Construct an AbleBeanWrapper with specified name.
 
Method Summary
 java.lang.String getSomeProperty()
          Get the value for some String property from the BeanWrapper SomeProperty will be visible from an inspector.
 void handleAbleEvent(AbleEvent theEvent)
          Process an AbleEvent sent by another Able bean.
 void init()
          Call any methods in BeanWrapper to initialize the algorithm.
 void process()
          Perform the bean processing function for data buffers.
 void processAbleEvent(AbleEvent theEvent)
          Process an AbleEvent sent by another Able bean.
 void processTimerEvent()
          Perform the bean processing function to do when the timer interval expires.
 void reset()
          The Reset method sets default property values and processing options.
 void setSomeProperty(java.lang.String newValue)
          Set the value for some String property in BeanWrapper, and fire a propertyChange event to notify any propertyChange listeners.
 
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, processBufferConnections, processNoEventProcessingEnabledSituation, quitAll, quitEnabledEventProcessing, removeAbleEventListener, removeAllAbleEventListeners, removeAllBufferConnections, removeAllConnections, removeAllPropertyConnections, removeDestBufferConnection, removeProperty, removePropertyChangeListener, removePropertyConnection, removeSourceBufferConnection, removeStateChangeListener, restartEnabledEventProcessing, restoreFromFile, restoreFromFile, restoreFromSerializedFile, restoreFromStream, resumeAll, resumeEnabledEventProcessing, saveToFile, saveToFile, setAbleEventProcessingEnabled, setChanged, setComment, setDataFlowEnabled, setFileName, setInputBuffer, setInputBuffer, setLogger, setName, setOutputBuffer, setOutputBuffer, setParent, setProperties, setProperty, setSleepTime, setState, setTimerEventProcessingEnabled, setTraceLogger, sourceConnectionsOK, startEnabledEventProcessing, suspendAll, suspendEnabledEventProcessing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

protected static final long serialVersionUID
Required for serializable. When a bean is read from a serialized form, this variable can be used to determine its version id. Change this value when changes are made to this class that make previous versions incompatible. Serialized version identifier in form YYYYMMDDVerRelModxx

See Also:
Constant Field Values

Copyright

public static final java.lang.String Copyright
Provide a copyright statement for your package to satisfy intellectual property requirements. Declare it in this class and reference it from others.

See Also:
Constant Field Values
Constructor Detail

AbleBeanWrapper

public AbleBeanWrapper()
                throws AbleException
Construct an AbleBeanWrapper.


AbleBeanWrapper

public AbleBeanWrapper(java.lang.String aName)
                throws AbleException
Construct an AbleBeanWrapper with specified name. The constructor:
  1. Calls the super constructor.
  2. Constructs the underlying custom algorithm object myBeanWrapper.
  3. Allocates the inputBuffer and outputBuffer arrays, if the size is fixed or can be determined at this time.
  4. Calls the reset method to specify default property values and property options.
  5. Calls the init method if it is desired to have the bean up and running when it is constructed, and all parameters are known at the time of construction.

Parameters:
aName - A String object specifying the object name

See Also:
reset()
Method Detail

init

public void init()
          throws AbleException
Call any methods in BeanWrapper to initialize the algorithm. Send an event to listeners indicating this bean's state has changed.

Specified by:
init in interface AbleBean
Overrides:
init in class AbleObject
Throws:
AbleException - If an error occurs.
See Also:
AbleObject.startEnabledEventProcessing()

reset

public void reset()
           throws AbleException
The Reset method sets default property values and processing options. These include:
  1. Properties of the myBeanWrapper object.
  2. Call any methods unique to myBeanWrapper.
  3. Set or enable Able processing options, including:
    1. Timer processing and interval
    2. Data flow processing
    3. Event queue posting and processing
  4. May wish to fire a global property change event.

Specified by:
reset in interface AbleBean
Overrides:
reset in class AbleObject
Throws:
AbleException - If an error occurs.
See Also:
AbleBean.reset()

process

public void process()
             throws AbleException
Perform the bean processing function for data buffers.

Specified by:
process in interface AbleBean
Overrides:
process in class AbleObject
Throws:
AbleException
See Also:
AbleObject.inputBuffer, AbleObject.outputBuffer, AbleBean.process()

processTimerEvent

public void processTimerEvent()
                       throws AbleException
Perform the bean processing function to do when the timer interval expires.

Specified by:
processTimerEvent in interface AbleEventQueueProcessor
Overrides:
processTimerEvent in class AbleObject
Throws:
AbleException

handleAbleEvent

public void handleAbleEvent(AbleEvent theEvent)
                     throws AbleException
Process an AbleEvent sent by another Able bean. The super method handles both synchronous and asynchronous processing, and calls processAbleEvent if the event is synchronous; if asynchronous, it posts the event to the queue.

Specified by:
handleAbleEvent in interface AbleEventListener
Overrides:
handleAbleEvent in class AbleObject
Throws:
AbleException

processAbleEvent

public void processAbleEvent(AbleEvent theEvent)
                      throws AbleException
Process an AbleEvent sent by another Able bean. The super method handles only synchronous.

Specified by:
processAbleEvent in interface AbleEventQueueProcessor
Overrides:
processAbleEvent in class AbleObject
Parameters:
theEvent - The event to process.
Throws:
AbleException - If an error occurs.
See Also:
AbleObject.setAbleEventProcessingEnabled(int), AbleObject.startEnabledEventProcessing(), AbleObject.handleAbleEvent(AbleEvent)

setSomeProperty

public void setSomeProperty(java.lang.String newValue)
                     throws AbleException
Set the value for some String property in BeanWrapper, and fire a propertyChange event to notify any propertyChange listeners.

Throws:
AbleException

getSomeProperty

public java.lang.String getSomeProperty()
Get the value for some String property from the BeanWrapper SomeProperty will be visible from an inspector.


ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005