Search in sources :

Example 1 with Service

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

the class ProtocolDefaultsServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(SERVICE_NAME).build(target);
    Consumer<ProtocolDefaults> defaults = builder.provides(SERVICE_NAME);
    Service service = new FunctionalService<>(defaults, Function.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) ProtocolDefaults(org.jboss.as.clustering.jgroups.ProtocolDefaults)

Example 2 with Service

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

the class RemoteSiteConfigurationServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<RemoteSiteConfiguration> configuration = new CompositeDependency(this.cluster, this.factory).register(builder).provides(this.getServiceName());
    Service service = Service.newInstance(configuration, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : RemoteSiteConfiguration(org.wildfly.clustering.jgroups.spi.RemoteSiteConfiguration) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 3 with Service

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

the class ThreadPoolFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<ThreadPoolFactory> factory = builder.provides(this.getServiceName());
    Service service = Service.newInstance(factory, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : Service(org.jboss.msc.Service)

Example 4 with Service

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

the class RemoteCacheContainerServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    Consumer<RemoteCacheContainer> container = this.configuration.register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(container, this, this, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : RemoteCacheContainer(org.wildfly.clustering.infinispan.client.RemoteCacheContainer) FunctionalService(org.wildfly.clustering.service.FunctionalService) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 5 with Service

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

the class XAResourceRecoveryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<XAResourceRecovery> recovery = builder.provides(this.getServiceName());
    new CompositeDependency(this.cache, this.registry).register(builder);
    Service service = new FunctionalService<>(recovery, Function.identity(), this, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) InfinispanXAResourceRecovery(org.jboss.as.clustering.infinispan.InfinispanXAResourceRecovery) XAResourceRecovery(org.jboss.tm.XAResourceRecovery) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

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