use of org.jboss.msc.Service in project wildfly by wildfly.
the class GlobalConfigurationServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<GlobalConfiguration> global = new CompositeDependency(this.loader, this.modules, this.transport, this.server).register(builder).provides(this.getServiceName());
for (Dependency dependency : this.pools.values()) {
dependency.register(builder);
}
for (Dependency dependency : this.scheduledPools.values()) {
dependency.register(builder);
}
Service service = new FunctionalService<>(global, Function.identity(), this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class ComponentServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<C> component = this.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(component, Function.identity(), this);
return builder.setInstance(service).setInitialMode(this.initialMode);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class InfinispanBeanManagerFactoryServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
new CompositeDependency(this.cache, this.affinityFactory, this.repository, this.group, this.dispatcherFactory).register(builder);
Consumer<BeanManagerFactory<I, T, TransactionBatch>> factory = builder.provides(this.getServiceName());
Service service = Service.newInstance(factory, new InfinispanBeanManagerFactory<>(this));
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class RemoteCacheServiceConfigurator method build.
@Override
public final ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
Consumer<RemoteCache<K, V>> cache = this.container.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(cache, Function.identity(), this, this);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
use of org.jboss.msc.Service in project wildfly by wildfly.
the class IdentityCapabilityServiceConfigurator method build.
@Override
public ServiceBuilder<?> build(ServiceTarget target) {
ServiceBuilder<?> builder = target.addService(this.getServiceName());
Consumer<T> consumer = this.requirement.register(builder).provides(this.getServiceName());
Service service = new FunctionalService<>(consumer, Function.identity(), this.requirement);
return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Aggregations