use of org.wildfly.clustering.service.CompositeDependency in project wildfly by wildfly.
the class JChannelFactoryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<ChannelFactory> factory = new CompositeDependency(this.transport, this.relay, this.socketBindingManager).register(builder).provides(this.getServiceName());
this.environment = builder.requires(ServerEnvironmentService.SERVICE_NAME);
for (Dependency dependency : this.protocols) {
dependency.register(builder);
}
Service service = Service.newInstance(factory, new JChannelFactory(this));
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.wildfly.clustering.service.CompositeDependency in project wildfly by wildfly.
the class SingletonPolicyServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<SingletonPolicy> policy = new CompositeDependency(this.policy, this.factory).register(builder).provides(this.getServiceName());
Service service = Service.newInstance(policy, this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
use of org.wildfly.clustering.service.CompositeDependency in project wildfly by wildfly.
the class DistributedSingletonServiceBuilder method build.
@Override
public ServiceBuilder<T> build(ServiceTarget target) {
SingletonService<T> service = new LegacyDistributedSingletonService<>(this, this.primaryService, this.backupService);
ServiceBuilder<T> installer = new AsynchronousServiceBuilder<>(this.getServiceName(), service).build(target);
return new CompositeDependency(this.registry, this.dispatcherFactory).register(installer);
}
use of org.wildfly.clustering.service.CompositeDependency in project wildfly by wildfly.
the class DistributedSingletonServiceConfigurator method build.
@Override
public SingletonServiceBuilder<?> build(ServiceTarget target) {
ServiceName name = this.getServiceName().append("singleton");
ServiceBuilder<?> builder = new AsyncServiceConfigurator(name).build(target);
Consumer<Singleton> singleton = builder.provides(name);
return new DistributedSingletonServiceBuilder<>(this, new CompositeDependency(this.registry, this.dispatcherFactory).register(builder), singleton);
}
use of org.wildfly.clustering.service.CompositeDependency 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);
}
Aggregations