Search in sources :

Example 16 with CompositeDependency

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

the class JChannelFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<ChannelFactory> factory = new CompositeDependency(this.transport, this.relay, this.socketBindingManager).register(builder).provides(this.getServiceName());
    this.environment = builder.requires(ServerEnvironmentService.SERVICE_NAME);
    for (Dependency dependency : this.protocols) {
        dependency.register(builder);
    }
    Service service = Service.newInstance(factory, new JChannelFactory(this));
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.ON_DEMAND);
}
Also used : ServerEnvironmentService(org.jboss.as.server.ServerEnvironmentService) Service(org.jboss.msc.Service) JChannelFactory(org.jboss.as.clustering.jgroups.JChannelFactory) 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) JChannelFactory(org.jboss.as.clustering.jgroups.JChannelFactory) ChannelFactory(org.wildfly.clustering.jgroups.spi.ChannelFactory)

Example 17 with CompositeDependency

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

the class SingletonPolicyServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SingletonPolicy> policy = new CompositeDependency(this.policy, this.factory).register(builder).provides(this.getServiceName());
    Service service = Service.newInstance(policy, this);
    return builder.setInstance(service).setInitialMode(ServiceController.Mode.PASSIVE);
}
Also used : SingletonPolicy(org.wildfly.clustering.singleton.SingletonPolicy) Service(org.jboss.msc.Service) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 18 with CompositeDependency

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

the class DistributedSingletonServiceBuilder method build.

@Override
public ServiceBuilder<T> build(ServiceTarget target) {
    SingletonService<T> service = new LegacyDistributedSingletonService<>(this, this.primaryService, this.backupService);
    ServiceBuilder<T> installer = new AsynchronousServiceBuilder<>(this.getServiceName(), service).build(target);
    return new CompositeDependency(this.registry, this.dispatcherFactory).register(installer);
}
Also used : CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 19 with CompositeDependency

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

the class DistributedSingletonServiceConfigurator method build.

@Override
public SingletonServiceBuilder<?> build(ServiceTarget target) {
    ServiceName name = this.getServiceName().append("singleton");
    ServiceBuilder<?> builder = new AsyncServiceConfigurator(name).build(target);
    Consumer<Singleton> singleton = builder.provides(name);
    return new DistributedSingletonServiceBuilder<>(this, new CompositeDependency(this.registry, this.dispatcherFactory).register(builder), singleton);
}
Also used : ServiceName(org.jboss.msc.service.ServiceName) Singleton(org.wildfly.clustering.singleton.Singleton) AsyncServiceConfigurator(org.wildfly.clustering.service.AsyncServiceConfigurator) CompositeDependency(org.wildfly.clustering.service.CompositeDependency)

Example 20 with CompositeDependency

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

Aggregations

CompositeDependency (org.wildfly.clustering.service.CompositeDependency)29 Service (org.jboss.msc.Service)26 FunctionalService (org.wildfly.clustering.service.FunctionalService)20 AsyncServiceConfigurator (org.wildfly.clustering.service.AsyncServiceConfigurator)10 ServiceName (org.jboss.msc.service.ServiceName)8 Dependency (org.wildfly.clustering.service.Dependency)5 ServiceSupplierDependency (org.wildfly.clustering.service.ServiceSupplierDependency)5 SupplierDependency (org.wildfly.clustering.service.SupplierDependency)5 ClientMapping (org.jboss.as.network.ClientMapping)2 ChannelFactory (org.wildfly.clustering.jgroups.spi.ChannelFactory)2 UndertowService (org.wildfly.extension.undertow.UndertowService)2 ExecutorService (java.util.concurrent.ExecutorService)1 OpenAPI (org.eclipse.microprofile.openapi.models.OpenAPI)1 Cache (org.infinispan.Cache)1 Configuration (org.infinispan.client.hotrod.configuration.Configuration)1 ConnectionPoolConfiguration (org.infinispan.client.hotrod.configuration.ConnectionPoolConfiguration)1 ExecutorFactoryConfiguration (org.infinispan.client.hotrod.configuration.ExecutorFactoryConfiguration)1 SecurityConfiguration (org.infinispan.client.hotrod.configuration.SecurityConfiguration)1 Configuration (org.infinispan.configuration.cache.Configuration)1 GlobalConfiguration (org.infinispan.configuration.global.GlobalConfiguration)1