Search in sources :

Example 6 with AsyncServiceConfigurator

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

the class UndertowEventHandlerAdapterServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    new CompositeDependency(this.service, this.listener, this.suspendController).register(builder);
    this.eventHandler = builder.requires(ProxyConfigurationResourceDefinition.Capability.SERVICE.getDefinition().getCapabilityServiceName(proxyName));
    Service service = new UndertowEventHandlerAdapterService(this);
    return builder.setInstance(service);
}
Also used : AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) Service(org.jboss.msc.Service) UndertowService(org.wildfly.extension.undertow.UndertowService) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 7 with AsyncServiceConfigurator

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

Example 8 with AsyncServiceConfigurator

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

the class CacheServiceProviderRegistryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    Consumer<ServiceProviderRegistry<T>> registry = new CompositeDependency(this.cache, this.dispatcherFactory, this.group).register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(registry, Functions.identity(), this, Consumers.close());
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) ServiceProviderRegistry(org.wildfly.clustering.provider.ServiceProviderRegistry) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 9 with AsyncServiceConfigurator

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

the class RegistryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    Consumer<Registry<K, V>> registry = new CompositeDependency(this.factory, this.entry).register(builder).provides(this.getServiceName());
    Service service = new FunctionalService<>(registry, Function.identity(), this, Consumers.close());
    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) Registry(org.wildfly.clustering.registry.Registry) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 10 with AsyncServiceConfigurator

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

the class CacheContainerServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(this.getServiceName()).build(target);
    Consumer<EmbeddedCacheManager> container = new CompositeDependency(this.configuration).register(builder).provides(this.names);
    Service service = new FunctionalService<>(container, this, this, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Also used : FunctionalService(org.wildfly.clustering.service.FunctionalService) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) FunctionalService(org.wildfly.clustering.service.FunctionalService) ExecutorService(java.util.concurrent.ExecutorService) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

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