Class PooledExecutionServiceConfigurationBuilder

java.lang.Object
org.ehcache.config.builders.PooledExecutionServiceConfigurationBuilder
All Implemented Interfaces:
org.ehcache.config.Builder<org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration>

public class PooledExecutionServiceConfigurationBuilder extends Object implements org.ehcache.config.Builder<org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration>
The PooledExecutionServiceConfigurationBuilder enables building configurations for an ExecutionService that is pool based using a fluent style.

As with all Ehcache builders, all instances are immutable and calling any method on the builder will return a new instance without modifying the one on which the method was called. This enables the sharing of builder instances without any risk of seeing them modified by code elsewhere.

  • Method Details

    • newPooledExecutionServiceConfigurationBuilder

      public static PooledExecutionServiceConfigurationBuilder newPooledExecutionServiceConfigurationBuilder()
      Creates a new instance of PooledExecutionServiceConfigurationBuilder
      Returns:
      the builder
    • newPooledExecutionServiceConfigurationBuilder

      public static PooledExecutionServiceConfigurationBuilder newPooledExecutionServiceConfigurationBuilder(org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration seed)
      Creates a seeded instance of PooledExecutionServiceConfigurationBuilder
      Returns:
      the builder
    • defaultPool

      public PooledExecutionServiceConfigurationBuilder defaultPool(String alias, int minSize, int maxSize)
      Adds a default pool configuration to the returned builder.
      Parameters:
      alias - the pool alias
      minSize - the minimum number of threads in the pool
      maxSize - the maximum number of threads in the pool
      Returns:
      a new builder with the added default pool
    • pool

      public PooledExecutionServiceConfigurationBuilder pool(String alias, int minSize, int maxSize)
      Adds a pool configuration to the returned builder.
      Parameters:
      alias - the pool alias
      minSize - the minimum number of threads in the pool
      maxSize - the maximum number of threads in the pool
      Returns:
      a new builder with the added default pool
    • build

      public org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration build()
      Builds the PooledExecutionServiceConfiguration
      Specified by:
      build in interface org.ehcache.config.Builder<org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration>
      Returns:
      the built configuration