Search in sources :

Example 1 with SessionManagerFactory

use of org.wildfly.clustering.web.session.SessionManagerFactory in project wildfly by wildfly.

the class HotRodSessionManagerFactoryServiceConfigurator method build.

@Override
public ServiceBuilder<?> build(ServiceTarget target) {
    this.cacheConfigurator.build(target).install();
    ServiceBuilder<?> builder = target.addService(this.getServiceName());
    Consumer<SessionManagerFactory<SC, LC, TransactionBatch>> factory = this.cache.register(builder).provides(this.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) FunctionalService(org.wildfly.clustering.service.FunctionalService) Service(org.jboss.msc.Service)

Example 2 with SessionManagerFactory

use of org.wildfly.clustering.web.session.SessionManagerFactory 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

Service (org.jboss.msc.Service)2 FunctionalService (org.wildfly.clustering.service.FunctionalService)2 SessionManagerFactory (org.wildfly.clustering.web.session.SessionManagerFactory)2 CapabilityServiceConfigurator (org.jboss.as.clustering.controller.CapabilityServiceConfigurator)1 CacheServiceConfigurator (org.wildfly.clustering.infinispan.spi.service.CacheServiceConfigurator)1 TemplateConfigurationServiceConfigurator (org.wildfly.clustering.infinispan.spi.service.TemplateConfigurationServiceConfigurator)1 CompositeDependency (org.wildfly.clustering.service.CompositeDependency)1 ServiceConfigurator (org.wildfly.clustering.service.ServiceConfigurator)1