Search in sources :

Example 46 with ResourceDescriptor

use of org.jboss.as.clustering.controller.ResourceDescriptor 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 47 with ResourceDescriptor

use of org.jboss.as.clustering.controller.ResourceDescriptor 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 48 with ResourceDescriptor

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

the class RemoteSiteResourceDefinition method register.

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

Example 49 with ResourceDescriptor

use of org.jboss.as.clustering.controller.ResourceDescriptor 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)

Example 50 with ResourceDescriptor

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

the class ElectionPolicyResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    ResourceDescriptor descriptor = this.configurator.apply(new ResourceDescriptor(this.getResourceDescriptionResolver())).addAttributes(ElectionPolicyResourceDefinition.Attribute.class).addCapabilities(ElectionPolicyResourceDefinition.Capability.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler(this.serviceConfiguratorFactory);
    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.controller.registry.ManagementResourceRegistration) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Aggregations

ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)61 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)41 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)38 ManagementResourceRegistration (org.jboss.as.clustering.controller.ManagementResourceRegistration)31 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)27 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)26 ReloadRequiredResourceRegistration (org.jboss.as.clustering.controller.ReloadRequiredResourceRegistration)10 SimpleAliasEntry (org.jboss.as.clustering.controller.SimpleAliasEntry)9 DeploymentChainContributingResourceRegistration (org.jboss.as.clustering.controller.DeploymentChainContributingResourceRegistration)5 ServiceValueExecutorRegistry (org.jboss.as.clustering.controller.ServiceValueExecutorRegistry)5 UnaryRequirementCapability (org.jboss.as.clustering.controller.UnaryRequirementCapability)5 OperationContext (org.jboss.as.controller.OperationContext)5 OperationStepHandler (org.jboss.as.controller.OperationStepHandler)5 ModelNode (org.jboss.dmr.ModelNode)5 RestartParentResourceRegistration (org.jboss.as.clustering.controller.RestartParentResourceRegistration)4 OperationFailedException (org.jboss.as.controller.OperationFailedException)4 PathElement (org.jboss.as.controller.PathElement)4 EnumSet (java.util.EnumSet)3 Capability (org.jboss.as.clustering.controller.Capability)3 ListAttributeTranslation (org.jboss.as.clustering.controller.ListAttributeTranslation)3