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

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:
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.
 int getState()
          Returns the current state of this bean.
 AbleLogger getTraceLogger()
          Returns the current trace logger.
 void init()
          Initialize and configure the bean.
 void init(java.lang.Object theArg)
          Initialize and configure 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()
          Stop all of the bean's asynchronous threads of control.
 void removeAllConnections()
          Removes all Property, Buffer, and Event connections.
 void reset()
          Reset this bean.
 void resumeAll()
          Resume all of the bean's suspended asynchronous threads of control.
 void setChanged(boolean theChangedFlag)
          Set 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)
          Set or change the name of this bean.
 void setParent(AbleBeanContainer theAbleBeanContainer)
          Sets the containing parent of this bean.
 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 suspend all of the bean's asynchronous threads of control.
 
Methods inherited from interface com.ibm.able.AbleDataBufferManager
addDestBufferConnection, addSourceBufferConnection, getDestBufferConnections, getInputBuffer, getInputBuffer, getInputBufferAsStringArray, getInputBufferContents, getOutputBuffer, getOutputBuffer, 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, 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)
Set or change 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)
Set 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
Initialize and configure 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
Initialize and configure 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
Reset this bean. The implementation is highly bean dependant. 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:

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.

A 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
Stop all of the bean's asynchronous threads of control. The bean's state changes to AbleState.Unknown.

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

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.

suspendAll

public void suspendAll()
                throws AbleException
Temporarily suspend 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.

resumeAll

public void resumeAll()
               throws AbleException
Resume 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.

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

(C) Copyright IBM Corporation 1999, 2003