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());
}
}
}
}
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());
}
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());
}
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));
}
}
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());
}
Aggregations