Search in sources :

Example 16 with Service

use of org.jboss.msc.Service in project wildfly by wildfly.

the class ChannelCommandDispatcherFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    this.loader = builder.requires(Services.JBOSS_SERVICE_MODULE_LOADER);
    Consumer<CommandDispatcherFactory> factory = new CompositeDependency(this.channel, this.channelFactory, this.module).register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(factory, Functions.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) CommandDispatcherFactory(org.wildfly.clustering.dispatcher.CommandDispatcherFactory) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 17 with Service

use of org.jboss.msc.Service in project wildfly by wildfly.

the class HotRodSSOManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurator.build(target).install();
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SSOManagerFactory<A, D, S, TransactionBatch>> factory = this.cache.register(builder).provides(this.getServiceName());
    Service service = Service.newInstance(factory, new HotRodSSOManagerFactory<>(this));
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : Service(org.jboss.msc.Service) SSOManagerFactory(org.wildfly.clustering.web.sso.SSOManagerFactory)

Example 18 with Service

use of org.jboss.msc.Service in project wildfly by wildfly.

the class UndertowEventHandlerAdapterServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    new CompositeDependency(this.service, this.listener, this.suspendController).register(builder);
    this.eventHandler = builder.requires(ProxyConfigurationResourceDefinition.Capability.SERVICE.getDefinition().getCapabilityServiceName(proxyName));
    Service service = new UndertowEventHandlerAdapterService(this);
    return builder.setInstance(service);
}
Also used : AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) Service(org.jboss.msc.Service) UndertowService(org.wildfly.extension.undertow.UndertowService) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 19 with Service

use of org.jboss.msc.Service in project wildfly by wildfly.

the class LocalCommandDispatcherFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<CommandDispatcherFactory> factory = this.group.register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(factory, Functions.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) CommandDispatcherFactory(org.wildfly.clustering.spi.dispatcher.CommandDispatcherFactory) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 20 with Service

use of org.jboss.msc.Service in project wildfly by wildfly.

the class DistributableSessionManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurator.build(target).install();
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Supplier<org.wildfly.clustering.web.session.SessionManagerFactory<ServletContext, Map<String, Object>, Batch>> impl = builder.requires(this.configurator.getServiceName());
    Consumer<SessionManagerFactory> factory = builder.provides(this.getServiceName());
    Service service = new FunctionalService<>(factory, this, impl);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) SessionManagerFactory(io.undertow.servlet.api.SessionManagerFactory) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Aggregations

Service (org.jboss.msc.Service)76 FunctionalService (org.wildfly.clustering.service.FunctionalService)46 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)26 ServiceName (org.jboss.msc.service.ServiceName)23 AsyncServiceConfigurator (org.wildfly.clustering.service.AsyncServiceConfigurator)13 Dependency (org.wildfly.clustering.service.Dependency)7 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)7 SupplierDependency (org.wildfly.clustering.service.SupplierDependency)7 StartContext (org.jboss.msc.service.StartContext)4 ExecutorService (java.util.concurrent.ExecutorService)3 CapabilityServiceSupport (org.jboss.as.controller.capability.CapabilityServiceSupport)3 ServerEnvironmentService (org.jboss.as.server.ServerEnvironmentService)3 DeploymentUnit (org.jboss.as.server.deployment.DeploymentUnit)3 ServiceTarget (org.jboss.msc.service.ServiceTarget)3 StopContext (org.jboss.msc.service.StopContext)3 RouteLocator (org.wildfly.clustering.web.routing.RouteLocator)3 Supplier (java.util.function.Supplier)2 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)2 ComponentDescription (org.jboss.as.ee.component.ComponentDescription)2 CacheFactoryBuilder (org.jboss.as.ejb3.cache.CacheFactoryBuilder)2