use of org.jboss.as.clustering.infinispan.subsystem.CacheResourceDefinition.Capability in project wildfly by wildfly.
the class CacheServiceHandler method removeServices.
@Override
public void removeServices(OperationContext context, ModelNode model) {
PathAddress cacheAddress = context.getCurrentAddress();
PathAddress containerAddress = cacheAddress.getParent();
String containerName = containerAddress.getLastElement().getValue();
String cacheName = cacheAddress.getLastElement().getValue();
ServiceNameRegistry<ClusteringCacheRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, cacheAddress);
for (CacheServiceConfiguratorProvider provider : ServiceLoader.load(this.providerClass, this.providerClass.getClassLoader())) {
for (ServiceNameProvider configurator : provider.getServiceConfigurators(registry, containerName, cacheName)) {
context.removeService(configurator.getServiceName());
}
}
context.removeService(InfinispanBindingFactory.createCacheBinding(containerName, cacheName).getBinderServiceName());
context.removeService(InfinispanBindingFactory.createCacheConfigurationBinding(containerName, cacheName).getBinderServiceName());
context.removeService(new XAResourceRecoveryServiceConfigurator(cacheAddress).getServiceName());
context.removeService(CacheComponent.MODULES.getServiceName(cacheAddress));
for (Capability capability : EnumSet.allOf(Capability.class)) {
context.removeService(capability.getServiceName(cacheAddress));
}
}
Aggregations