Class PoolUpdater

java.lang.Object
com.alibaba.druid.pool.ha.node.PoolUpdater
All Implemented Interfaces:
Observer

public class PoolUpdater extends Object implements Observer
Update the DataSource Connection Pool when notified.
Author:
DigitalSonic
  • Field Details

  • Constructor Details

  • Method Details

    • init

      public void init()
      Create a ScheduledExecutorService to remove unused DataSources.
    • destroy

      public void destroy()
    • update

      public void update(Observable o, Object arg)
      Process the given NodeEvent[]. Maybe add / delete some nodes.
      Specified by:
      update in interface Observer
    • removeDataSources

      public void removeDataSources()
      Remove unused DataSources.
    • addNode

      protected void addNode(NodeEvent event)
    • deleteNode

      protected void deleteNode(NodeEvent event)
    • getHighAvailableDataSource

      public HighAvailableDataSource getHighAvailableDataSource()
    • setHighAvailableDataSource

      public void setHighAvailableDataSource(HighAvailableDataSource highAvailableDataSource)
    • getNodesToDel

      public Set<String> getNodesToDel()
    • getIntervalSeconds

      public int getIntervalSeconds()
    • setIntervalSeconds

      public void setIntervalSeconds(int intervalSeconds)
    • isAllowEmptyPool

      public boolean isAllowEmptyPool()
    • setAllowEmptyPool

      public void setAllowEmptyPool(boolean allowEmptyPool)