Search in sources :

Example 1 with ReloadRequiredWriteAttributeHandler

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

the class AbstractFederationResourceDefinition method createAttributeWriterHandler.

@Override
protected OperationStepHandler createAttributeWriterHandler() {
    List<SimpleAttributeDefinition> attributes = getAttributes();
    final List<AttributeDefinition> alternativeAttributes = getAlternativesAttributes();
    return new ReloadRequiredWriteAttributeHandler(attributes.toArray(new AttributeDefinition[attributes.size()])) {

        @Override
        public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
            if (!alternativeAttributes.isEmpty()) {
                context.addStep(new AlternativeAttributeValidationStepHandler(alternativeAttributes.toArray(new AttributeDefinition[alternativeAttributes.size()])), OperationContext.Stage.MODEL);
            }
            doRegisterModelWriteAttributeHandler(context, operation);
            super.execute(context, operation);
        }
    };
}
Also used : OperationContext(org.jboss.as.controller.OperationContext) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) ModelNode(org.jboss.dmr.ModelNode) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler) AlternativeAttributeValidationStepHandler(org.wildfly.extension.picketlink.common.model.validator.AlternativeAttributeValidationStepHandler)

Example 2 with ReloadRequiredWriteAttributeHandler

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

the class JdbcJobRepositoryDefinition method registerAttributes.

@Override
public void registerAttributes(final ManagementResourceRegistration resourceRegistration) {
    super.registerAttributes(resourceRegistration);
    resourceRegistration.registerReadWriteAttribute(DATA_SOURCE, null, new ReloadRequiredWriteAttributeHandler(DATA_SOURCE));
}
Also used : ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 3 with ReloadRequiredWriteAttributeHandler

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

the class ClusterConnectionDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registry) {
    ReloadRequiredWriteAttributeHandler reloadRequiredWriteAttributeHandler = new ReloadRequiredWriteAttributeHandler(ATTRIBUTES);
    for (AttributeDefinition attr : ATTRIBUTES) {
        if (!attr.getFlags().contains(AttributeAccess.Flag.STORAGE_RUNTIME)) {
            registry.registerReadWriteAttribute(attr, null, reloadRequiredWriteAttributeHandler);
        }
    }
    ClusterConnectionControlHandler.INSTANCE.registerAttributes(registry);
    for (AttributeDefinition attr : READONLY_ATTRIBUTES) {
        registry.registerReadOnlyAttribute(attr, ClusterConnectionControlHandler.INSTANCE);
    }
}
Also used : StringListAttributeDefinition(org.jboss.as.controller.StringListAttributeDefinition) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) PrimitiveListAttributeDefinition(org.jboss.as.controller.PrimitiveListAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 4 with ReloadRequiredWriteAttributeHandler

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

the class PathDefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registry) {
    AttributeDefinition[] attributes = getAttributes(path.getValue());
    OperationStepHandler attributeHandler = new ReloadRequiredWriteAttributeHandler(attributes);
    for (AttributeDefinition attribute : attributes) {
        registry.registerReadWriteAttribute(attribute, null, attributeHandler);
    }
}
Also used : OperationStepHandler(org.jboss.as.controller.OperationStepHandler) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) SimpleAttributeDefinition(org.jboss.as.controller.SimpleAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 5 with ReloadRequiredWriteAttributeHandler

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

the class JPADefinition method registerAttributes.

@Override
public void registerAttributes(ManagementResourceRegistration registration) {
    registration.registerReadWriteAttribute(DEFAULT_DATASOURCE, null, new ReloadRequiredWriteAttributeHandler(DEFAULT_DATASOURCE));
    registration.registerReadWriteAttribute(DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE, null, new ReloadRequiredWriteAttributeHandler(DEFAULT_EXTENDEDPERSISTENCE_INHERITANCE));
}
Also used : ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Aggregations

ReloadRequiredWriteAttributeHandler (org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)30 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)14 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)14 OperationContext (org.jboss.as.controller.OperationContext)8 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)8 ModelNode (org.jboss.dmr.ModelNode)8 OperationFailedException (org.jboss.as.controller.OperationFailedException)7 StringListAttributeDefinition (org.jboss.as.controller.StringListAttributeDefinition)6 PropertiesAttributeDefinition (org.jboss.as.controller.PropertiesAttributeDefinition)5 CredentialReferenceWriteAttributeHandler (org.jboss.as.controller.security.CredentialReferenceWriteAttributeHandler)4 ObjectTypeAttributeDefinition (org.jboss.as.controller.ObjectTypeAttributeDefinition)3 PrimitiveListAttributeDefinition (org.jboss.as.controller.PrimitiveListAttributeDefinition)3 ReloadRequiredResourceRegistration (org.jboss.as.clustering.controller.ReloadRequiredResourceRegistration)2 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)2 SimpleAttributeDefinitionBuilder (org.jboss.as.controller.SimpleAttributeDefinitionBuilder)2 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)2 Resource (org.jboss.as.controller.registry.Resource)2 EnumSet (java.util.EnumSet)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1