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;
}
Aggregations