use of org.jboss.msc.Service 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.jboss.msc.Service 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.jboss.msc.Service 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);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class RouteRegistryEntryProviderServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceName name = this.getServiceName();
ServiceBuilder<?> builder = target.addService(name);
Consumer<Map.Entry<String, Void>> entry = this.route.register(builder).provides(name);
Service service = new FunctionalService<>(entry, this, this.route);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class ClientMappingsRegistryEntryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceName name = this.getServiceName();
ServiceBuilder<?> builder = target.addService(name);
Consumer<Map.Entry<String, List<ClientMapping>>> entry = new CompositeDependency(this.group, this.clientMappings).register(builder).provides(name);
Service service = new FunctionalService<>(entry, Function.identity(), this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Aggregations