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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy()Close the ScheduledExecutorService.getFile()intvoidinit()Start a Scheduler to check the specified file.refresh()Load the properties file and diff with the stored Properties.voidvoidsetIntervalSeconds(int intervalSeconds) Methods inherited from class com.alibaba.druid.pool.ha.node.NodeListener
getLastUpdateTime, getObserver, getPrefix, getProperties, setLastUpdateTime, setObserver, setPrefix, setProperties, update, updateMethods 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:
initin classNodeListener- See Also:
-
refresh
Load the properties file and diff with the stored Properties.- Specified by:
refreshin classNodeListener- Returns:
- A List of the modification
-
destroy
public void destroy()Close the ScheduledExecutorService.- Specified by:
destroyin classNodeListener
-
getIntervalSeconds
public int getIntervalSeconds() -
setIntervalSeconds
public void setIntervalSeconds(int intervalSeconds) -
getFile
-
setFile
-