Package com.alibaba.druid.pool.ha.node
Class PoolUpdater
java.lang.Object
com.alibaba.druid.pool.ha.node.PoolUpdater
- All Implemented Interfaces:
Observer
Update the DataSource Connection Pool when notified.
- Author:
- DigitalSonic
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected void
deleteNode
(NodeEvent event) void
destroy()
int
void
init()
Create a ScheduledExecutorService to remove unused DataSources.boolean
void
Remove unused DataSources.void
setAllowEmptyPool
(boolean allowEmptyPool) void
setHighAvailableDataSource
(HighAvailableDataSource highAvailableDataSource) void
setIntervalSeconds
(int intervalSeconds) void
update
(Observable o, Object arg) Process the given NodeEvent[].
-
Field Details
-
DEFAULT_INTERVAL
public static final int DEFAULT_INTERVAL- See Also:
-
-
Constructor Details
-
PoolUpdater
-
-
Method Details
-
init
public void init()Create a ScheduledExecutorService to remove unused DataSources. -
destroy
public void destroy() -
update
Process the given NodeEvent[]. Maybe add / delete some nodes. -
removeDataSources
public void removeDataSources()Remove unused DataSources. -
addNode
-
deleteNode
-
getHighAvailableDataSource
-
setHighAvailableDataSource
-
getNodesToDel
-
getIntervalSeconds
public int getIntervalSeconds() -
setIntervalSeconds
public void setIntervalSeconds(int intervalSeconds) -
isAllowEmptyPool
public boolean isAllowEmptyPool() -
setAllowEmptyPool
public void setAllowEmptyPool(boolean allowEmptyPool)
-