Search in sources :

Example 31 with ManagementResourceRegistration

use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.

the class SecurityResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(Capability.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler(this);
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    return registration;
}
Also used : SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 32 with ManagementResourceRegistration

use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.

the class NoNearCacheResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver());
    new SimpleResourceRegistration(descriptor, null).register(registration);
    return registration;
}
Also used : SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 33 with ManagementResourceRegistration

use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.

the class JGroupsSubsystemResourceDefinition method register.

@Override
public void register(SubsystemRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubsystemModel(this);
    new DefaultSubsystemDescribeHandler().register(registration);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(model -> model.hasDefined(Attribute.DEFAULT_CHANNEL.getName()), CAPABILITIES.values()).addCapabilities(model -> model.hasDefined(Attribute.DEFAULT_CHANNEL.getName()), CLUSTERING_CAPABILITIES.values()).setAddOperationTransformation(new AddOperationTransformer());
    ResourceServiceHandler handler = new JGroupsSubsystemServiceHandler();
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    new ChannelResourceDefinition().register(registration);
    new StackResourceDefinition().register(registration);
}
Also used : OperationStepHandler(org.jboss.as.controller.OperationStepHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) SubsystemResourceDefinition(org.jboss.as.clustering.controller.SubsystemResourceDefinition) JGroupsRequirement(org.wildfly.clustering.jgroups.spi.JGroupsRequirement) SimpleAttributeDefinitionBuilder(org.jboss.as.controller.SimpleAttributeDefinitionBuilder) UnaryOperator(java.util.function.UnaryOperator) CapabilityReference(org.jboss.as.clustering.controller.CapabilityReference) AttributeAccess(org.jboss.as.controller.registry.AttributeAccess) OperationContext(org.jboss.as.controller.OperationContext) SubsystemRegistration(org.jboss.as.clustering.controller.SubsystemRegistration) Util(org.jboss.as.controller.operations.common.Util) Map(java.util.Map) DefaultSubsystemDescribeHandler(org.jboss.as.clustering.controller.DefaultSubsystemDescribeHandler) ModelDescriptionConstants(org.jboss.as.controller.descriptions.ModelDescriptionConstants) EnumSet(java.util.EnumSet) AttributeDefinition(org.jboss.as.controller.AttributeDefinition) Capability(org.jboss.as.clustering.controller.Capability) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) EnumMap(java.util.EnumMap) PathAddress(org.jboss.as.controller.PathAddress) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor) PathElement(org.jboss.as.controller.PathElement) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) OperationFailedException(org.jboss.as.controller.OperationFailedException) ModelNode(org.jboss.dmr.ModelNode) RequirementCapability(org.jboss.as.clustering.controller.RequirementCapability) ModelType(org.jboss.dmr.ModelType) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) DefaultSubsystemDescribeHandler(org.jboss.as.clustering.controller.DefaultSubsystemDescribeHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 34 with ManagementResourceRegistration

use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.

the class SingletonDeploymentResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    new MetricHandler<>(new SingletonDeploymentMetricExecutor(this.executors), SingletonMetric.class).register(registration);
    return registration;
}
Also used : ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration)

Example 35 with ManagementResourceRegistration

use of org.jboss.as.clustering.controller.ManagementResourceRegistration in project wildfly by wildfly.

the class SingletonPolicyResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addCapabilities(Capability.class).addRequiredSingletonChildren(SimpleElectionPolicyResourceDefinition.PATH).setResourceTransformation(SingletonPolicyResource::new);
    ServiceValueExecutorRegistry<Singleton> executors = new ServiceValueExecutorRegistry<>();
    ResourceServiceHandler handler = new SingletonPolicyServiceHandler(executors);
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    new RandomElectionPolicyResourceDefinition().register(registration);
    new SimpleElectionPolicyResourceDefinition().register(registration);
    if (registration.isRuntimeOnlyRegistrationValid()) {
        new SingletonDeploymentResourceDefinition(executors).register(registration);
        new SingletonServiceResourceDefinition(executors).register(registration);
    }
    return registration;
}
Also used : ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) Singleton(org.wildfly.clustering.singleton.Singleton) ServiceValueExecutorRegistry(org.jboss.as.clustering.controller.ServiceValueExecutorRegistry) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Aggregations

ManagementResourceRegistration (org.jboss.as.clustering.controller.ManagementResourceRegistration)41 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)31 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)25 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)23 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)13 SimpleAliasEntry (org.jboss.as.clustering.controller.SimpleAliasEntry)10 ServiceValueExecutorRegistry (org.jboss.as.clustering.controller.ServiceValueExecutorRegistry)5 OperationContext (org.jboss.as.controller.OperationContext)5 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)5 PathAddress (org.jboss.as.controller.PathAddress)5 ModelNode (org.jboss.dmr.ModelNode)5 UnaryRequirementCapability (org.jboss.as.clustering.controller.UnaryRequirementCapability)4 PathElement (org.jboss.as.controller.PathElement)4 EnumSet (java.util.EnumSet)3 Capability (org.jboss.as.clustering.controller.Capability)3 DeploymentChainContributingResourceRegistration (org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration)3 ListAttributeTranslation (org.jboss.as.clustering.controller.ListAttributeTranslation)3 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)3 OperationFailedException (org.jboss.as.controller.OperationFailedException)3 EnumMap (java.util.EnumMap)2