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.

  • Field Details

    • concurrency

      protected int concurrency
    • queueSize

      protected int queueSize
    • threadPoolAlias

      protected String threadPoolAlias
  • Method Details

    • newBatchedWriteBehindConfiguration

      public static WriteBehindConfigurationBuilder.BatchedWriteBehindConfigurationBuilder newBatchedWriteBehindConfiguration(long maxDelay, TimeUnit maxDelayUnit, int batchSize)
      Creates a new builder for WriteBehindConfiguration that supports batching.
      Parameters:
      maxDelay - the max delay for a batch
      maxDelayUnit - the max delay unit
      batchSize - the batch size
      Returns:
      a new builder
    • newUnBatchedWriteBehindConfiguration

      public static WriteBehindConfigurationBuilder.UnBatchedWriteBehindConfigurationBuilder newUnBatchedWriteBehindConfiguration()
      Creates a new builder for WriteBehindConfiguration without batching support.
      Returns:
      a new builder
    • queueSize

      public abstract WriteBehindConfigurationBuilder queueSize(int size)
      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

      public abstract WriteBehindConfigurationBuilder concurrencyLevel(int concurrency)
      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

      public abstract WriteBehindConfigurationBuilder useThreadPool(String alias)
      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: