Search in sources :

Example 61 with Service

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

the class AbstractProtocolConfigurationServiceConfigurator method build.

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

Example 62 with Service

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

the class ChannelClusterServiceConfigurator method build.

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

Example 63 with Service

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

the class ConfigurationServiceConfigurator method build.

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

Example 64 with Service

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

the class CacheSingletonServiceConfiguratorFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SingletonServiceConfiguratorFactory> factory = builder.provides(this.getServiceName());
    @SuppressWarnings("deprecation") Service service = Service.newInstance(factory, new DistributedSingletonServiceBuilderFactory(this));
    return builder.setInstance(service);
}
Also used : Service(org.jboss.msc.Service) SingletonServiceConfiguratorFactory(org.wildfly.clustering.singleton.service.SingletonServiceConfiguratorFactory)

Example 65 with Service

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

the class AbstractLocalGroupServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    this.environment = builder.requires(ServerEnvironmentService.SERVICE_NAME);
    Consumer<Group> group = builder.provides(this.getServiceName());
    Service service = new FunctionalService<>(group, this, this.environment);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : Group(org.wildfly.clustering.group.Group) FunctionalService(org.wildfly.clustering.service.FunctionalService) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) ServerEnvironmentService(org.jboss.as.server.ServerEnvironmentService)

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