use of org.wildfly.clustering.spi.CapabilityServiceNameRegistry 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.spi.CapabilityServiceNameRegistry in project wildfly by wildfly.
the class NoTransportServiceHandler method installServices.
@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
PathAddress containerAddress = address.getParent();
String name = containerAddress.getLastElement().getValue();
ServiceTarget target = context.getServiceTarget();
new NoTransportServiceConfigurator(address).build(target).install();
ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, name, LocalGroupServiceConfiguratorProvider.LOCAL)) {
configurator.configure(context).build(target).install();
}
}
}
use of org.wildfly.clustering.spi.CapabilityServiceNameRegistry in project wildfly by wildfly.
the class JGroupsTransportServiceHandler method installServices.
@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
PathAddress containerAddress = address.getParent();
String name = containerAddress.getLastElement().getValue();
ServiceTarget target = context.getServiceTarget();
JGroupsTransportServiceConfigurator transportBuilder = new JGroupsTransportServiceConfigurator(address).configure(context, model);
transportBuilder.build(target).install();
String channel = transportBuilder.getChannel();
ServiceNameRegistry<ClusteringRequirement> registry = new CapabilityServiceNameRegistry<>(CLUSTERING_CAPABILITIES, address);
for (IdentityGroupServiceConfiguratorProvider provider : ServiceLoader.load(IdentityGroupServiceConfiguratorProvider.class, IdentityGroupServiceConfiguratorProvider.class.getClassLoader())) {
for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, name, channel)) {
configurator.configure(context).build(target).install();
}
}
}
use of org.wildfly.clustering.spi.CapabilityServiceNameRegistry 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.spi.CapabilityServiceNameRegistry in project wildfly by wildfly.
the class CacheContainerServiceHandler method installServices.
@Override
public void installServices(OperationContext context, ModelNode model) throws OperationFailedException {
PathAddress address = context.getCurrentAddress();
String name = context.getCurrentAddressValue();
ServiceTarget target = context.getServiceTarget();
new ModulesServiceConfigurator(CacheContainerComponent.MODULES.getServiceName(address), MODULES, Collections.singletonList(Module.forClass(WildFlyInfinispanModuleLifecycle.class))).configure(context, model).build(target).setInitialMode(ServiceController.Mode.PASSIVE).install();
GlobalConfigurationServiceConfigurator configBuilder = new GlobalConfigurationServiceConfigurator(address);
configBuilder.configure(context, model).build(target).install();
CacheContainerServiceConfigurator containerBuilder = new CacheContainerServiceConfigurator(address, this.cacheRegistry).configure(context, model);
containerBuilder.build(target).install();
new ServiceValueCaptorServiceConfigurator<>(this.containerRegistry.add(containerBuilder.getServiceName())).build(target).install();
new KeyAffinityServiceFactoryServiceConfigurator(address).build(target).install();
new BinderServiceConfigurator(InfinispanBindingFactory.createCacheContainerBinding(name), containerBuilder.getServiceName()).build(target).install();
String defaultCache = DEFAULT_CACHE.resolveModelAttribute(context, model).asString(null);
if (defaultCache != null) {
for (Map.Entry<InfinispanCacheRequirement, Capability> entry : DEFAULT_CAPABILITIES.entrySet()) {
new IdentityServiceConfigurator<>(entry.getValue().getServiceName(address), entry.getKey().getServiceName(context, name, defaultCache)).build(target).install();
}
if (!defaultCache.equals(JndiNameFactory.DEFAULT_LOCAL_NAME)) {
new BinderServiceConfigurator(InfinispanBindingFactory.createCacheBinding(name, JndiNameFactory.DEFAULT_LOCAL_NAME), DEFAULT_CAPABILITIES.get(InfinispanCacheRequirement.CACHE).getServiceName(address)).build(target).install();
new BinderServiceConfigurator(InfinispanBindingFactory.createCacheConfigurationBinding(name, JndiNameFactory.DEFAULT_LOCAL_NAME), DEFAULT_CAPABILITIES.get(InfinispanCacheRequirement.CONFIGURATION).getServiceName(address)).build(target).install();
}
ServiceNameRegistry<ClusteringCacheRequirement> registry = new CapabilityServiceNameRegistry<>(DEFAULT_CLUSTERING_CAPABILITIES, address);
for (IdentityCacheServiceConfiguratorProvider provider : ServiceLoader.load(IdentityCacheServiceConfiguratorProvider.class, IdentityCacheServiceConfiguratorProvider.class.getClassLoader())) {
for (CapabilityServiceConfigurator configurator : provider.getServiceConfigurators(registry, name, null, defaultCache)) {
configurator.configure(context).build(target).install();
}
}
}
}
Aggregations