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);
}
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);
}
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);
}
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();
}
}
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);
}
Aggregations