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 doOnChange() method.
Author:
Ceki Gülcü
Since:
version 0.9.1

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.
protected String
filename
The name of the file to observe for changes.

Constructor Summary

FileWatchdog(String filename)

Method Summary

protected void
checkAndConfigure()
protected abstract void
doOnChange()
void
run()
void
setDelay(long delay)
Set the delay to observe between each check of the file changes.

Field Details

DEFAULT_DELAY

public static final long DEFAULT_DELAY
The default delay between every file modification check, set to 60 seconds.
Field Value:
60000L

delay

protected long delay

filename

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

Constructor Details

FileWatchdog

protected FileWatchdog(String filename)

Method Details

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.