Search in sources :

Example 26 with AttributeDefinition

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

the class BridgeDefinition 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);
        }
    }
    BridgeControlHandler.INSTANCE.registerAttributes(registry);
}
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) ObjectTypeAttributeDefinition(org.jboss.as.controller.ObjectTypeAttributeDefinition) ReloadRequiredWriteAttributeHandler(org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)

Example 27 with AttributeDefinition

use of org.jboss.as.controller.AttributeDefinition 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 28 with AttributeDefinition

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

the class ModClusterSubsystemAdd method populateModel.

/**
     * This is here so legacy configuration can be supported.
     */
@Override
protected void populateModel(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException {
    if (operation.hasDefined(CommonAttributes.MOD_CLUSTER_CONFIG)) {
        PathAddress opAddress = PathAddress.pathAddress(operation.get(ModelDescriptionConstants.OP_ADDR));
        PathAddress parent = opAddress.append(ModClusterConfigResourceDefinition.PATH);
        ModelNode targetOperation = Util.createAddOperation(parent);
        for (AttributeDefinition def : ModClusterConfigResourceDefinition.ATTRIBUTES) {
            def.validateAndSet(operation, targetOperation);
        }
        context.addStep(targetOperation, ModClusterConfigAdd.INSTANCE, OperationContext.Stage.MODEL, true);
    }
    // Inform handlers for child resources that we are part of the set of operations
    // so they know we'll be utilizing any model they write. We do this in Stage.MODEL
    // so in their Stage.MODEL they can decide to skip adding a runtime step
    context.attach(SUBSYSTEM_ADD_KEY, Boolean.TRUE);
}
Also used : PathAddress(org.jboss.as.controller.PathAddress) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) ModelNode(org.jboss.dmr.ModelNode)

Example 29 with AttributeDefinition

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

the class TransactionSubsystemAdd method populateModel.

@Override
protected void populateModel(ModelNode operation, ModelNode model) throws OperationFailedException {
    populateModelWithRecoveryEnvConfig(operation, model);
    populateModelWithCoreEnvConfig(operation, model);
    populateModelWithCoordinatorEnvConfig(operation, model);
    populateModelWithObjectStoreConfig(operation, model);
    TransactionSubsystemRootResourceDefinition.JTS.validateAndSet(operation, model);
    validateStoreConfig(operation, model);
    TransactionSubsystemRootResourceDefinition.USE_JOURNAL_STORE.validateAndSet(operation, model);
    for (AttributeDefinition ad : TransactionSubsystemRootResourceDefinition.attributes_1_2) {
        ad.validateAndSet(operation, model);
    }
    TransactionSubsystemRootResourceDefinition.JOURNAL_STORE_ENABLE_ASYNC_IO.validateAndSet(operation, model);
}
Also used : AttributeDefinition(org.jboss.as.controller.AttributeDefinition)

Example 30 with AttributeDefinition

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

the class Filter method createHttpHandler.

public HttpHandler createHttpHandler(final Predicate predicate, final ModelNode model, HttpHandler next) {
    List<AttributeDefinition> attributes = new ArrayList<>(getAttributes());
    HttpHandler handler = createHandler(getHandlerClass(), model, attributes, next);
    if (predicate != null) {
        return Handlers.predicate(predicate, handler, next);
    } else {
        return handler;
    }
}
Also used : HttpHandler(io.undertow.server.HttpHandler) ArrayList(java.util.ArrayList) AttributeDefinition(org.jboss.as.controller.AttributeDefinition)

Aggregations

AttributeDefinition (org.jboss.as.controller.AttributeDefinition)79 ModelNode (org.jboss.dmr.ModelNode)43 SimpleAttributeDefinition (org.jboss.as.controller.SimpleAttributeDefinition)33 OperationContext (org.jboss.as.controller.OperationContext)16 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)12 PathAddress (org.jboss.as.controller.PathAddress)12 Resource (org.jboss.as.controller.registry.Resource)11 Property (org.jboss.dmr.Property)11 ReloadRequiredWriteAttributeHandler (org.jboss.as.controller.ReloadRequiredWriteAttributeHandler)10 OperationFailedException (org.jboss.as.controller.OperationFailedException)8 AbstractAddStepHandler (org.jboss.as.controller.AbstractAddStepHandler)7 ArrayList (java.util.ArrayList)5 Map (java.util.Map)5 PathElement (org.jboss.as.controller.PathElement)5 PrimitiveListAttributeDefinition (org.jboss.as.controller.PrimitiveListAttributeDefinition)5 PropertiesAttributeDefinition (org.jboss.as.controller.PropertiesAttributeDefinition)5 StringListAttributeDefinition (org.jboss.as.controller.StringListAttributeDefinition)5 SecurityDomainContext (org.jboss.as.security.plugins.SecurityDomainContext)5 ServiceBuilder (org.jboss.msc.service.ServiceBuilder)5 ServiceRegistry (org.jboss.msc.service.ServiceRegistry)5