use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.
the class RemoteCacheContainerConfigurationServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<Configuration> configuration = new CompositeDependency(this.loader, this.modules, this.connectionPool, this.security, this.server).register(builder).provides(this.getServiceName());
for (Dependency dependency : this.threadPools.values()) {
dependency.register(builder);
}
for (List<SupplierDependency<OutboundSocketBinding>> dependencies : this.clusters.values()) {
for (Dependency dependency : dependencies) {
dependency.register(builder);
}
}
Service service = new FunctionalService<>(configuration, Function.identity(), this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.
the class ElectionPolicyServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<SingletonElectionPolicy> policy = builder.provides(this.getServiceName());
for (Dependency dependency : this.dependencies) {
dependency.register(builder);
}
Service service = new FunctionalService<>(policy, this, this);
return builder.setInstance(service);
}
use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.
the class LocalRouteServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<String> route = this.route.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(route, Function.identity(), this.route);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.
the class InfinispanSessionManagerFactoryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
this.configurationConfigurator.build(target).install();
this.cacheConfigurator.build(target).install();
for (ServiceConfigurator configurator : this.configurators) {
configurator.build(target).install();
}
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<SessionManagerFactory<SC, LC, TransactionBatch>> factory = new CompositeDependency(this.group, this.affinityFactory, this.dispatcherFactory).register(builder).provides(this.getServiceName());
this.cache = builder.requires(this.cacheConfigurator.getServiceName());
Service service = new FunctionalService<>(factory, Function.identity(), this, Consumers.close());
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.
the class PrimaryOwnerRouteLocatorServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceName name = this.getServiceName();
ServiceBuilder<?> builder = new AsyncServiceConfigurator(name).build(target);
Consumer<RouteLocator> locator = new CompositeDependency(this.registry, this.cache, this.factory).register(builder).provides(name);
Service service = new FunctionalService<>(locator, Function.identity(), this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Aggregations