|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Timer
org.glite.slcs.config.FileConfigurationMonitor
public class FileConfigurationMonitor
FileConfigurationMonitor checks if the monitored file have been modified, and
if so sends a FileConfigurationEvent
to all the registered
FileConfigurationListener
.
Field Summary | |
---|---|
static long |
DEFAULT_MONITORING_INTERVAL
Default sleep time between 2 check (300000 millis = 300 sec = 5 min) |
Constructor Summary | |
---|---|
FileConfigurationMonitor(java.io.File file)
Constr. |
|
FileConfigurationMonitor(java.io.File file,
long monitoringInterval)
Const. |
Method Summary | |
---|---|
void |
addFileConfigurationListener(FileConfigurationListener listener)
Adds the listener to the FileConfigurationListener list. |
static FileConfigurationMonitor |
createFileConfigurationMonitor(java.io.File file,
java.lang.String monitoringInterval,
FileConfigurationListener listener)
Creates a FileConfigurationMonitor for the given FileConfiguration. |
protected void |
dispatchFileConfigurationEvent(int eventType)
Disptaches the FileConfigurationEvent type to all FileConfigurationListener registered. |
boolean |
removeFileConfigurationListener(FileConfigurationListener listener)
Removes the listener from the FileConfigurationListener list. |
void |
shutdown()
Stops to monitor the file. |
void |
start()
Starts the FileConfigurationMonitorTask to monitor the file. |
Methods inherited from class java.util.Timer |
---|
cancel, purge, schedule, schedule, schedule, schedule, scheduleAtFixedRate, scheduleAtFixedRate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static long DEFAULT_MONITORING_INTERVAL
Constructor Detail |
---|
public FileConfigurationMonitor(java.io.File file)
file
- The file to monitorpublic FileConfigurationMonitor(java.io.File file, long monitoringInterval)
monitoringInterval
.
file
- The file to monitor.monitoringInterval
- The pause between 2 check in millis.Method Detail |
---|
public static FileConfigurationMonitor createFileConfigurationMonitor(java.io.File file, java.lang.String monitoringInterval, FileConfigurationListener listener)
file
- The file associated with the file to monitor.monitoringInterval
- The time (in seconds) between 2 checks.listener
- The FileConfigurationListener (this).
public void start()
public void shutdown()
public void addFileConfigurationListener(FileConfigurationListener listener)
listener
- The listener to add.FileConfigurationListener
public boolean removeFileConfigurationListener(FileConfigurationListener listener)
listener
- The listener to remove.
true
if the listener was in the list,
false
otherwise.FileConfigurationListener
protected void dispatchFileConfigurationEvent(int eventType)
eventType
- The FileConfigurationEvent type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |