org.apache.log4j.helpers

Class FileWatchdog

public abstract class FileWatchdog extends Thread

Check every now and then that a certain file has not changed. If it has, then call the FileWatchdog method.

Since: version 0.9.1

Author: Ceki Gülcü

Field Summary
protected longdelay
The delay to observe between every check.
static longDEFAULT_DELAY
The default delay between every file modification check, set to 60 seconds.
protected Stringfilename
The name of the file to observe for changes.
Constructor Summary
protected FileWatchdog(String filename)
Method Summary
protected voidcheckAndConfigure()
protected abstract voiddoOnChange()
voidrun()
voidsetDelay(long delay)
Set the delay to observe between each check of the file changes.

Field Detail

delay

protected long delay
The delay to observe between every check. By default set DEFAULT_DELAY.

DEFAULT_DELAY

public static final long DEFAULT_DELAY
The default delay between every file modification check, set to 60 seconds.

filename

protected String filename
The name of the file to observe for changes.

Constructor Detail

FileWatchdog

protected FileWatchdog(String filename)

Method Detail

checkAndConfigure

protected void checkAndConfigure()

doOnChange

protected abstract void doOnChange()

run

public void run()

setDelay

public void setDelay(long delay)
Set the delay to observe between each check of the file changes.
Copyright 2000-2005 Apache Software Foundation.