use of org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppStatsProvider 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;
}
use of org.glassfish.jdbc.pool.monitor.JdbcConnPoolAppStatsProvider in project Payara by payara.
the class JdbcPoolMonitoringExtension method unRegisterConnectionPool.
/**
* Unregister the AppStatsProviders registered for this connection pool.
*/
@Override
public void unRegisterConnectionPool() {
Iterator jdbcProviders = jdbcPoolAppStatsProviders.iterator();
while (jdbcProviders.hasNext()) {
JdbcConnPoolAppStatsProvider jdbcPoolAppStatsProvider = (JdbcConnPoolAppStatsProvider) jdbcProviders.next();
StatsProviderManager.unregister(jdbcPoolAppStatsProvider);
}
jdbcPoolAppStatsProviders.clear();
}
Aggregations