use of com.sun.enterprise.config.serverbeans.ResourcePool in project Payara by payara.
the class ConnectionPoolEmitterImpl method registerConnectionPool.
/**
* Register the jdbc/connector connection pool Stats Provider object to the
* monitoring framework under the specific application name monitoring
* sub tree.
*
* @param appName
* @return
*/
private ConnectionPoolAppProbeProvider registerConnectionPool(String appName) {
ResourcePool pool = runtime.getConnectionPoolConfig(poolInfo);
ConnectionPoolAppProbeProvider probeAppProvider = runtime.getProbeProviderUtil().getConnPoolBootstrap().registerPool(poolInfo, appName);
if (pool instanceof ConnectorConnectionPool) {
probeAppProvider = new ConnectorConnPoolAppProbeProvider();
ConnectorConnPoolAppStatsProvider ccPoolAppStatsProvider = new ConnectorConnPoolAppStatsProvider(poolInfo, appName);
StatsProviderManager.register("connector-connection-pool", PluginPoint.SERVER, "resources/" + ConnectorsUtil.escapeResourceNameForMonitoring(poolName) + "/" + appName, ccPoolAppStatsProvider);
ccPoolAppStatsProviders.add(ccPoolAppStatsProvider);
}
return probeAppProvider;
}
use of com.sun.enterprise.config.serverbeans.ResourcePool in project Payara by payara.
the class ManagedConnectionImpl method getJdbcConnectionPool.
private JdbcConnectionPool getJdbcConnectionPool(javax.resource.spi.ManagedConnectionFactory mcf) {
if (Globals.getDefaultHabitat().getService(ProcessEnvironment.class).getProcessType() != ProcessEnvironment.ProcessType.Server) {
// otherwise we bave no domain to draw upon
return null;
}
JdbcConnectionPool jdbcConnectionPool = null;
ManagedConnectionFactoryImpl spiMCF = (ManagedConnectionFactoryImpl) mcf;
Resources resources = Globals.getDefaultHabitat().getService(Domain.class).getResources();
ResourcePool pool = (ResourcePool) ConnectorsUtil.getResourceByName(resources, ResourcePool.class, spiMCF.getPoolName());
if (pool instanceof JdbcConnectionPool) {
jdbcConnectionPool = (JdbcConnectionPool) pool;
}
return jdbcConnectionPool;
}
Aggregations