Search in sources :

Example 6 with Service

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);
}
Also used : GlobalConfiguration(org.infinispan.configuration.global.GlobalConfiguration) FunctionalService(org.wildfly.clustering.service.FunctionalService) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency) Dependency(org.wildfly.clustering.service.Dependency)

Example 7 with Service

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);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 8 with Service

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);
}
Also used : BeanManagerFactory(org.wildfly.clustering.ejb.BeanManagerFactory) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 9 with Service

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);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) RemoteCache(org.infinispan.client.hotrod.RemoteCache) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 10 with Service

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);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) 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