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);
}
Aggregations