use of org.jboss.as.clustering.controller.BinaryRequirementCapability 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;
}
Aggregations