Search in sources :

Example 1 with Capability

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());
}
Also used : CapabilityServiceNameRegistry(org.wildfly.clustering.spi.CapabilityServiceNameRegistry) Capability(org.jboss.as.clustering.jgroups.subsystem.ChannelResourceDefinition.Capability) PathAddress(org.jboss.as.controller.PathAddress) ServiceValueCaptorServiceConfigurator(org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator) DistributedGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider) ClusteringRequirement(org.wildfly.clustering.spi.ClusteringRequirement) ServiceNameProvider(org.wildfly.clustering.service.ServiceNameProvider) GroupServiceConfiguratorProvider(org.wildfly.clustering.spi.GroupServiceConfiguratorProvider) DistributedGroupServiceConfiguratorProvider(org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider)

Aggregations

ServiceValueCaptorServiceConfigurator (org.jboss.as.clustering.controller.ServiceValueCaptorServiceConfigurator)1 Capability (org.jboss.as.clustering.jgroups.subsystem.ChannelResourceDefinition.Capability)1 PathAddress (org.jboss.as.controller.PathAddress)1 ServiceNameProvider (org.wildfly.clustering.service.ServiceNameProvider)1 CapabilityServiceNameRegistry (org.wildfly.clustering.spi.CapabilityServiceNameRegistry)1 ClusteringRequirement (org.wildfly.clustering.spi.ClusteringRequirement)1 DistributedGroupServiceConfiguratorProvider (org.wildfly.clustering.spi.DistributedGroupServiceConfiguratorProvider)1 GroupServiceConfiguratorProvider (org.wildfly.clustering.spi.GroupServiceConfiguratorProvider)1