use of com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension in project Payara by payara.
the class ConnectionPoolStatsProviderBootstrap method poolCreated.
/**
* 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.
* @param poolInfo
*/
public void poolCreated(PoolInfo poolInfo) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Pool created : " + poolInfo);
}
if (runtime.isServer()) {
ResourcePool pool = runtime.getConnectionPoolConfig(poolInfo);
Collection<ConnectionPoolMonitoringExtension> extensions = habitat.getAllServices(ConnectionPoolMonitoringExtension.class);
for (ConnectionPoolMonitoringExtension extension : extensions) {
extension.registerPool(poolInfo);
}
if (pool instanceof ConnectorConnectionPool) {
registerCcPool(poolInfo);
}
/*else if (poolInfo.getName().contains(ConnectorConstants.DATASOURCE_DEFINITION_JNDINAME_PREFIX)){
registerJdbcPool(poolInfo);
}*/
}
}
use of com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension in project Payara by payara.
the class ConnectionPoolStatsProviderBootstrap method poolDestroyed.
/**
* When a pool is destroyed, the pool should be unregistered from the
* StatsProviderManager. Also, the pool's lifecycle listener
* should be unregistered.
* @param poolInfo
*/
public void poolDestroyed(PoolInfo poolInfo) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Pool Destroyed : " + poolInfo);
}
if (runtime.isServer()) {
Collection<ConnectionPoolMonitoringExtension> extensions = habitat.getAllServices(ConnectionPoolMonitoringExtension.class);
for (ConnectionPoolMonitoringExtension extension : extensions) {
extension.unregisterPool(poolInfo);
}
unregisterPool(poolInfo);
}
}
use of com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension in project Payara by payara.
the class ConnectionPoolStatsProviderBootstrap method registerPool.
public ConnectionPoolAppProbeProvider registerPool(PoolInfo poolInfo, String appName) {
ConnectionPoolAppProbeProvider probeAppProvider = null;
Collection<ConnectionPoolMonitoringExtension> extensions = habitat.getAllServices(ConnectionPoolMonitoringExtension.class);
for (ConnectionPoolMonitoringExtension extension : extensions) {
probeAppProvider = extension.registerConnectionPool(poolInfo, appName);
}
return probeAppProvider;
}
Aggregations