Search in sources :

Example 1 with ServiceNameProvider

use of org.wildfly.clustering.service.ServiceNameProvider in project wildfly by wildfly.

the class InfinispanSubsystemServiceHandler method removeServices.

@Override
public void removeServices(OperationContext context, ModelNode model) throws OperationFailedException {
    PathAddress address = context.getCurrentAddress();
    ServiceNameRegistry<ClusteringRequirement> localRegistry = new CapabilityServiceNameRegistry<>(LOCAL_CLUSTERING_CAPABILITIES, address);
    for (GroupServiceConfiguratorProvider provider : ServiceLoader.load(LocalGroupServiceConfiguratorProvider.class, LocalGroupServiceConfiguratorProvider.class.getClassLoader())) {
        for (ServiceNameProvider configurator : provider.getServiceConfigurators(localRegistry, LocalGroupServiceConfiguratorProvider.LOCAL)) {
            context.removeService(configurator.getServiceName());
        }
    }
    if (!context.hasOptionalCapability(JGroupsRequirement.CHANNEL.getDefaultRequirement().getName(), null, null)) {
        ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
        for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
            for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, null, LocalGroupServiceConfiguratorProvider.LOCAL)) {
                context.removeService(configurator.getServiceName());
            }
        }
    }
}
Also used : IdentityGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider) CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator) PathAddress(org.jboss.as.controller.PathAddress) LocalGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.LocalGroupServiceConfiguratorProvider) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider) GroupServiceConfiguratorProvider(org.wildfly.clustering.spi.GroupServiceConfiguratorProvider) LocalGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.LocalGroupServiceConfiguratorProvider) IdentityGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider)

Example 2 with ServiceNameProvider

use of org.wildfly.clustering.service.ServiceNameProvider in project wildfly by wildfly.

the class NoTransportServiceHandler method removeServices.

@Override
public void removeServices(OperationContext context, ModelNode model) {
    PathAddress address = context.getCurrentAddress();
    PathAddress containerAddress = address.getParent();
    String name = containerAddress.getLastElement().getValue();
    ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
    for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
        for (ServiceNameProvider configurator : provider.getServiceConfigurators(registry, name, LocalGroupServiceConfiguratorProvider.LOCAL)) {
            context.removeService(configurator.getServiceName());
        }
    }
    context.removeService(new NoTransportServiceConfigurator(address).getServiceName());
}
Also used : IdentityGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider) CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) PathAddress(org.jboss.as.controller.PathAddress) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider)

Example 3 with ServiceNameProvider

use of org.wildfly.clustering.service.ServiceNameProvider in project wildfly by wildfly.

the class JGroupsTransportServiceHandler method removeServices.

@Override
public void removeServices(OperationContext context, ModelNode model) throws OperationFailedException {
    PathAddress address = context.getCurrentAddress();
    PathAddress containerAddress = address.getParent();
    String name = containerAddress.getLastElement().getValue();
    ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
    for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
        for (ServiceNameProvider configurator : provider.getServiceConfigurators(registry, name, null)) {
            context.removeService(configurator.getServiceName());
        }
    }
    context.removeService(new JGroupsTransportServiceConfigurator(address).getServiceName());
}
Also used : IdentityGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider) CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) PathAddress(org.jboss.as.controller.PathAddress) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider)

Example 4 with ServiceNameProvider

use of org.wildfly.clustering.service.ServiceNameProvider 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)

Example 5 with ServiceNameProvider

use of org.wildfly.clustering.service.ServiceNameProvider in project wildfly by wildfly.

the class CacheContainerServiceHandler method removeServices.

@Override
public void removeServices(OperationContext context, ModelNode model) throws OperationFailedException {
    PathAddress address = context.getCurrentAddress();
    String name = context.getCurrentAddressValue();
    String defaultCache = DEFAULT_CACHE.resolveModelAttribute(context, model).asString(null);
    if (defaultCache != null) {
        ServiceNameRegistry<ClusteringCacheRequirement> registry = new CapabilityServiceNameRegistry<>(DEFAULT_CLUSTERING_CAPABILITIES, address);
        for (IdentityCacheServiceConfiguratorProvider provider : ServiceLoader.load(IdentityCacheServiceConfiguratorProvider.class, IdentityCacheServiceConfiguratorProvider.class.getClassLoader())) {
            for (ServiceNameProvider configurator : provider.getServiceConfigurators(registry, name, null, defaultCache)) {
                context.removeService(configurator.getServiceName());
            }
        }
        if (!defaultCache.equals(JndiNameFactory.DEFAULT_LOCAL_NAME)) {
            context.removeService(InfinispanBindingFactory.createCacheBinding(name, JndiNameFactory.DEFAULT_LOCAL_NAME).getBinderServiceName());
            context.removeService(InfinispanBindingFactory.createCacheConfigurationBinding(name, JndiNameFactory.DEFAULT_LOCAL_NAME).getBinderServiceName());
        }
        for (Capability capability : DEFAULT_CAPABILITIES.values()) {
            context.removeService(capability.getServiceName(address));
        }
    }
    context.removeService(InfinispanBindingFactory.createCacheContainerBinding(name).getBinderServiceName());
    context.removeService(CacheContainerComponent.MODULES.getServiceName(address));
    for (Capability capability : EnumSet.allOf(CacheContainerResourceDefinition.Capability.class)) {
        context.removeService(capability.getServiceName(address));
    }
    context.removeService(new ServiceValueCaptorServiceConfigurator<>(this.containerRegistry.remove(CacheContainerResourceDefinition.Capability.CONTAINER.getServiceName(address))).getServiceName());
}
Also used : CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) IdentityCacheServiceConfiguratorProvider(org.wildfly.clustering.spi.IdentityCacheServiceConfiguratorProvider) Capability(org.jboss.as.clustering.controller.Capability) PathAddress(org.jboss.as.controller.PathAddress) ServiceValueCaptorServiceConfigurator(org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider) ClusteringCacheRequirement(org.wildfly.clustering.spi.ClusteringCacheRequirement)

Aggregations

PathAddress (org.jboss.as.controller.PathAddress)8 ServiceNameProvider (org.wildfly.clustering.service.ServiceNameProvider)8 CapabilityServiceNameRegistry (org.wildfly.clustering.spi.CapabilityServiceNameRegistry)8 ClusteringRequirement (org.wildfly.clustering.spi.ClusteringRequirement)6 IdentityGroupServiceConfiguratorProvider (org.wildfly.clustering.spi.IdentityGroupServiceConfiguratorProvider)5 Capability (org.jboss.as.clustering.controller.Capability)3 ServiceValueCaptorServiceConfigurator (org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator)2 ClusteringCacheRequirement (org.wildfly.clustering.spi.ClusteringCacheRequirement)2 GroupServiceConfiguratorProvider (org.wildfly.clustering.spi.GroupServiceConfiguratorProvider)2 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)1 Capability (org.jboss.as.clustering.infinispan.subsystem.CacheResourceDefinition.Capability)1 Capability (org.jboss.as.clustering.jgroups.subsystem.ChannelResourceDefinition.Capability)1 CacheServiceConfiguratorProvider (org.wildfly.clustering.spi.CacheServiceConfiguratorProvider)1 DistributedGroupServiceConfiguratorProvider (org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider)1 IdentityCacheServiceConfiguratorProvider (org.wildfly.clustering.spi.IdentityCacheServiceConfiguratorProvider)1 LocalGroupServiceConfiguratorProvider (org.wildfly.clustering.spi.LocalGroupServiceConfiguratorProvider)1