use of org.jboss.as.clustering.jgroups.subsystem.ChannelResourceDefinition.Capability in project wildfly by wildfly.
the class ChannelServiceHandler method removeServices.
@Override
public void removeServices(OperationContext context, ModelNode model) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
String name = context.getCurrentAddressValue();
for (Capability capability : EnumSet.allOf(Capability.class)) {
context.removeService(capability.getServiceName(address));
}
context.removeService(JGroupsBindingFactory.createChannelBinding(name).getBinderServiceName());
context.removeService(JGroupsBindingFactory.createChannelFactoryBinding(name).getBinderServiceName());
ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
for (GroupServiceConfiguratorProvider provider : ServiceLoader.load(DistributedGroupServiceConfiguratorProvider.class, DistributedGroupServiceConfiguratorProvider.class.getClassLoader())) {
for (ServiceNameProvider configurator : provider.getServiceConfigurators(registry, name)) {
JGroupsLogger.ROOT_LOGGER.debugf("Removing %s for channel %s", configurator.getServiceName(), name);
context.removeService(configurator.getServiceName());
}
}
context.removeService(new ServiceValueCaptorServiceConfigurator<>(this.registry.remove(JCHANNEL.getServiceName(address))).getServiceName());
}
Aggregations