|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread uk.org.iscream.cms.util.QueueMonitor
This class monitors a given Queue at regular intervals, reporting back to a Queue with XML - this could be the same Queue being monitored.
Field Summary | |
private Queue |
_destQueue
The Queue we'll output results to. |
private long |
_interval
The interval at which we'll check the sourceQueue status. |
private String |
_name
This is the friendly identifier of the component this class is running in. |
private boolean |
_run
Allows us to stop the main loop cleanly. |
private Queue |
_sourceQueue
The Queue we're monitoring. |
private String |
_srcName
The name to identify the source Queue |
static String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
QueueMonitor(Queue sourceQueue,
Queue destQueue,
long interval,
String name)
Construct a new QueueMonitor. |
Method Summary | |
void |
run()
Loops continuosly polling our source Queue at the given interval, and then logging the results in the destination Queue. |
void |
shutdown()
Shuts down this QueueMonitor |
String |
toString()
Overrides the Object.toString()
method to provide clean logging (every class should have this). |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String REVISION
private String _name
private Queue _sourceQueue
private Queue _destQueue
private long _interval
private String _srcName
private boolean _run
Constructor Detail |
public QueueMonitor(Queue sourceQueue, Queue destQueue, long interval, String name)
sourceQueue
- The Queue to monitordestQueue
- The Queue to monitor tointerval
- The interval, in milliseconds, at which to samplename
- A name to identify the source Queue withMethod Detail |
public void run()
public void shutdown()
public String toString()
Object.toString()
method to provide clean logging (every class should have this).
This uses the uk.org.iscream.cms.server.util.FormatName class
to format the toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |