Search in sources :

Example 21 with Service

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

the class InfinispanSSOManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurationConfigurator.build(target).install();
    this.cacheConfigurator.build(target).install();
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SSOManagerFactory<A, D, S, TransactionBatch>> factory = this.affinityFactory.register(builder).provides(this.getServiceName());
    this.cache = builder.requires(this.cacheConfigurator.getServiceName());
    Service service = Service.newInstance(factory, new InfinispanSSOManagerFactory<>(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 22 with Service

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

the class DistributableCacheFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurator.build(target).install();
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = target.addService(name);
    Consumer<CacheFactory<K, V>> factory = new CompositeDependency(this.factory, this.tsr).register(builder).provides(name);
    Service service = Service.newInstance(factory, this);
    return builder.setInstance(service);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) CacheFactory(org.jboss.as.ejb3.cache.CacheFactory)

Example 23 with Service

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

the class SimpleCacheFactoryBuilderServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = target.addService(name);
    Consumer<CacheFactoryBuilder<K, V>> cacheFactoryBuilder = builder.provides(name);
    Service service = Service.newInstance(cacheFactoryBuilder, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Service(org.jboss.msc.Service) CacheFactoryBuilder(org.jboss.as.ejb3.cache.CacheFactoryBuilder)

Example 24 with Service

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

the class BroadcastCommandDispatcherFactoryInstaller method accept.

@Override
public void accept(OperationContext context, String channelName) {
    ServiceName name = MessagingServices.getBroadcastCommandDispatcherFactoryServiceName(channelName);
    // N.B. BroadcastCommandDispatcherFactory implementations are shared across multiple server resources
    if (this.names.add(name)) {
        ServiceBuilder<?> builder = context.getServiceTarget().addService(name);
        Consumer<BroadcastCommandDispatcherFactory> injector = builder.provides(name);
        Supplier<CommandDispatcherFactory> factory = builder.requires(ClusteringRequirement.COMMAND_DISPATCHER_FACTORY.getServiceName(context, channelName));
        Service service = new FunctionalService<>(injector, ConcurrentBroadcastCommandDispatcherFactory::new, factory);
        builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND).install();
    }
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) ServiceName(org.jboss.msc.service.ServiceName) CommandDispatcherFactory(org.wildfly.clustering.spi.dispatcher.CommandDispatcherFactory) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 25 with Service

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

the class ContainerEventHandlerServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    Consumer<ModClusterService> modClusterService = this.configuration.register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(modClusterService, Function.identity(), this, this);
    return builder.setInstance(service);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) ModClusterService(org.jboss.modcluster.ModClusterService) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) ModClusterService(org.jboss.modcluster.ModClusterService) 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