Class PoolUpdater

  • All Implemented Interfaces:
    Observer

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

      • isInited

        public boolean isInited()
      • 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)
      • 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)