| |
|
| java.lang.Object java.lang.Thread org.jzonic.jlo.FileWatcher
FileWatcher | public class FileWatcher extends Thread (Code) | | A class which implements an event dispatching mechanism to all
classes supporting the FileListener interface. This class will
notify all FileListeners when the configuration changes. Once
the FileWatcher has been shutdown, the class needs to be
reinstanciated and restarted.
author: Andreas Mecky author: Terry R. Dye |
Constructor Summary | |
public | FileWatcher() Creates a new instance of FileWatcher by calling the FileWatcher( File )
Constructor. |
FileWatcher | public FileWatcher()(Code) | | Creates a new instance of FileWatcher by calling the FileWatcher( File )
Constructor.
Parameters: filename - A String representing the path to the file to be watched. |
addFileListener | public void addFileListener(FileListener fileListener, String configurationName)(Code) | | Adds FileListener
Parameters: fileListener - The FileListener |
getFileListeners | public FileListener[] getFileListeners()(Code) | | Retrieve an array of FileListeners.
FileListeners as array of FileListener |
run | public void run()(Code) | | Start the thread to call checkFile()
|
setInterval | public void setInterval(int seconds)(Code) | | Set the timer interval. The default is 10 seconds
Parameters: seconds - The number of seconds to set the interval whento check for the changes to the file. |
start | public void start()(Code) | | Start the Thread on its journey to scan for changes to the
file it is watching.
|
stopWatching | public void stopWatching()(Code) | | Tell thread to stop watching. Currently once a Thread is started
and stopped, a new FileWatcher will be required.
|
|
|
|