Search in sources :

Example 41 with ResourceDescriptor

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

the class BackupResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addAttributes(TakeOfflineAttribute.class);
    new RestartParentResourceRegistration(this.parentServiceConfiguratorFactory, descriptor).register(registration);
    if (registration.isRuntimeOnlyRegistrationValid()) {
        new OperationHandler<>(new BackupOperationExecutor(this.executors), BackupOperation.class).register(registration);
    }
    return registration;
}
Also used : ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) RestartParentResourceRegistration(org.jboss.as.clustering.controller.RestartParentResourceRegistration) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 42 with ResourceDescriptor

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

the class RemoteCacheContainerResourceDefinition method register.

@SuppressWarnings("deprecation")
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parentRegistration) {
    ManagementResourceRegistration registration = parentRegistration.registerSubModel(this);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addAttributes(ListAttribute.class).addIgnoredAttributes(EnumSet.complementOf(EnumSet.of(DeprecatedAttribute.MODULE))).addAttributeTranslation(DeprecatedAttribute.MODULE, new ListAttributeTranslation(ListAttribute.MODULES)).addCapabilities(Capability.class).addRequiredChildren(ConnectionPoolResourceDefinition.PATH, ThreadPoolResourceDefinition.CLIENT.getPathElement(), SecurityResourceDefinition.PATH, RemoteTransactionResourceDefinition.PATH).addRequiredSingletonChildren(NoNearCacheResourceDefinition.PATH).setResourceTransformation(RemoteCacheContainerResource::new);
    ServiceValueExecutorRegistry<RemoteCacheContainer> executors = new ServiceValueExecutorRegistry<>();
    ResourceServiceHandler handler = new RemoteCacheContainerServiceHandler(this, executors);
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    new ConnectionPoolResourceDefinition().register(registration);
    new RemoteClusterResourceDefinition(this, executors).register(registration);
    new SecurityResourceDefinition().register(registration);
    new RemoteTransactionResourceDefinition().register(registration);
    new InvalidationNearCacheResourceDefinition().register(registration);
    new NoNearCacheResourceDefinition().register(registration);
    ThreadPoolResourceDefinition.CLIENT.register(registration);
    if (registration.isRuntimeOnlyRegistrationValid()) {
        new MetricHandler<>(new RemoteCacheContainerMetricExecutor(executors), RemoteCacheContainerMetric.class).register(registration);
        new RemoteCacheResourceDefinition(executors).register(registration);
    }
    return registration;
}
Also used : UnaryRequirementCapability(org.jboss.as.clustering.controller.UnaryRequirementCapability) ListAttributeTranslation(org.jboss.as.clustering.controller.ListAttributeTranslation) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) RemoteCacheContainer(org.wildfly.clustering.infinispan.client.RemoteCacheContainer) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) ServiceValueExecutorRegistry(org.jboss.as.clustering.controller.ServiceValueExecutorRegistry) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Example 43 with ResourceDescriptor

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

the class TransactionResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(this);
    parent.registerAlias(LEGACY_PATH, new SimpleAliasEntry(registration));
    Capability dependentCapability = new BinaryRequirementCapability(InfinispanCacheRequirement.CACHE, BinaryCapabilityNameResolver.GRANDPARENT_PARENT);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(Attribute.class).addResourceCapabilityReference(new TransactionResourceCapabilityReference(dependentCapability, CommonRequirement.LOCAL_TRANSACTION_PROVIDER, Attribute.MODE, EnumSet.of(TransactionMode.NONE, TransactionMode.BATCH))).addResourceCapabilityReference(new TransactionResourceCapabilityReference(dependentCapability, TransactionRequirement.TRANSACTION_SYNCHRONIZATION_REGISTRY, Attribute.MODE, EnumSet.complementOf(EnumSet.of(TransactionMode.NON_XA)))).addResourceCapabilityReference(new TransactionResourceCapabilityReference(dependentCapability, TransactionRequirement.XA_RESOURCE_RECOVERY_REGISTRY, Attribute.MODE, EnumSet.complementOf(EnumSet.of(TransactionMode.FULL_XA))));
    ResourceServiceHandler handler = new SimpleResourceServiceHandler(TransactionServiceConfigurator::new);
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    if (registration.isRuntimeOnlyRegistrationValid()) {
        for (DeprecatedMetric metric : EnumSet.allOf(DeprecatedMetric.class)) {
            metric.register(registration);
        }
    }
    return registration;
}
Also used : BinaryRequirementCapability(org.jboss.as.clustering.controller.BinaryRequirementCapability) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) BinaryRequirementCapability(org.jboss.as.clustering.controller.BinaryRequirementCapability) Capability(org.jboss.as.clustering.controller.Capability) SimpleAliasEntry(org.jboss.as.clustering.controller.SimpleAliasEntry) 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 44 with ResourceDescriptor

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

the class TransportResourceDefinition method register.

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

Example 45 with ResourceDescriptor

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

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