use of org.jboss.jca.core.spi.statistics.StatisticsPlugin 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);
}
}
}
}
}
}
Aggregations