Class ConnectionPoolStatsProviderBootstrap
- java.lang.Object
-
- com.sun.enterprise.resource.pool.monitor.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
-
-
Constructor Summary
Constructors Constructor Description ConnectionPoolStatsProviderBootstrap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addToPoolEmitters(PoolInfo poolInfo, ConnectionPoolEmitterImpl emitter)
boolean
getEnabledValue(String strEnabled)
Find if the monitoring is enabled based on the monitoring level :strEnabled
ConnectionPoolProbeProviderUtil
getProbeProviderUtil()
Resources
getResources()
void
poolCreated(PoolInfo poolInfo)
When a pool is created (or initialized) the pool should be registered to the StatsProviderManager.void
poolDestroyed(PoolInfo poolInfo)
When a pool is destroyed, the pool should be unregistered from the StatsProviderManager.void
postConstruct()
void
postUnregisterPool(PoolInfo poolInfo)
PoolLifeCycleListenerRegistry
registerPool(PoolInfo poolInfo, ConnectionPoolProbeProvider poolProvider)
Registers the pool lifecycle listener for this pool by creating a new ConnectionPoolEmitterImpl object for this pool.ConnectionPoolAppProbeProvider
registerPool(PoolInfo poolInfo, String appName)
void
registerProvider()
All Jdbc Connection pools are added to the pool life cycle listener so as to listen to creation/destroy events.void
unRegisterPool()
void
unregisterPoolAppProviders(PoolInfo poolInfo)
-
-
-
Field Detail
-
logger
protected static final Logger logger
-
-
Method Detail
-
addToPoolEmitters
public void addToPoolEmitters(PoolInfo poolInfo, ConnectionPoolEmitterImpl emitter)
-
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 interfaceorg.glassfish.hk2.api.PostConstruct
-
registerPool
public PoolLifeCycleListenerRegistry registerPool(PoolInfo poolInfo, ConnectionPoolProbeProvider poolProvider)
Registers the pool lifecycle listener for this pool by creating a new ConnectionPoolEmitterImpl object for this pool.- Parameters:
poolInfo
-- Returns:
- registry of pool lifecycle listeners
-
registerPool
public ConnectionPoolAppProbeProvider registerPool(PoolInfo poolInfo, String appName)
-
getResources
public Resources getResources()
-
getProbeProviderUtil
public ConnectionPoolProbeProviderUtil getProbeProviderUtil()
-
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 interfacePoolLifeCycle
- 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 interfacePoolLifeCycle
- Parameters:
poolInfo
-
-
-