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
Interface AbleBean

All Superinterfaces:
  AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable, java.io.Serializable

All Known Subinterfaces:
  AbleAgent, AbleDataSink, AbleDataSource

All Known Implementing Classes:
  AbleAbstractImport, AbleDBExport, AbleDefaultAgent, AbleExport, AbleObject

public interface AbleBean
extends java.io.Serializable, AbleDataBufferManager, AbleEventListener, AbleEventListenerManager, AbleEventQueueManager, AbleEventQueueProcessor, AblePropertyChangeManager, AbleSerializable

The AbleBean interface represents the basic ABLE object, and is a composite of interfaces that defines the methods for passing data between beans with either databuffers or synchronous or asynchronous events. It also has specific methods for its name, comment, logging, tracing, parentage, and methods which result in state changes such as `init()`, `suspendAll()` and `reset()`.

Method Summary
`java.lang.String` | `getComment()` Returns the comment associated with this bean.
`AbleLogger` | `getLogger()` Returns the current message logger.
`java.lang.String` | `getName()` Returns the name of this bean.
`AbleBeanContainer` | `getParent()` Returns the containing parent of this bean.
`java.util.Map` | `getProperties()` Returns a pointer to the entire current collection of properties.
`java.lang.String` | `getProperty(java.lang.String theName)` Gets the property associated with the specified name.
`int` | `getState()` Returns the current state of this bean.
`AbleLogger` | `getTraceLogger()` Returns the current trace logger.
`void` | `init()` Initializes and configures the bean.
`void` | `init(java.lang.Object theArg)` Initializes and configures the bean, using the specified Object.
`boolean` | `isChanged()` Indicates if the bean has been changed since the last serialization operation.
`void` | `process()` Performs the main, synchronous, standard processing function performed by this bean.
`java.lang.Object` | `process(java.lang.Object theArg)` Performs the main, standard processing function performed by this bean, using the argument Object, which usually would be passed via an AbleEvent.
`void` | `quitAll()` Quits all forms of processing for this bean.
`void` | `removeAllConnections()` Removes all Property, Buffer, and Event connections.
`java.lang.String` | `removeProperty(java.lang.String theName)` Removes the property and the specified name from the collection of properties.
`void` | `reset()` Resets this bean.
`void` | `resumeAll()` Resumes all of the bean's suspended asynchronous threads of control.
`void` | `setChanged(boolean theChangedFlag)` Sets the changed flag.
`void` | `setComment(java.lang.String theComment)` Sets (or changes) the comment associated with this bean.
`void` | `setLogger(AbleLogger theLogger)` Sets the logger to be used for message output.
`void` | `setName(java.lang.String theName)` Sets (or changes) the name of this bean.
`void` | `setParent(AbleBeanContainer theAbleBeanContainer)` Sets the containing parent of this bean.
`void` | `setProperties(java.util.Map theProperties)` Sets the entire collection of properties to the specified collection.
`void` | `setProperty(java.lang.String theName, java.lang.String theValue)` Sets the specified property to the specified value.
`void` | `setState(int theState)` Sets the state of this bean.
`void` | `setTraceLogger(AbleLogger theLogger)` Sets the logger to be used for tracing program-level output.
`void` | `suspendAll()` Temporarily suspends all of the bean's asynchronous threads of control.

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, setDataFlowEnabled, setInputBuffer, setInputBuffer, setOutputBuffer, setOutputBuffer`

Methods inherited from interface com.ibm.able.AbleEventListener
`handleAbleEvent`

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, quitEnabledEventProcessing, restartEnabledEventProcessing, resumeEnabledEventProcessing, setAbleEventProcessingEnabled, setSleepTime, setTimerEventProcessingEnabled, startEnabledEventProcessing, suspendEnabledEventProcessing`

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

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`

Method Detail

### setName

    public void setName(java.lang.String theName)

  Sets (or changes) the name of this bean. This value may be used as a key when beans are included in containers or used as listeners, so once a bean is initialized, it is up to the implementation to restrict when this method is used.

  Parameters:
    `theName` - The new name of this bean. This name replaces the current name.

### getName

    public java.lang.String getName()

  Returns the name of this bean.

  Returns:
    The current name of this AbleBean object or the empty string if no name has been set. The value is never expected to be null.

### setComment

    public void setComment(java.lang.String theComment)

  Sets (or changes) the comment associated with this bean.

  Parameters:
    `theComment` - The new comment for this bean. This comment replaces the current comment.

### getComment

    public java.lang.String getComment()

  Returns the comment associated with this bean.

  Returns:
    The current comment associated with this bean or the empty string if no comment has been set. The value is never expected to be null.

### setChanged

    public void setChanged(boolean theChangedFlag)

  Sets the changed flag.

  Parameters:
    `theChangedFlag` - The value indicating whether this bean is to be marked as modified. If `true`, the bean will be marked as modified; otherwise, the bean will be marked as unmodified. Saving or serializing the bean should reset the change flag to unmodified.

### isChanged

    public boolean isChanged()

  Indicates if the bean has been changed since the last serialization operation.

  Returns:
    `true` if the bean has been changed since the last save; `false` otherwise.

### setLogger

    public void setLogger(AbleLogger theLogger)

  Sets the logger to be used for message output.

  If a logger is available and is active, it will be used to log translated messages.

  Parameters:
    `theLogger` - A logger that can be used to record translated messages. The value cannot be null.

### getLogger

    public AbleLogger getLogger()

  Returns the current message logger.

  Specified by:
    `getLogger` in interface `AbleEventQueueProcessor`
  Returns:
    the current message logger.

### setTraceLogger

    public void setTraceLogger(AbleLogger theLogger)

  Sets the logger to be used for tracing program-level output.

  If a logger is available and is active, base ABLE code will use it to log trace messages.

  Parameters:
    `theLogger` - A logger that can be used to trace base ABLE code. The value cannot be null.

### getTraceLogger

    public AbleLogger getTraceLogger()

  Returns the current trace logger.

  Returns:
    The current trace logger.

### setParent

    public void setParent(AbleBeanContainer theAbleBeanContainer)

  Sets the containing parent of this bean. Typically this method is called from the parent container's addBean method. It is not expected to be called from the bean itself.

  Parameters:
    `theAbleBeanContainer` - An ABLE bean container object in which this bean currently resides. Note that a bean may only have one parent at any given time, so this new parent completely replaces the current parent.

### getParent

    public AbleBeanContainer getParent()

  Returns the containing parent of this bean.

  Returns:
    An AbleBeanContainer object in which this bean resides or null if no parent has been set.

### setState

    public void setState(int theState)

  Sets the state of this bean.

  Specified by:
    `setState` in interface `AbleEventQueueProcessor`
  Parameters:
    `theState` - An `AbleState` value.

### getState

    public int getState()

  Returns the current state of this bean.

  Specified by:
    `getState` in interface `AbleEventQueueProcessor`
  Returns:
    An `AbleState` value.

### removeAllConnections

    public void removeAllConnections()
                              throws AbleException

  Removes all Property, Buffer, and Event connections.

  Throws:
    `AbleException` - If an error occurs.

### init

    public void init()
              throws AbleException

  Initializes and configures the bean. The bean's state changes to `AbleState.Initiated` or `AbleState.Waiting`.

  If the implementation provides property change notification, decide whether to send only one property change event or an event for each property.

  A bean implementing `AbleBeanContainer` may choose to call this method on each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.

### init

    public void init(java.lang.Object theArg)
              throws AbleException

  Initializes and configures the bean, using the specified Object. If needed, this method calls `AbleEventQueueManager.startEnabledEventProcessing()` The bean's state changes to `AbleState.Initiated` or `AbleState.Waiting`.

  A bean implementing `AbleBeanContainer` may choose to call this method on each bean it contains and accumulate errors from each contained bean.

  Parameters:
    `theArg` - An Object used to initialize the bean, typically by getting parameters of interest.
  Throws:
    `AbleException` - If an error occurs.

### reset

    public void reset()
               throws AbleException

  Resets this bean. The implementation is highly bean-dependent. Issues for implementors to consider are:
  1. Should reset return the bean to a state as if the bean was just constructed?
  2. Should reset require `init()` to be called next? Should reset itself call `init()`?
  3. Should reset change the bean `AbleState`?
  4. Should a container construct new contained beans or reset each contained bean?
  5. Which of the bean's data members should be reset?
  For example, after a reset:
  - An initialized AbleDataSource would reopen the file or create a new database connection, and on the next call to process read * the first data record. Whether or not initialized, the number of * records read is set to zero.
  - An AbleNeuralClassifier, or an agent which contains beans, would reset each bean.
  - An AbleBackpropagationNetwork, a learning bean, would reset the network weights so training would start anew.

  A bean implementing `AbleBeanContainer` should reset each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.

### process

    public void process()
                 throws AbleException

  Performs the main, synchronous, standard processing function performed by this bean. Typically, this function involves taking data from the input buffer, processing the data, creating an output buffer, and placing the processed data into it. An `AbleEvent.DATACHANGED` event should be propagated to registered listeners.

  bean implementing `AbleBeanContainer` may choose to call process on each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.

### process

    public java.lang.Object process(java.lang.Object theArg)
                             throws AbleException

  Performs the main, standard processing function performed by this bean, using the argument Object, which usually would be passed via an AbleEvent. Typically, this function involves taking data from the argument object, processing the data, and placing the processed data into an AbleEvent.

  A bean implementing `AbleBeanContainer` may choose to call process on each bean it contains and accumulate errors from each contained bean.

  Parameters:
    `theArg` - An Object used to provide data for the bean derive a result.
  Returns:
    The results of the process() computation, usually a clone of the bean's OutputBuffer.
  Throws:
    `AbleException` - If an error occurs.

### quitAll

    public void quitAll()
                 throws AbleException

  Quits all forms of processing for this bean. Stop all of the bean's asynchronous threads of control. The bean's state changes to `AbleState.Unknown`, and it should be considered unusable for further processing.

  A simple AbleBean may just call `AbleEventQueueManager.quitEnabledEventProcessing()`. A more complex bean may also clear itself of references so that garbage collection can occur.

  A bean implementing `AbleBeanContainer` should call quitAll on each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.
  See Also:
    `suspendAll()`, `resumeAll()`

### suspendAll

    public void suspendAll()
                    throws AbleException

  Temporarily suspends all of the bean's asynchronous threads of control. The bean's state changes to `AbleState.Suspended`.

  If the bean is a simple AbleBean, this method just calls its `AbleEventQueueManager.suspendEnabledEventProcessing()` method.

  A bean implementing `AbleBeanContainer` should call this method on each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.
  See Also:
    `resumeAll()`, `quitAll()`

### resumeAll

    public void resumeAll()
                   throws AbleException

  Resumes all of the bean's suspended asynchronous threads of control. The bean's state changes from `AbleState.Suspended` to `AbleState.Waiting`.

  If the bean is a simple AbleBean, this method just calls its `AbleEventQueueManager.resumeEnabledEventProcessing()` method.

  A bean implementing `AbleBeanContainer` should call this method on each bean it contains and accumulate errors from each contained bean.

  Throws:
    `AbleException` - If an error occurs.
  See Also:
    `suspendAll()`, `quitAll()`

### setProperty

    public void setProperty(java.lang.String theName,
                            java.lang.String theValue)

  Sets the specified property to the specified value.

  Parameters:
    `theName` - The name of the property to be placed into the collection of properties.
    `theValue` - The value associated with the specified property.
  Since:
    2.2.0

### getProperty

    public java.lang.String getProperty(java.lang.String theName)

  Gets the property associated with the specified name.

  Parameters:
    `theName` - The name of the property to be returned.
  Returns:
    The value associated with the specified name, or null if no property has been set for the specified name.
  Since:
    2.2.0

### removeProperty

    public java.lang.String removeProperty(java.lang.String theName)

  Removes the property and the specified name from the collection of properties.

  Parameters:
    `theName` - The name of the property to be removed.
  Returns:
    The value associated with the specified name, or null if no property has been set for the specified name.
  Since:
    2.2.0

### setProperties

    public void setProperties(java.util.Map theProperties)

  Sets the entire collection of properties to the specified collection.

  Parameters:
    `theProperties` - The set of properties that will replace the current collection of properties. If this parameter is specified as null, the call is ignored; that is, the underlying data member is not changed. Otherwise, the underlying data member is changed to point to the specified collection.

    Keys and values of the properties collection must be confined to the String data type.

  Since:
    2.2.0

### getProperties

    public java.util.Map getProperties()

  Returns a pointer to the entire current collection of properties.

  Returns:
    The entire current collection of properties.
  Since:
    2.2.0

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