|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.abraracourcix.alipes.monitors.AbstractMonitor
org.abraracourcix.alipes.monitors.PollingMonitor
org.abraracourcix.alipes.monitors.file.AbstractFileStateMonitor
Factors out everything we know about FileStateMonitors, leaving subclasses to decide how to manage the files we want to monitor
| Nested Class Summary | |
protected static class |
AbstractFileStateMonitor.FileInfo
Simply a dataholder we can stick in a map containing info about a file |
protected static class |
AbstractFileStateMonitor.FileState
|
| Field Summary | |
static int |
NEVER
Hardcoded value to say that files should never be considered stale |
| Constructor Summary | |
AbstractFileStateMonitor(Listener listener,
long pollingFrequency)
Constructor - pass through to superclass |
|
| Method Summary | |
void |
addFile(java.io.File file)
Adds a file with unknown state to the list of files to be monitored |
void |
addFile(java.io.File file,
AbstractFileStateMonitor.FileState state)
Add a file the list we monitor and set its state to unknown |
void |
addFiles(java.io.File[] files)
Add files to the list we monitor and set their state to unknown |
protected void |
checkTheFiles()
Check the file list and respond acccordingly (non-Javadoc) @TODO deal with exception properly |
protected java.util.Set |
getMonitoredFiles()
Get a collection of the files we're monitoring |
int |
getStaleInterval()
Stale interval in seconds |
void |
setStaleInterval(int staleInterval)
Stale interval in seconds - the time after which the file goes stale use setStaleInterval(FileStateMonitor.NEVER) if the files are never considered stale. |
| Methods inherited from class org.abraracourcix.alipes.monitors.PollingMonitor |
getPollingFrequency, pole, run, setPollingFrequency, start |
| Methods inherited from class org.abraracourcix.alipes.monitors.AbstractMonitor |
signalListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NEVER
| Constructor Detail |
public AbstractFileStateMonitor(Listener listener,
long pollingFrequency)
listener - see superclasspollingFrequency - see superclass| Method Detail |
public final int getStaleInterval()
public final void setStaleInterval(int staleInterval)
staleInterval - The staleIntervalMillis to set.
public final void addFile(java.io.File file,
AbstractFileStateMonitor.FileState state)
file - another filestate - the initial state of the file addedprotected final void checkTheFiles()
public final void addFiles(java.io.File[] files)
files - the files to addpublic final void addFile(java.io.File file)
file - the fileprotected final java.util.Set getMonitoredFiles()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||