Search in sources :

Example 1 with Capability

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));
    }
}
Also used : CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) CacheServiceConfiguratorProvider(org.wildfly.clustering.spi.CacheServiceConfiguratorProvider) Capability(org.jboss.as.clustering.infinispan.subsystem.CacheResourceDefinition.Capability) PathAddress(org.jboss.as.controller.PathAddress) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider) ClusteringCacheRequirement(org.wildfly.clustering.spi.ClusteringCacheRequirement)

Aggregations

Capability (org.jboss.as.clustering.infinispan.subsystem.CacheResourceDefinition.Capability)1 PathAddress (org.jboss.as.controller.PathAddress)1 ServiceNameProvider (org.wildfly.clustering.service.ServiceNameProvider)1 CacheServiceConfiguratorProvider (org.wildfly.clustering.spi.CacheServiceConfiguratorProvider)1 CapabilityServiceNameRegistry (org.wildfly.clustering.spi.CapabilityServiceNameRegistry)1 ClusteringCacheRequirement (org.wildfly.clustering.spi.ClusteringCacheRequirement)1