Search in sources :

Example 16 with ResourceDescriptor

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

the class RandomElectionPolicyResourceDefinition method register.

@Override
public void register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(ElectionPolicyResourceDefinition.Attribute.class).addCapabilities(ElectionPolicyResourceDefinition.Capability.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler<>(address -> new RandomElectionPolicyBuilder(address.getParent()));
    new SimpleResourceRegistration(descriptor, handler).register(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)

Example 17 with ResourceDescriptor

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

the class StringTableResourceDefinition method register.

@Override
public void register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addAttributes(TableResourceDefinition.Attribute.class).addAttributes(TableResourceDefinition.ColumnAttribute.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler<>(address -> new StringTableBuilder(address.getParent().getParent()));
    new SimpleResourceRegistration(descriptor, handler).register(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)

Example 18 with ResourceDescriptor

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

the class TransactionResourceDefinition method register.

@Override
public void register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    parentRegistration.registerAlias(LEGACY_PATH, new SimpleAliasEntry(registration));
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler<>(address -> new TransactionBuilder(address.getParent()));
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    if (this.allowRuntimeOnlyRegistration) {
        new MetricHandler<>(new TransactionMetricExecutor(), TransactionMetric.class).register(registration);
    }
}
Also used : SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) SimpleAliasEntry(org.jboss.as.clustering.controller.SimpleAliasEntry) 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)

Example 19 with ResourceDescriptor

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

the class NoTransportResourceDefinition method register.

@Override
public void register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addCapabilities(CLUSTERING_CAPABILITIES.values());
    ResourceServiceHandler handler = new NoTransportServiceHandler();
    new SimpleResourceRegistration(descriptor, handler).register(registration);
}
Also used : SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ManagementResourceRegistration(org.jboss.as.controller.registry.ManagementResourceRegistration) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 20 with ResourceDescriptor

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

the class SimpleElectionPolicyResourceDefinition method register.

@Override
public void register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addAttributes(ElectionPolicyResourceDefinition.Attribute.class).addCapabilities(ElectionPolicyResourceDefinition.Capability.class);
    ResourceServiceHandler handler = new SimpleResourceServiceHandler<>(address -> new SimpleElectionPolicyBuilder(address.getParent()));
    new SimpleResourceRegistration(descriptor, handler).register(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)32 ManagementResourceRegistration (org.jboss.as.controller.registry.ManagementResourceRegistration)30 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)26 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)26 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)16 SimpleAliasEntry (org.jboss.as.clustering.controller.SimpleAliasEntry)9 PathElement (org.jboss.as.controller.PathElement)6 UnaryRequirementCapability (org.jboss.as.clustering.controller.UnaryRequirementCapability)5 EnumMap (java.util.EnumMap)4 EnumSet (java.util.EnumSet)4 Map (java.util.Map)4 ModelVersion (org.jboss.as.controller.ModelVersion)4 ModelDescriptionConstants (org.jboss.as.controller.descriptions.ModelDescriptionConstants)4 ResourceTransformationDescriptionBuilder (org.jboss.as.controller.transform.description.ResourceTransformationDescriptionBuilder)4 CapabilityProvider (org.jboss.as.clustering.controller.CapabilityProvider)3 CapabilityReference (org.jboss.as.clustering.controller.CapabilityReference)3 RequirementCapability (org.jboss.as.clustering.controller.RequirementCapability)3 SubsystemResourceDefinition (org.jboss.as.clustering.controller.SubsystemResourceDefinition)3 AttributeDefinition (org.jboss.as.controller.AttributeDefinition)3 CapabilityReferenceRecorder (org.jboss.as.controller.CapabilityReferenceRecorder)3