|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.avalon.excalibur.monitor.impl.AbstractMonitor
org.apache.avalon.excalibur.monitor.impl.ActiveMonitor
public class ActiveMonitor
The ActiveMonitor is used to actively check a set of resources to see if they have changed. It will poll the resources with a frequency as specified or if unspecified with the default (60 seconds).
Field Summary | |
---|---|
private static long |
DEFAULT_FREQUENCY
|
private long |
m_frequency
The frequency to scan resources for changes measured in milliseconds. |
private boolean |
m_keepRunning
Set to false to shutdown the thread. |
private java.lang.Thread |
m_monitorThread
The thread that does the monitoring. |
private int |
m_priority
The priority of the thread that monitors resources. |
Fields inherited from interface org.apache.avalon.excalibur.monitor.Monitor |
---|
ROLE |
Constructor Summary | |
---|---|
ActiveMonitor()
|
Method Summary | |
---|---|
void |
run()
|
void |
setFrequency(long frequency)
Set the frequency with which the monitor checks the resources. |
void |
setPriority(int priority)
Set the priority of the active monitors thread. |
void |
start()
|
void |
stop()
|
Methods inherited from class org.apache.avalon.excalibur.monitor.impl.AbstractMonitor |
---|
addResource, addResources, getResource, getResources, removeResource, removeResource, scanAllResources |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final long DEFAULT_FREQUENCY
private long m_frequency
private int m_priority
Thread.MIN_PRIORITY
.
private final java.lang.Thread m_monitorThread
private volatile boolean m_keepRunning
Constructor Detail |
---|
public ActiveMonitor()
Method Detail |
---|
public void setFrequency(long frequency)
frequency
- the frequency to scan resources for changespublic void setPriority(int priority)
priority
- the priority of the active monitors thread.public void start() throws java.lang.Exception
java.lang.Exception
public void stop() throws java.lang.Exception
java.lang.Exception
public final void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |