Search in sources :

Example 1 with TransactionResourceCapabilityReference

use of org.jboss.as.clustering.infinispan.subsystem.TransactionResourceCapabilityReference in project wildfly by wildfly.

the class RemoteTransactionResourceDefinition method register.

@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
    ManagementResourceRegistration registration = parent.registerSubModel(new RemoteTransactionResourceDefinition());
    Capability dependentCapability = new UnaryRequirementCapability(InfinispanClientRequirement.REMOTE_CONTAINER_CONFIGURATION, UnaryCapabilityNameResolver.PARENT);
    ResourceDescriptor descriptor = new ResourceDescriptor(this.getResourceDescriptionResolver()).addAttributes(EnumSet.complementOf(EnumSet.of(Attribute.TIMEOUT))).addAttributeTranslation(Attribute.TIMEOUT, new AttributeTranslation() {

        @Override
        public org.jboss.as.clustering.controller.Attribute getTargetAttribute() {
            return RemoteCacheContainerResourceDefinition.Attribute.TRANSACTION_TIMEOUT;
        }

        @Override
        public UnaryOperator<PathAddress> getPathAddressTransformation() {
            return PathAddress::getParent;
        }
    }).addResourceCapabilityReference(new TransactionResourceCapabilityReference(dependentCapability, CommonRequirement.LOCAL_TRANSACTION_PROVIDER, Attribute.MODE, EnumSet.of(TransactionMode.NONE, TransactionMode.BATCH)));
    ResourceServiceHandler handler = new SimpleResourceServiceHandler(this);
    new SimpleResourceRegistration(descriptor, handler).register(registration);
    return registration;
}
Also used : Capability(org.jboss.as.clustering.controller.Capability) UnaryRequirementCapability(org.jboss.as.clustering.controller.UnaryRequirementCapability) UnaryRequirementCapability(org.jboss.as.clustering.controller.UnaryRequirementCapability) ManagementResourceRegistration(org.jboss.as.clustering.controller.ManagementResourceRegistration) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) SimpleResourceRegistration(org.jboss.as.clustering.controller.SimpleResourceRegistration) AttributeTranslation(org.jboss.as.clustering.controller.AttributeTranslation) PathAddress(org.jboss.as.controller.PathAddress) TransactionResourceCapabilityReference(org.jboss.as.clustering.infinispan.subsystem.TransactionResourceCapabilityReference) SimpleResourceServiceHandler(org.jboss.as.clustering.controller.SimpleResourceServiceHandler) ResourceServiceHandler(org.jboss.as.clustering.controller.ResourceServiceHandler) ResourceDescriptor(org.jboss.as.clustering.controller.ResourceDescriptor)

Aggregations

AttributeTranslation (org.jboss.as.clustering.controller.AttributeTranslation)1 Capability (org.jboss.as.clustering.controller.Capability)1 ManagementResourceRegistration (org.jboss.as.clustering.controller.ManagementResourceRegistration)1 ResourceDescriptor (org.jboss.as.clustering.controller.ResourceDescriptor)1 ResourceServiceHandler (org.jboss.as.clustering.controller.ResourceServiceHandler)1 SimpleResourceRegistration (org.jboss.as.clustering.controller.SimpleResourceRegistration)1 SimpleResourceServiceHandler (org.jboss.as.clustering.controller.SimpleResourceServiceHandler)1 UnaryRequirementCapability (org.jboss.as.clustering.controller.UnaryRequirementCapability)1 TransactionResourceCapabilityReference (org.jboss.as.clustering.infinispan.subsystem.TransactionResourceCapabilityReference)1 PathAddress (org.jboss.as.controller.PathAddress)1