Search in sources :

Example 11 with ResourcePool

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

Example 12 with ResourcePool

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;
}
Also used : JdbcConnectionPool(org.glassfish.jdbc.config.JdbcConnectionPool) ResourcePool(com.sun.enterprise.config.serverbeans.ResourcePool) Resources(com.sun.enterprise.config.serverbeans.Resources) Domain(com.sun.enterprise.config.serverbeans.Domain)

Aggregations

ResourcePool (com.sun.enterprise.config.serverbeans.ResourcePool)12 Resources (com.sun.enterprise.config.serverbeans.Resources)5 BindableResource (com.sun.enterprise.config.serverbeans.BindableResource)4 ConnectorRuntimeException (com.sun.appserv.connectors.internal.api.ConnectorRuntimeException)3 Resource (com.sun.enterprise.config.serverbeans.Resource)3 Iterator (java.util.Iterator)2 NamingException (javax.naming.NamingException)2 ManagedConnectionFactory (javax.resource.spi.ManagedConnectionFactory)2 AdminObjectResource (org.glassfish.connectors.config.AdminObjectResource)2 ConnectorConnectionPool (org.glassfish.connectors.config.ConnectorConnectionPool)2 ConnectorResource (org.glassfish.connectors.config.ConnectorResource)2 ResourceAdapterConfig (org.glassfish.connectors.config.ResourceAdapterConfig)2 WorkSecurityMap (org.glassfish.connectors.config.WorkSecurityMap)2 JdbcConnectionPool (org.glassfish.jdbc.config.JdbcConnectionPool)2 PoolingException (com.sun.appserv.connectors.internal.api.PoolingException)1 Domain (com.sun.enterprise.config.serverbeans.Domain)1 Module (com.sun.enterprise.config.serverbeans.Module)1 Server (com.sun.enterprise.config.serverbeans.Server)1 ConnectionManagerImpl (com.sun.enterprise.connectors.ConnectionManagerImpl)1 ConnectionPoolMonitoringExtension (com.sun.enterprise.connectors.ConnectionPoolMonitoringExtension)1