Search in sources :

Example 11 with FunctionalService

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

the class ChannelCommandDispatcherFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    this.loader = builder.requires(Services.JBOSS_SERVICE_MODULE_LOADER);
    Consumer<CommandDispatcherFactory> factory = new CompositeDependency(this.channel, this.channelFactory, this.module).register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(factory, Functions.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) CommandDispatcherFactory(org.wildfly.clustering.dispatcher.CommandDispatcherFactory) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 12 with FunctionalService

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

the class LocalCommandDispatcherFactoryServiceConfigurator method build.

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

Example 13 with FunctionalService

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

the class DistributableSessionManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.configurator.build(target).install();
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Supplier<org.wildfly.clustering.web.session.SessionManagerFactory<ServletContext, Map<String, Object>, Batch>> impl = builder.requires(this.configurator.getServiceName());
    Consumer<SessionManagerFactory> factory = builder.provides(this.getServiceName());
    Service service = new FunctionalService<>(factory, this, impl);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) SessionManagerFactory(io.undertow.servlet.api.SessionManagerFactory) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 14 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService 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 15 with FunctionalService

use of org.wildfly.clustering.service.FunctionalService 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)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