Search in sources :

Example 26 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.

the class RemoteCacheContainerConfigurationServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<Configuration> configuration = new CompositeDependency(this.loader, this.modules, this.connectionPool, this.security, this.server).register(builder).provides(this.getServiceName());
    for (Dependency dependency : this.threadPools.values()) {
        dependency.register(builder);
    }
    for (List<SupplierDependency<OutboundSocketBinding>> dependencies : this.clusters.values()) {
        for (Dependency dependency : dependencies) {
            dependency.register(builder);
        }
    }
    Service service = new FunctionalService<>(configuration, Function.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : SecurityConfiguration(org.infinispan.client.hotrod.configuration.SecurityConfiguration) ExecutorFactoryConfiguration(org.infinispan.client.hotrod.configuration.ExecutorFactoryConfiguration) ConnectionPoolConfiguration(org.infinispan.client.hotrod.configuration.ConnectionPoolConfiguration) Configuration(org.infinispan.client.hotrod.configuration.Configuration) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) FunctionalService(org.wildfly.clustering.service.FunctionalService) 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) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency)

Example 27 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.

the class ElectionPolicyServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SingletonElectionPolicy> policy = builder.provides(this.getServiceName());
    for (Dependency dependency : this.dependencies) {
        dependency.register(builder);
    }
    Service service = new FunctionalService<>(policy, this, this);
    return builder.setInstance(service);
}
Also used : SingletonElectionPolicy(org.wildfly.clustering.singleton.SingletonElectionPolicy) PreferredSingletonElectionPolicy(org.wildfly.clustering.singleton.election.PreferredSingletonElectionPolicy) FunctionalService(org.wildfly.clustering.service.FunctionalService) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) SupplierDependency(org.wildfly.clustering.service.SupplierDependency) ServiceSupplierDependency(org.wildfly.clustering.service.ServiceSupplierDependency) Dependency(org.wildfly.clustering.service.Dependency)

Example 28 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.

the class LocalRouteServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<String> route = this.route.register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(route, Function.identity(), this.route);
    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 29 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.

the class InfinispanSessionManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurationConfigurator.build(target).install();
    this.cacheConfigurator.build(target).install();
    for (ServiceConfigurator configurator : this.configurators) {
        configurator.build(target).install();
    }
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SessionManagerFactory<SC, LC, TransactionBatch>> factory = new CompositeDependency(this.group, this.affinityFactory, this.dispatcherFactory).register(builder).provides(this.getServiceName());
    this.cache = builder.requires(this.cacheConfigurator.getServiceName());
    Service service = new FunctionalService<>(factory, Function.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) SessionManagerFactory(org.wildfly.clustering.web.session.SessionManagerFactory) Service(org.jboss.msc.Service) FunctionalService(org.wildfly.clustering.service.FunctionalService) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) ServiceConfigurator(org.wildfly.clustering.service.ServiceConfigurator) TemplateConfigurationServiceConfigurator(org.wildfly.clustering.infinispan.spi.service.TemplateConfigurationServiceConfigurator) CacheServiceConfigurator(org.wildfly.clustering.infinispan.spi.service.CacheServiceConfigurator) CapabilityServiceConfigurator(org.jboss.as.clustering.controller.CapabilityServiceConfigurator)

Example 30 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService in project wildfly by wildfly.

the class PrimaryOwnerRouteLocatorServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(name).build(target);
    Consumer<RouteLocator> locator = new CompositeDependency(this.registry, this.cache, this.factory).register(builder).provides(name);
    Service service = new FunctionalService<>(locator, Function.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : RouteLocator(org.wildfly.clustering.web.routing.RouteLocator) FunctionalService(org.wildfly.clustering.service.FunctionalService) ServiceName(org.jboss.msc.service.ServiceName) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Aggregations

Service (org.jboss.msc.Service)46 FunctionalService (org.wildfly.clustering.service.FunctionalService)46 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)20 ServiceName (org.jboss.msc.service.ServiceName)12 AsyncServiceConfigurator (org.wildfly.clustering.service.AsyncServiceConfigurator)12 Dependency (org.wildfly.clustering.service.Dependency)5 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)5 SupplierDependency (org.wildfly.clustering.service.SupplierDependency)5 Group (org.wildfly.clustering.group.Group)3 RouteLocator (org.wildfly.clustering.web.routing.RouteLocator)3 ClientMapping (org.jboss.as.network.ClientMapping)2 SessionIdentifierCodec (org.jboss.as.web.session.SessionIdentifierCodec)2 ModClusterService (org.jboss.modcluster.ModClusterService)2 ServiceProviderRegistry (org.wildfly.clustering.provider.ServiceProviderRegistry)2 CommandDispatcherFactory (org.wildfly.clustering.spi.dispatcher.CommandDispatcherFactory)2 SessionManagerFactory (org.wildfly.clustering.web.session.SessionManagerFactory)2 SessionManagerFactory (io.undertow.servlet.api.SessionManagerFactory)1 ExecutorService (java.util.concurrent.ExecutorService)1 OpenAPI (org.eclipse.microprofile.openapi.models.OpenAPI)1 Cache (org.infinispan.Cache)1