Search in sources :

Example 1 with AsyncServiceConfigurator

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

the class ProtocolDefaultsServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(SERVICE_NAME).build(target);
    Consumer<ProtocolDefaults> defaults = builder.provides(SERVICE_NAME);
    Service service = new FunctionalService<>(defaults, Function.identity(), this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) ProtocolDefaults(org.jboss.as.clustering.jgroups.ProtocolDefaults)

Example 2 with AsyncServiceConfigurator

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

the class RemoteCacheContainerServiceConfigurator method build.

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

Example 3 with AsyncServiceConfigurator

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

the class RemoteCacheServiceConfigurator method build.

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

Example 4 with AsyncServiceConfigurator

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

the class CacheGroupServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName();
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(name).build(target);
    Consumer<Group> group = new CompositeDependency(this.cache, this.factory).register(builder).provides(name);
    Service service = new FunctionalService<>(group, Functions.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : Group(org.wildfly.clustering.group.Group) 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)

Example 5 with AsyncServiceConfigurator

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

Aggregations

AsyncServiceConfigurator (org.wildfly.clustering.service.AsyncServiceConfigurator)14 Service (org.jboss.msc.Service)13 FunctionalService (org.wildfly.clustering.service.FunctionalService)12 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)10 ServiceName (org.jboss.msc.service.ServiceName)3 ExecutorService (java.util.concurrent.ExecutorService)1 Cache (org.infinispan.Cache)1 RemoteCache (org.infinispan.client.hotrod.RemoteCache)1 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)1 ProtocolDefaults (org.jboss.as.clustering.jgroups.ProtocolDefaults)1 ModClusterService (org.jboss.modcluster.ModClusterService)1 JChannel (org.jgroups.JChannel)1 CommandDispatcherFactory (org.wildfly.clustering.dispatcher.CommandDispatcherFactory)1 Group (org.wildfly.clustering.group.Group)1 RemoteCacheContainer (org.wildfly.clustering.infinispan.client.RemoteCacheContainer)1 ServiceProviderRegistry (org.wildfly.clustering.provider.ServiceProviderRegistry)1 Registry (org.wildfly.clustering.registry.Registry)1 Singleton (org.wildfly.clustering.singleton.Singleton)1 RouteLocator (org.wildfly.clustering.web.routing.RouteLocator)1 UndertowService (org.wildfly.extension.undertow.UndertowService)1