Package com.alibaba.druid.pool.ha.node
Class FileNodeListener
java.lang.Object
java.util.Observable
com.alibaba.druid.pool.ha.node.NodeListener
com.alibaba.druid.pool.ha.node.FileNodeListener
A NodeList that monitors the change of a file.
- Author:
- DigitalSonic
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Close the ScheduledExecutorService.getFile()
int
void
init()
Start a Scheduler to check the specified file.refresh()
Load the properties file and diff with the stored Properties.void
void
setIntervalSeconds
(int intervalSeconds) Methods inherited from class com.alibaba.druid.pool.ha.node.NodeListener
getLastUpdateTime, getObserver, getPrefix, getProperties, setLastUpdateTime, setObserver, setPrefix, setProperties, update, update
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
FileNodeListener
public FileNodeListener()
-
-
Method Details
-
init
public void init()Start a Scheduler to check the specified file.- Overrides:
init
in classNodeListener
- See Also:
-
refresh
Load the properties file and diff with the stored Properties.- Specified by:
refresh
in classNodeListener
- Returns:
- A List of the modification
-
destroy
public void destroy()Close the ScheduledExecutorService.- Specified by:
destroy
in classNodeListener
-
getIntervalSeconds
public int getIntervalSeconds() -
setIntervalSeconds
public void setIntervalSeconds(int intervalSeconds) -
getFile
-
setFile
-