use of org.wildfly.clustering.provider.ServiceProviderRegistry in project wildfly by wildfly.
the class CacheServiceProviderRegistryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
Consumer<ServiceProviderRegistry<T>> registry = new CompositeDependency(this.cache, this.dispatcherFactory, this.group).register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(registry, Functions.identity(), this, Consumers.close());
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.wildfly.clustering.provider.ServiceProviderRegistry in project wildfly by wildfly.
the class LocalServiceProviderRegistryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<ServiceProviderRegistry<T>> registry = this.group.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(registry, Function.identity(), this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Aggregations