Search in sources :

Example 1 with PoolStatisticsRuntimeAttributeReadHandler

use of org.jboss.as.connector.subsystems.common.pool.PoolStatisticsRuntimeAttributeReadHandler in project wildfly by wildfly.

the class StatisticsResourceDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
    super.registerAttributes(resourceRegistration);
    for (AttributeDefinition attribute : getAttributesFromPlugin(plugin)) {
        resourceRegistration.registerMetric(attribute, new PoolMetrics.ParametrizedPoolMetricsHandler(plugin));
    }
    //adding enable/disable for pool stats
    OperationStepHandler readHandler = new PoolStatisticsRuntimeAttributeReadHandler(plugin);
    OperationStepHandler writeHandler = new PoolStatisticsRuntimeAttributeWriteHandler(plugin);
    resourceRegistration.registerReadWriteAttribute(org.jboss.as.connector.subsystems.common.pool.Constants.POOL_STATISTICS_ENABLED, readHandler, writeHandler);
}
Also used : OperationStepHandler(org.jboss.as.controller.OperationStepHandler) PoolStatisticsRuntimeAttributeWriteHandler(org.jboss.as.connector.subsystems.common.pool.PoolStatisticsRuntimeAttributeWriteHandler) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) PoolStatisticsRuntimeAttributeReadHandler(org.jboss.as.connector.subsystems.common.pool.PoolStatisticsRuntimeAttributeReadHandler) PoolMetrics(org.jboss.as.connector.subsystems.common.pool.PoolMetrics)

Aggregations

PoolMetrics (org.jboss.as.connector.subsystems.common.pool.PoolMetrics)1 PoolStatisticsRuntimeAttributeReadHandler (org.jboss.as.connector.subsystems.common.pool.PoolStatisticsRuntimeAttributeReadHandler)1 PoolStatisticsRuntimeAttributeWriteHandler (org.jboss.as.connector.subsystems.common.pool.PoolStatisticsRuntimeAttributeWriteHandler)1 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)1 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)1 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)1