Package org.ehcache.config.builders
Class WriteBehindConfigurationBuilder
java.lang.Object
org.ehcache.config.builders.WriteBehindConfigurationBuilder
- All Implemented Interfaces:
org.ehcache.config.Builder<org.ehcache.spi.loaderwriter.WriteBehindConfiguration<?>>
- Direct Known Subclasses:
WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder,WriteBehindConfigurationBuilder.UnBatchedWriteBehindConfigurationBuilder
public abstract class WriteBehindConfigurationBuilder
extends Object
implements org.ehcache.config.Builder<org.ehcache.spi.loaderwriter.WriteBehindConfiguration<?>>
The
WriteBehindConfigurationBuilder enables building WriteBehindConfigurations 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSpecializedWriteBehindConfigurationBuilderforWriteBehindConfigurations that supports batchingstatic classSpecializedWriteBehindConfigurationBuilderforWriteBehindConfigurations without batching support -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionabstract WriteBehindConfigurationBuilderconcurrencyLevel(int concurrency) Sets the concurrency level on the returned builder.newBatchedWriteBehindConfiguration(long maxDelay, TimeUnit maxDelayUnit, int batchSize) Creates a new builder forWriteBehindConfigurationthat supports batching.Creates a new builder forWriteBehindConfigurationwithout batching support.abstract WriteBehindConfigurationBuilderqueueSize(int size) Sets the batch queue size on the returned builder.abstract WriteBehindConfigurationBuilderuseThreadPool(String alias) Sets the thread pool to use for write behind on the returned builder.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ehcache.config.Builder
build
-
Field Details
-
concurrency
protected int concurrency -
queueSize
protected int queueSize -
threadPoolAlias
-
-
Method Details
-
newBatchedWriteBehindConfiguration
public static WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder newBatchedWriteBehindConfiguration(long maxDelay, TimeUnit maxDelayUnit, int batchSize) Creates a new builder forWriteBehindConfigurationthat supports batching.- Parameters:
maxDelay- the max delay for a batchmaxDelayUnit- the max delay unitbatchSize- the batch size- Returns:
- a new builder
-
newUnBatchedWriteBehindConfiguration
public static WriteBehindConfigurationBuilder.UnBatchedWriteBehindConfigurationBuilder newUnBatchedWriteBehindConfiguration()Creates a new builder forWriteBehindConfigurationwithout batching support.- Returns:
- a new builder
-
queueSize
Sets the batch queue size on the returned builder.Default queue size is
Integer.MAX_VALUE.- Parameters:
size- the new queue size- Returns:
- a new builder with updated queue size
-
concurrencyLevel
Sets the concurrency level on the returned builder.Default concurrency is
1.- Parameters:
concurrency- the concurrency level- Returns:
- a new builder with the new concurrency level
-
useThreadPool
Sets the thread pool to use for write behind on the returned builder.- Parameters:
alias- the thread pool alias- Returns:
- a new builer with the configured thread pool alias
- See Also:
-