PoolMetrics.ParametrizedPoolMetricsHandler handler = new PoolMetrics.ParametrizedPoolMetricsHandler(raStats);
for (AttributeDefinition attribute : StatisticsResourceDefinition.getAttributesFromPlugin(raStats)){
raRegistration.registerMetric(attribute, handler);
}
//adding enable/disable for pool stats
OperationStepHandler readHandler = new PoolStatisticsRuntimeAttributeReadHandler(raStats);
OperationStepHandler writeHandler = new PoolStatisticsRuntimeAttributeWriteHandler(raStats);
raRegistration.registerReadWriteAttribute(org.jboss.as.connector.subsystems.common.pool.Constants.POOL_STATISTICS_ENABLED, readHandler, writeHandler);
}
if (poolStats.getNames().size() != 0 && raRegistration.getSubModel(PathAddress.pathAddress(peCD)) == null) {