Class PoolLifeCycleRegistry

  • All Implemented Interfaces:
    PoolLifeCycle

    @Singleton
    public class PoolLifeCycleRegistry
    extends Object
    implements PoolLifeCycle
    Implementation of PoolLifeCycle to listen to events related to a connection pool creation or destroy. The registry allows multiple listeners (ex: pool monitoring or self management) to listen to the pool's lifecyle. Maintains a list of listeners for this pool identified by poolName.
    Author:
    Shalini M
    • Constructor Detail

      • PoolLifeCycleRegistry

        public PoolLifeCycleRegistry()
    • Method Detail

      • registerPoolLifeCycle

        public void registerPoolLifeCycle​(PoolLifeCycle listener)
        Add a listener to the list of pool life cycle listeners maintained by this registry for the poolName.
        Parameters:
        poolName -
        listener -
      • unRegisterPoolLifeCycle

        public void unRegisterPoolLifeCycle​(PoolLifeCycle listener)
        Clear the list of pool lifecycle listeners maintained by the registry. This happens when a pool is destroyed so the information about its listeners need not be stored.
      • poolCreated

        public void poolCreated​(PoolInfo poolInfo)
        Invoke poolCreated for all listeners of this pool.
        Specified by:
        poolCreated in interface PoolLifeCycle
        Parameters:
        poolInfo -
      • poolDestroyed

        public void poolDestroyed​(PoolInfo poolInfo)
        Invoke poolDestroyed for all listeners of this pool.
        Specified by:
        poolDestroyed in interface PoolLifeCycle
        Parameters:
        poolInfo -