Class ConnectionPoolStatsProviderBootstrap

  • All Implemented Interfaces:
    PoolLifeCycle, org.glassfish.hk2.api.PostConstruct

    @Service
    @Singleton
    public class ConnectionPoolStatsProviderBootstrap
    extends Object
    implements org.glassfish.hk2.api.PostConstruct, PoolLifeCycle
    Bootstrap operations of stats provider objects are done by this class. Registering of provider to the StatsProviderManager, adding pools to the PoolLifeCycle listeners are done during the bootstrap. Depending on the lifecycle of the pool - creation/destroy, the listeners are added or removed and providers registered/unregistered. This is an implementation of PoolLifeCycle. All pool creation or destroy events are got and based on the type, provider is registered for a pool if pool is created or provider is unregistered if pool is destroyed. Monitoring levels when changed from HIGH-> OFF or OFF->HIGH are taken care and appropriate monitoring levels are set.
    Author:
    Shalini M
    • Field Detail

      • logger

        protected static final Logger logger
    • Constructor Detail

      • ConnectionPoolStatsProviderBootstrap

        public ConnectionPoolStatsProviderBootstrap()
    • Method Detail

      • registerProvider

        public void registerProvider()
        All Jdbc Connection pools are added to the pool life cycle listener so as to listen to creation/destroy events. If the JdbcPoolTree is not built, by registering to the StatsProviderManager, its is done here.
      • postConstruct

        public void postConstruct()
        Specified by:
        postConstruct in interface org.glassfish.hk2.api.PostConstruct
      • getResources

        public Resources getResources()
      • unRegisterPool

        public void unRegisterPool()
      • postUnregisterPool

        public void postUnregisterPool​(PoolInfo poolInfo)
      • unregisterPoolAppProviders

        public void unregisterPoolAppProviders​(PoolInfo poolInfo)
      • getEnabledValue

        public boolean getEnabledValue​(String strEnabled)
        Find if the monitoring is enabled based on the monitoring level : strEnabled
        Parameters:
        strEnabled -
        Returns:
      • poolCreated

        public void poolCreated​(PoolInfo poolInfo)
        When a pool is created (or initialized) the pool should be registered to the StatsProviderManager. Also, the pool lifecycle listener needs to be registered for this pool to track events on change of any monitoring attributes.
        Specified by:
        poolCreated in interface PoolLifeCycle
        Parameters:
        poolInfo -
      • poolDestroyed

        public void poolDestroyed​(PoolInfo poolInfo)
        When a pool is destroyed, the pool should be unregistered from the StatsProviderManager. Also, the pool's lifecycle listener should be unregistered.
        Specified by:
        poolDestroyed in interface PoolLifeCycle
        Parameters:
        poolInfo -