Search in sources :

Example 1 with CachedThreadPoolExecutorServiceBuilder

use of org.wildfly.clustering.service.concurrent.CachedThreadPoolExecutorServiceBuilder in project wildfly by wildfly.

the class InfinispanBeanManagerFactoryBuilderFactory method getDeploymentBuilders.

@Override
public Collection<CapabilityServiceBuilder<?>> getDeploymentBuilders(final ServiceName name) {
    String cacheName = getCacheName(name);
    String containerName = this.config.getContainerName();
    String templateCacheName = this.config.getCacheName();
    List<CapabilityServiceBuilder<?>> builders = new ArrayList<>(4);
    builders.add(new TemplateConfigurationBuilder(ServiceName.parse(InfinispanCacheRequirement.CONFIGURATION.resolve(containerName, cacheName)), containerName, cacheName, templateCacheName));
    builders.add(new CacheBuilder<Object, Object>(ServiceName.parse(InfinispanCacheRequirement.CACHE.resolve(containerName, cacheName)), containerName, cacheName) {

        @Override
        public ServiceBuilder<Cache<Object, Object>> build(ServiceTarget target) {
            return super.build(target).addDependency(name.append("marshalling"));
        }
    });
    builders.add(new BuilderAdapter<>(new RemoveOnCancelScheduledExecutorServiceBuilder(name.append(this.name, "expiration"), EXPIRATION_THREAD_FACTORY)));
    builders.add(new BuilderAdapter<>(new CachedThreadPoolExecutorServiceBuilder(name.append(this.name, "eviction"), EVICTION_THREAD_FACTORY)));
    return builders;
}
Also used : ServiceTarget(org.jboss.msc.service.ServiceTarget) CachedThreadPoolExecutorServiceBuilder(org.wildfly.clustering.service.concurrent.CachedThreadPoolExecutorServiceBuilder) ArrayList(java.util.ArrayList) CapabilityServiceBuilder(org.jboss.as.clustering.controller.CapabilityServiceBuilder) RemoveOnCancelScheduledExecutorServiceBuilder(org.wildfly.clustering.service.concurrent.RemoveOnCancelScheduledExecutorServiceBuilder) ServiceBuilder(org.jboss.msc.service.ServiceBuilder) CachedThreadPoolExecutorServiceBuilder(org.wildfly.clustering.service.concurrent.CachedThreadPoolExecutorServiceBuilder) CapabilityServiceBuilder(org.jboss.as.clustering.controller.CapabilityServiceBuilder) RemoveOnCancelScheduledExecutorServiceBuilder(org.wildfly.clustering.service.concurrent.RemoveOnCancelScheduledExecutorServiceBuilder) TemplateConfigurationBuilder(org.wildfly.clustering.infinispan.spi.service.TemplateConfigurationBuilder)

Aggregations

ArrayList (java.util.ArrayList)1 CapabilityServiceBuilder (org.jboss.as.clustering.controller.CapabilityServiceBuilder)1 ServiceBuilder (org.jboss.msc.service.ServiceBuilder)1 ServiceTarget (org.jboss.msc.service.ServiceTarget)1 TemplateConfigurationBuilder (org.wildfly.clustering.infinispan.spi.service.TemplateConfigurationBuilder)1 CachedThreadPoolExecutorServiceBuilder (org.wildfly.clustering.service.concurrent.CachedThreadPoolExecutorServiceBuilder)1 RemoveOnCancelScheduledExecutorServiceBuilder (org.wildfly.clustering.service.concurrent.RemoveOnCancelScheduledExecutorServiceBuilder)1