use of org.jboss.as.clustering.controller.SimpleResourceServiceHandler 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);
}
use of org.jboss.as.clustering.controller.SimpleResourceServiceHandler in project wildfly by wildfly.
the class EvictionResourceDefinition 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 EvictionBuilder(address.getParent()));
new SimpleResourceRegistration(descriptor, handler).register(registration);
if (this.allowRuntimeOnlyRegistration) {
new MetricHandler<>(new EvictionMetricExecutor(), EvictionMetric.class).register(registration);
}
}
use of org.jboss.as.clustering.controller.SimpleResourceServiceHandler in project wildfly by wildfly.
the class BinaryTableResourceDefinition 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 BinaryTableBuilder(address.getParent().getParent()));
new SimpleResourceRegistration(descriptor, handler).register(registration);
}
use of org.jboss.as.clustering.controller.SimpleResourceServiceHandler 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;
}
use of org.jboss.as.clustering.controller.SimpleResourceServiceHandler in project wildfly by wildfly.
the class MemoryResourceDefinition method register.
@Override
public ManagementResourceRegistration register(ManagementResourceRegistration parent) {
ManagementResourceRegistration registration = parent.registerSubModel(this);
ResourceDescriptor descriptor = this.configurator.apply(new ResourceDescriptor(this.getResourceDescriptionResolver())).addAttributes(Attribute.class);
ResourceServiceHandler handler = new SimpleResourceServiceHandler(this);
new SimpleResourceRegistration(descriptor, handler).register(registration);
if (registration.isRuntimeOnlyRegistrationValid()) {
for (EvictionMetric metric : EnumSet.allOf(EvictionMetric.class)) {
metric.register(registration);
}
}
return registration;
}
Aggregations