|
|||||||||
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 | +--fipaos.util.MultiThreadedMonitor
This is an extension of the Monitor object. When an object is placed into the queue it is passed to all of the MonitorListener registered with this MultiThreadedMonitor. WARNING: There is no guarantee that objects will arrive at the MonitorListener's in the order they are placed into the Queue this MultiThreadedMonitor is observing. It is possible that more than one thread will invoke the monitorUpdate() method at a time, so the implementation should be thread-safe.
fipaos.util.Monitor
Inner classes inherited from class fipaos.util.Monitor |
Monitor.MonitorListenerTest |
Fields inherited from class fipaos.util.Monitor |
_target |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
MultiThreadedMonitor(Queue queue,
int threads)
Constructor - starts threads running |
Method Summary | |
void |
addMonitorListener(MonitorListener ml)
Adds a MonitorListener to this Monitor |
void |
halt()
Invoked when this should exit cleanly |
static void |
main(java.lang.String[] args)
Test harness for Monitor class |
void |
monitorUpdate(java.lang.Object o)
Deals with incoming objects by dispatching them to our Monitors |
void |
removeMonitorListener(MonitorListener ml)
Removes a MonitorListener from this Monitor |
Methods inherited from class fipaos.util.Monitor |
run |
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 |
Constructor Detail |
public MultiThreadedMonitor(Queue queue, int threads)
queue
- The queue that should be used for buffering waiting
objectsthreads
- The number of threads to be used (NOTE: These may
push objects to the MonitorListener's registered
concurrenty.Method Detail |
public void monitorUpdate(java.lang.Object o)
monitorUpdate
in interface MonitorListener
public void addMonitorListener(MonitorListener ml)
The
- MonitorListener to addpublic void removeMonitorListener(MonitorListener ml)
The
- MonitorListener to removepublic void halt()
halt
in class Monitor
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |