|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--fipaos.util.Monitor
This class provides a generic mechanism for forwarding objects
from one thread to another in order to decouple parts of a system.
A Queue must be passed to a Monitor upon construction, and it monitors
this for objects to forward. When there is an object in the queue
it is passed to the MonitorListener registered with the Monitor
Inner Class Summary | |
protected static class |
Monitor.MonitorListenerTest
|
Field Summary | |
protected MonitorListener |
_target
The target MonitorListener |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
Monitor(Queue queue,
MonitorListener ml)
Constructor - starts threads running |
|
Monitor(Queue queue,
MonitorListener ml,
int priority)
Constructor - starts threads running |
Method Summary | |
void |
halt()
Invoked when this should exit cleanly |
static void |
main(java.lang.String[] args)
Test harness for Monitor class |
void |
run()
Run method - continuously checks for incomming messages, and passes them on to the MonitorListener implementations associated with this |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected MonitorListener _target
Constructor Detail |
public Monitor(Queue queue, MonitorListener ml)
queue
- The queue that should be used for buffering waiting
objectsml
- The MonitorListener to forward objects topublic Monitor(Queue queue, MonitorListener ml, int priority)
queue
- The queue that should be used for buffering waiting
objectsml
- The MonitorListener to forward objects toMethod Detail |
public void run()
run
in class java.lang.Thread
public void halt()
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |