|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--org.jconfig.URLFileWatcher
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 URLFileWatcher has been shutdown, the class needs to be reinstanciated and restarted.
FileWatcher
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
URLFileWatcher(java.lang.String url)
Constructs a FileWatcher watching the specified File |
Method Summary | |
void |
addFileListener(FileListener fileListener)
Adds FileListener |
FileListener[] |
getFileListeners()
Retrieve an array of FileListeners. |
java.net.URL |
getURL()
|
java.lang.String |
getURLString()
|
void |
run()
Start the thread to call checkFile() |
void |
setInterval(int seconds)
Set the timer interval. |
void |
setURL(java.lang.String url)
Sets a new File to be watched. |
void |
setURL(java.net.URL configURL)
|
void |
start()
Start the Thread on its journey to scan for changes to the file it is watching. |
void |
stopWatching()
Tell thread to stop watching. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public URLFileWatcher(java.lang.String url) throws FileWatcherException
file
- The File to be watchedMethod Detail |
public void addFileListener(FileListener fileListener)
fileListener
- The FileListenerpublic void setInterval(int seconds)
seconds
- The number of seconds to set the interval when
to check for the changes to the file.public void stopWatching()
public void start()
start
in class java.lang.Thread
public void run()
run
in class java.lang.Thread
public FileListener[] getFileListeners()
public void setURL(java.lang.String url) throws FileWatcherException
file
- The File to be watchedpublic java.lang.String getURLString()
public java.net.URL getURL()
public void setURL(java.net.URL configURL)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |