use of org.wildfly.clustering.spi.CacheServiceConfiguratorProvider in project wildfly by wildfly.
the class InfinispanClientMappingsRegistryProvider method getServiceConfigurators.
@Override
public Iterable<CapabilityServiceConfigurator> getServiceConfigurators(String containerName, String connectorName, SupplierDependency<List<ClientMapping>> clientMappings) {
CapabilityServiceConfigurator configurationConfigurator = new TemplateConfigurationServiceConfigurator(ServiceNameFactory.parseServiceName(InfinispanCacheRequirement.CONFIGURATION.getName()).append(containerName, connectorName), containerName, connectorName, null, this);
CapabilityServiceConfigurator cacheConfigurator = new CacheServiceConfigurator<>(ServiceNameFactory.parseServiceName(InfinispanCacheRequirement.CACHE.getName()).append(containerName, connectorName), containerName, connectorName);
CapabilityServiceConfigurator registryEntryConfigurator = new ClientMappingsRegistryEntryServiceConfigurator(containerName, connectorName, clientMappings);
List<Iterable<CapabilityServiceConfigurator>> configurators = new LinkedList<>();
configurators.add(Arrays.asList(configurationConfigurator, cacheConfigurator, registryEntryConfigurator));
ServiceNameRegistry<ClusteringCacheRequirement> routingRegistry = new ServiceNameRegistry<ClusteringCacheRequirement>() {
@Override
public ServiceName getServiceName(ClusteringCacheRequirement requirement) {
return REGISTRY_REQUIREMENTS.contains(requirement) ? ServiceNameFactory.parseServiceName(requirement.getName()).append(containerName, connectorName) : null;
}
};
for (CacheServiceConfiguratorProvider provider : ServiceLoader.load(DistributedCacheServiceConfiguratorProvider.class, DistributedCacheServiceConfiguratorProvider.class.getClassLoader())) {
configurators.add(provider.getServiceConfigurators(routingRegistry, containerName, connectorName));
}
return new CompositeIterable<>(configurators);
}
Aggregations