Search in sources :

Example 1 with JdbcConnPoolAppProbeProvider

use of org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppProbeProvider in project Payara by payara.

the class JdbcPoolMonitoringExtension method registerConnectionPool.

/**
 * Register the jdbc connection pool Stats Provider object to the
 * monitoring framework under the specific application name monitoring
 * sub tree.
 *
 * @param appName
 * @return
 */
@Override
public ConnectionPoolAppProbeProvider registerConnectionPool(PoolInfo poolInfo, String appName) {
    ConnectionPoolAppProbeProvider probeAppProvider = null;
    ResourcePool pool = runtime.getConnectionPoolConfig(poolInfo);
    if (pool instanceof JdbcConnectionPool) {
        probeAppProvider = new JdbcConnPoolAppProbeProvider();
        JdbcConnPoolAppStatsProvider jdbcPoolAppStatsProvider = new JdbcConnPoolAppStatsProvider(poolInfo, appName);
        StatsProviderManager.register("jdbc-connection-pool", PluginPoint.SERVER, "resources/" + ConnectorsUtil.escapeResourceNameForMonitoring(poolInfo.getName()) + "/" + appName, jdbcPoolAppStatsProvider);
        jdbcPoolAppStatsProviders.add(jdbcPoolAppStatsProvider);
    }
    return probeAppProvider;
}
Also used : JdbcConnPoolAppStatsProvider(org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppStatsProvider) ConnectionPoolAppProbeProvider(com.sun.enterprise.resource.pool.monitor.ConnectionPoolAppProbeProvider) JdbcConnPoolAppProbeProvider(org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppProbeProvider) JdbcConnectionPool(org.glassfish.jdbc.config.JdbcConnectionPool) ResourcePool(com.sun.enterprise.config.serverbeans.ResourcePool)

Aggregations

ResourcePool (com.sun.enterprise.config.serverbeans.ResourcePool)1 ConnectionPoolAppProbeProvider (com.sun.enterprise.resource.pool.monitor.ConnectionPoolAppProbeProvider)1 JdbcConnectionPool (org.glassfish.jdbc.config.JdbcConnectionPool)1 JdbcConnPoolAppProbeProvider (org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppProbeProvider)1 JdbcConnPoolAppStatsProvider (org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppStatsProvider)1