Search in sources :

Example 1 with ConnectionPoolMonitoringExtension

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);
            }*/
    }
}
Also used : ConnectorConnectionPool(org.glassfish.connectors.config.ConnectorConnectionPool) ResourcePool(com.sun.enterprise.config.serverbeans.ResourcePool) ConnectionPoolMonitoringExtension(com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension)

Example 2 with ConnectionPoolMonitoringExtension

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);
    }
}
Also used : ConnectionPoolMonitoringExtension(com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension)

Example 3 with ConnectionPoolMonitoringExtension

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;
}
Also used : ConnectionPoolMonitoringExtension(com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension)

Aggregations

ConnectionPoolMonitoringExtension (com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension)3 ResourcePool (com.sun.enterprise.config.serverbeans.ResourcePool)1 ConnectorConnectionPool (org.glassfish.connectors.config.ConnectorConnectionPool)1