|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.able.examples.ablebean.SimpleAbleApp
This class provides an application for the SimpleAbleBean. On a timed interval, a value is received and passed to the SimpleAbleBean for processing. It uses the the SimpleAbleAgent to generate these timed events and the data to be processed.
The SimpleAbleAgent generates events on a timer interval. When its timer expires, it updates an instance variable and puts the new value in its outputBuffer. It then sends a datachanged event. This SimpleAbleApp class listens for events sent by the SimpleAbleAgent so that it can trace activity.
When SimpleAbleApp receives any dataChanged event, it prints out the classname of the source of the event and the value of the event argument object. If the event was sent by its instance of the SimpleAbleAgent, it calls process on its SimpleAbleBean object.
SimpleAbleApp also listens for PropertyChangeEvents sent by its SimpleAbleBean object. The property and value of these events are simply written to the console as proof that the SimpleAbleBean's instance variable now matches the value provided from the SimpleAbleAgent.
All processing and events are handled on the thread owned by the SimpleAbleAgent's event queue processor. The thread running main in this class only creates the objects and starts that thread running. It ends the event queue processor thread after a finite interval.
Here is a summary of data flow processing:
Method Summary | |
---|---|
static java.lang.String |
Copyright()
Determine the copyright of this class. |
protected static java.lang.String |
displayBuffer(java.lang.Object obj)
Convert an objects to a string. |
protected static java.lang.String |
displayBuffer(java.lang.Object[] buf)
Convert an array of objects to a string delimited by a blank and a newline. |
void |
handleAbleEvent(AbleEvent e)
Process an Able event. |
static void |
main(java.lang.String[] args)
|
void |
processAbleEvent(AbleEvent e)
Display changes when agent modifies its output buffer. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Handle a property change event. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void main(java.lang.String[] args)
protected static java.lang.String displayBuffer(java.lang.Object[] buf)
protected static java.lang.String displayBuffer(java.lang.Object obj)
public void processAbleEvent(AbleEvent e) throws AbleException
public void handleAbleEvent(AbleEvent e) throws AbleException
handleAbleEvent
in interface AbleEventListener
com.ibm.able.AbleEventListener
theAbleEvent
- The event to handle.AbleException
- If an error occurs.public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
public static java.lang.String Copyright()
|
ABLE 2.0.0 07/02/2003 10:25:01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |