ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.examples
Class AbleBeanWrapper

java.lang.Object
  |
  +--com.ibm.able.AbleObject
        |
        +--com.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, propertyConnectionMgr, sourceBufferConnections, state, stateChgSupport, trace
 
Constructor Summary
AbleBeanWrapper()
          Construct an AbleBeanWrapper.
AbleBeanWrapper(java.lang.String aName)
          Construct an AbleBeanWrapper with specified name.
 
Method Summary
static java.lang.String Copyright()
          Determine the copyright of this class.
 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, getInputBufferAsStringArray, getInputBufferContents, getLogger, getName, getOutputBuffer, getOutputBuffer, getOutputBufferAsStringArray, getOutputBufferContents, getParent, 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, 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, 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

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.
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.
Overrides:
init in class AbleObject
Following copied from class: com.ibm.able.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.
Overrides:
reset in class AbleObject
Following copied from class: com.ibm.able.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.
Overrides:
process in class AbleObject
Throws:
AbleException -  

processTimerEvent

public void processTimerEvent()
                       throws AbleException
Perform the bean processing function to do when the timer interval expires.
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.
Overrides:
handleAbleEvent in class AbleObject
Following copied from interface: com.ibm.able.AbleEventListener
Parameters:
theAbleEvent - The event to handle.
Throws:
AbleException - If an error occurs.

processAbleEvent

public void processAbleEvent(AbleEvent theEvent)
                      throws AbleException
Process an AbleEvent sent by another Able bean. The super method handles only synchronous.
Overrides:
processAbleEvent in class AbleObject
Following copied from class: com.ibm.able.AbleObject
Parameters:
theAbleEvent - 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.

getSomeProperty

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

Copyright

public static java.lang.String Copyright()
Determine the copyright of this class.
Returns:
A String containing this class's copyright statement.


ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003