|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread net.sf.jour.util.FileWatchdog
Check every now and then that a certain file has not changed. If it has, then call the
doOnChange()
method.
This is build base on org.apache.log4j.helpers.FileWatchdog
Field Summary | |
static long |
DEFAULT_DELAY
The default delay between every file modification check, set to 60 seconds. |
protected long |
delay
The delay to observe between every check. |
(package private) java.io.File |
file
|
(package private) long |
fileLength
|
protected java.lang.String |
filename
The name of the file to observe for changes. |
(package private) boolean |
interrupted
|
(package private) long |
lastModif
|
(package private) java.util.List |
listenerList
|
protected static org.apache.log4j.Logger |
log
|
(package private) boolean |
warnedAlready
|
(package private) static java.util.Hashtable |
watchdogs
|
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
protected |
FileWatchdog(java.lang.String filename)
|
Method Summary | |
void |
addListener(FileChageListener fileChageListener)
|
protected void |
checkAndConfigure(boolean callOnChange)
|
void |
doOnChange()
|
protected boolean |
fileDetected()
|
void |
finish()
|
static FileWatchdog |
getFileWatchdog(java.lang.String filename,
boolean create)
|
void |
run()
|
void |
setDelay(long delay)
Set the delay to observe between each check of the file changes. |
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, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final org.apache.log4j.Logger log
public static final long DEFAULT_DELAY
protected java.lang.String filename
protected long delay
java.io.File file
long lastModif
long fileLength
boolean warnedAlready
boolean interrupted
java.util.List listenerList
static java.util.Hashtable watchdogs
Constructor Detail |
protected FileWatchdog(java.lang.String filename)
Method Detail |
public static FileWatchdog getFileWatchdog(java.lang.String filename, boolean create)
public void setDelay(long delay)
public void addListener(FileChageListener fileChageListener)
public void doOnChange()
protected boolean fileDetected()
protected void checkAndConfigure(boolean callOnChange)
public void finish()
public void run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |