Package org.ehcache.config.builders
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 Summary
Modifier and TypeMethodDescriptionorg.ehcache.impl.config.executor.PooledExecutionServiceConfigurationbuild()Builds thePooledExecutionServiceConfigurationdefaultPool(String alias, int minSize, int maxSize) Adds a default pool configuration to the returned builder.Creates a new instance ofPooledExecutionServiceConfigurationBuildernewPooledExecutionServiceConfigurationBuilder(org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration seed) Creates a seeded instance ofPooledExecutionServiceConfigurationBuilderAdds a pool configuration to the returned builder.
-
Method Details
-
newPooledExecutionServiceConfigurationBuilder
public static PooledExecutionServiceConfigurationBuilder newPooledExecutionServiceConfigurationBuilder()Creates a new instance ofPooledExecutionServiceConfigurationBuilder- Returns:
- the builder
-
newPooledExecutionServiceConfigurationBuilder
public static PooledExecutionServiceConfigurationBuilder newPooledExecutionServiceConfigurationBuilder(org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration seed) Creates a seeded instance ofPooledExecutionServiceConfigurationBuilder- 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 aliasminSize- the minimum number of threads in the poolmaxSize- the maximum number of threads in the pool- Returns:
- a new builder with the added default pool
-
pool
Adds a pool configuration to the returned builder.- Parameters:
alias- the pool aliasminSize- the minimum number of threads in the poolmaxSize- 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 thePooledExecutionServiceConfiguration- Specified by:
buildin interfaceorg.ehcache.config.Builder<org.ehcache.impl.config.executor.PooledExecutionServiceConfiguration>- Returns:
- the built configuration
-