use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class IIOPRootDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
ReloadRequiredWriteAttributeHandler handler = new ReloadRequiredWriteAttributeHandler(ALL_ATTRIBUTES) {
@Override
protected void recordCapabilitiesAndRequirements(OperationContext context, AttributeDefinition attributeDefinition, ModelNode newValue, ModelNode oldValue) {
if (attributeDefinition != SECURITY) {
return;
}
boolean oldIsLegacy;
boolean newIsLegacy;
try {
// For historic reasons this attribute supports expressions so resolution is required.
oldIsLegacy = SecurityAllowedValues.IDENTITY.toString().equals(IIOPRootDefinition.SECURITY.resolveValue(context, oldValue).asStringOrNull());
newIsLegacy = SecurityAllowedValues.IDENTITY.toString().equals(IIOPRootDefinition.SECURITY.resolveValue(context, newValue).asStringOrNull());
} catch (OperationFailedException e) {
throw new RuntimeException(e);
}
if (oldIsLegacy && !newIsLegacy) {
// Capability was registered but no longer required.
context.deregisterCapabilityRequirement(LEGACY_SECURITY, Capabilities.IIOP_CAPABILITY, Constants.ORB_INIT_SECURITY);
} else if (!oldIsLegacy && newIsLegacy) {
// Capability wasn't required but now is.
context.registerAdditionalCapabilityRequirement(LEGACY_SECURITY, LEGACY_SECURITY, LEGACY_SECURITY);
}
// Other permutations mean no change in requirement.
}
};
for (AttributeDefinition attr : ALL_ATTRIBUTES) {
resourceRegistration.registerReadWriteAttribute(attr, null, handler);
}
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class ExternalJMSQueueDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration registry) {
if (registerRuntimeOnly) {
registry.registerReadOnlyAttribute(CommonAttributes.DESTINATION_ENTRIES, null);
// Should this be read only as entries ?
registry.registerReadOnlyAttribute(External.ENABLE_AMQ1_PREFIX, null);
} else {
registry.registerReadWriteAttribute(CommonAttributes.DESTINATION_ENTRIES, null, new ReloadRequiredWriteAttributeHandler(CommonAttributes.DESTINATION_ENTRIES));
registry.registerReadWriteAttribute(External.ENABLE_AMQ1_PREFIX, null, new ReloadRequiredWriteAttributeHandler(External.ENABLE_AMQ1_PREFIX));
}
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class RTSSubsystemDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadWriteAttribute(SERVER, null, new ReloadRequiredWriteAttributeHandler(SERVER));
resourceRegistration.registerReadWriteAttribute(HOST, null, new ReloadRequiredWriteAttributeHandler(HOST));
resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(SOCKET_BINDING));
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project wildfly by wildfly.
the class CMResourceResourceDefinition method registerAttributes.
/**
* {@inheritDoc}
*/
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
ReloadRequiredWriteAttributeHandler reloadWrtiteHandler = new ReloadRequiredWriteAttributeHandler(JNDI_NAME, CM_TABLE_NAME, CM_TABLE_BATCH_SIZE, CM_TABLE_IMMEDIATE_CLEANUP);
resourceRegistration.registerReadWriteAttribute(CM_TABLE_NAME, null, reloadWrtiteHandler);
resourceRegistration.registerReadWriteAttribute(CM_TABLE_BATCH_SIZE, null, reloadWrtiteHandler);
resourceRegistration.registerReadWriteAttribute(CM_TABLE_IMMEDIATE_CLEANUP, null, reloadWrtiteHandler);
// This comes from the address
resourceRegistration.registerReadOnlyAttribute(JNDI_NAME, ReadResourceNameOperationStepHandler.INSTANCE);
}
use of org.jboss.as.controller.ReloadRequiredWriteAttributeHandler in project narayana by jbosstm.
the class BlacktieSubsystemDefinition method registerAttributes.
@Override
public void registerAttributes(ManagementResourceRegistration resourceRegistration) {
resourceRegistration.registerReadWriteAttribute(CONNECTION_FACTORYNAME, null, new ReloadRequiredWriteAttributeHandler(CONNECTION_FACTORYNAME));
resourceRegistration.registerReadWriteAttribute(SOCKET_BINDING, null, new ReloadRequiredWriteAttributeHandler(SOCKET_BINDING));
resourceRegistration.registerReadWriteAttribute(MQ_SERVER, null, new ReloadRequiredWriteAttributeHandler(MQ_SERVER));
}
Aggregations