Search in sources :

Example 6 with CommonDeployment

use of org.jboss.jca.deployers.common.CommonDeployment in project wildfly by wildfly.

the class PooledConnectionFactoryStatisticsService method start.

@Override
public void start(StartContext context) throws StartException {
    ROOT_LOGGER.debugf("start PooledConnectionFactoryStatisticsService");
    synchronized (POOL_STATISTICS) {
        ResourceAdapterDeployment raDeployment = injectedRADeployment.getValue();
        CommonDeployment deployment = raDeployment.getDeployment();
        StatisticsPlugin poolStats = deployment.getConnectionManagers()[0].getPool().getStatistics();
        poolStats.setEnabled(statsEnabled);
        int poolStatsSize = poolStats.getNames().size();
        if (poolStatsSize > 0) {
            if (registration != null) {
                if (poolStatsSize > 0) {
                    if (registration.getSubModel(PathAddress.pathAddress(POOL_STATISTICS)) == null) {
                        // TODO WFLY-5285 get rid of redundant .setRuntimeOnly once WFCORE-959 is integrated
                        ManagementResourceRegistration poolRegistration = registration.registerSubModel(new StatisticsResourceDefinition(POOL_STATISTICS, DataSourcesSubsystemProviders.RESOURCE_NAME, poolStats));
                        poolRegistration.setRuntimeOnly(true);
                    }
                }
            }
        }
    }
}
Also used : ResourceAdapterDeployment(org.jboss.as.connector.metadata.deployment.ResourceAdapterDeployment) CommonDeployment(org.jboss.jca.deployers.common.CommonDeployment) StatisticsResourceDefinition(org.jboss.as.connector.dynamicresource.StatisticsResourceDefinition) StatisticsPlugin(org.jboss.jca.core.spi.statistics.StatisticsPlugin) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration)

Aggregations

StatisticsResourceDefinition (org.jboss.as.connector.dynamicresource.StatisticsResourceDefinition)6 StatisticsPlugin (org.jboss.jca.core.spi.statistics.StatisticsPlugin)6 CommonDeployment (org.jboss.jca.deployers.common.CommonDeployment)6 PathElement (org.jboss.as.controller.PathElement)4 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)3 AdminObject (org.jboss.jca.core.api.management.AdminObject)2 ConnectionFactory (org.jboss.jca.core.api.management.ConnectionFactory)2 ConnectionManager (org.jboss.jca.core.connectionmanager.ConnectionManager)2 Locale (java.util.Locale)1 Map (java.util.Map)1 ClearStatisticsHandler (org.jboss.as.connector.dynamicresource.ClearStatisticsHandler)1 ResourceAdapterDeployment (org.jboss.as.connector.metadata.deployment.ResourceAdapterDeployment)1 PoolMetrics (org.jboss.as.connector.subsystems.common.pool.PoolMetrics)1 IronJacamarResource (org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResource)1 IronJacamarResourceDefinition (org.jboss.as.connector.subsystems.resourceadapters.IronJacamarResourceDefinition)1 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)1 ResourceBuilder (org.jboss.as.controller.ResourceBuilder)1 OverrideDescriptionProvider (org.jboss.as.controller.descriptions.OverrideDescriptionProvider)1 StandardResourceDescriptionResolver (org.jboss.as.controller.descriptions.StandardResourceDescriptionResolver)1 Resource (org.jboss.as.controller.registry.Resource)1