Search in sources :

Example 1 with ModelOnlyWriteAttributeHandler

use of org.jboss.as.controller.ModelOnlyWriteAttributeHandler in project wildfly by wildfly.

the class HornetQServerResourceDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
    OperationStepHandler writeHandler = new ModelOnlyWriteAttributeHandler(CommonAttributes.SIMPLE_ROOT_RESOURCE_ATTRIBUTES);
    for (AttributeDefinition ad : CommonAttributes.SIMPLE_ROOT_RESOURCE_ATTRIBUTES) {
        if (ad.getName().equals(CLUSTERED.getName())) {
            resourceRegistration.registerReadWriteAttribute(CLUSTERED, ClusteredAttributeHandlers.READ_HANDLER, ClusteredAttributeHandlers.WRITE_HANDLER);
        } else if (ad.getName().equals(MESSAGE_COUNTER_ENABLED.getName())) {
            MessageCounterEnabledHandler handler = new MessageCounterEnabledHandler();
            resourceRegistration.registerReadWriteAttribute(MESSAGE_COUNTER_ENABLED, handler, handler);
        } else {
            resourceRegistration.registerReadWriteAttribute(ad, null, writeHandler);
        }
    }
    // handle deprecate attributes
    resourceRegistration.registerReadWriteAttribute(CommonAttributes.LIVE_CONNECTOR_REF, null, DeprecatedAttributeWriteHandler.INSTANCE);
}
Also used : ModelOnlyWriteAttributeHandler(org.jboss.as.controller.ModelOnlyWriteAttributeHandler) OperationStepHandler(org.jboss.as.controller.OperationStepHandler) AttributeDefinition(org.jboss.as.controller.AttributeDefinition)

Aggregations

AttributeDefinition (org.jboss.as.controller.AttributeDefinition)1 ModelOnlyWriteAttributeHandler (org.jboss.as.controller.ModelOnlyWriteAttributeHandler)1 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)1