Cache in Ehcache 2.0 and above is to create a CacheConfiguration object
and pass it to the Cache constructor. See net.sf.ehcache.Cache#Cache(CacheConfiguration) .
This class supports setter injection and also the fluent builder pattern.
e.g.
Cache cache = new Cache(new CacheConfiguration("test2", 1000).eternal(true).memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy.FIFO));
Rather than proliferation of new constructors as new versions of Ehcache come out, it intended to add the new configuration to this class.
Another way to set configuration is declaratively in the ehcache.xml configuration file.
e.g.
<cache name="testCache1"
maxEntriesLocalHeap="10000"
eternal="false"
timeToIdleSeconds="3600"
timeToLiveSeconds="10"
overflowToDisk="true"
diskPersistent="true"
diskExpiryThreadIntervalSeconds="120"
maxEntriesLocalDisk="10000"
/>
Users should also take care of synchronizing threads externally, if a CacheConfiguration instance is going to be mutated by multiple threads concurrently. While CacheConfiguration instances will make changes properly visible to all threads, logic within individual methods (e.g. validation) isn't trying to provide any "thread safeness".
| Modifier and Type | Class and Description |
|---|---|
| public static class | CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration
Configuration for the BootstrapCacheLoaderFactoryConfiguration. |
| public static class | CacheConfiguration.CacheDecoratorFactoryConfiguration
Configuration for the CacheDecoratorFactoryConfiguration. |
| public static class | CacheConfiguration.CacheEventListenerFactoryConfiguration
Configuration for the CacheEventListenerFactory. |
| public static class | CacheConfiguration.CacheExceptionHandlerFactoryConfiguration
Configuration for the BootstrapCacheLoaderFactoryConfiguration. |
| public static class | CacheConfiguration.CacheExtensionFactoryConfiguration
Configuration for the CacheExtensionFactoryConfiguration. |
| public static class | CacheConfiguration.CacheLoaderFactoryConfiguration
Configuration for the CacheLoaderFactoryConfiguration. |
| private class | CacheConfiguration.DefaultCacheConfigurationListener
Default listener class which handles the size changes of the cache |
| private static enum | CacheConfiguration.PoolUsage
An enum to identify what pool a resource uses |
| public static enum | CacheConfiguration.TransactionalMode
Represents whether the Cache is transactional or not. |
| Modifier and Type | Field and Description |
|---|---|
| protected CacheConfiguration. | bootstrapCacheLoaderFactoryConfiguration
The BootstrapCacheLoaderFactoryConfiguration. |
| protected volatile List | cacheDecoratorConfigurations
The cache decorator factories added by BeanUtils. |
| protected volatile List | cacheEventListenerConfigurations
The event listener factories added by BeanUtils. |
| protected CacheConfiguration. | cacheExceptionHandlerFactoryConfiguration
The CacheExceptionHandlerFactoryConfiguration. |
| protected volatile List | cacheExtensionConfigurations
The cache extension factories added by BeanUtils. |
| protected volatile List | cacheLoaderConfigurations
The cache loader factories added by BeanUtils. |
| protected volatile long | cacheLoaderTimeoutMillis
Timeout in milliseconds for CacheLoader related calls |
| protected CacheWriterConfiguration | cacheWriterConfiguration
The CacheWriterConfiguration. |
| private volatile ClassLoader | |
| protected volatile boolean | clearOnFlush
Sets whether the MemoryStore should be cleared when
|
| private volatile boolean | |
| private volatile Boolean | |
| private volatile Boolean | |
| private volatile CopyStrategyConfiguration | |
| public static final CacheWriterConfiguration | DEFAULT_CACHE_WRITER_CONFIGURATION
The default cacheWriterConfiguration |
| public static final boolean | DEFAULT_CLEAR_ON_FLUSH
Default value for clearOnFlush |
| public static final boolean | DEFAULT_COPY_ON_READ
Default value for copyOnRead |
| public static final boolean | DEFAULT_COPY_ON_WRITE
Default value for copyOnRead |
| public static final CopyStrategyConfiguration | DEFAULT_COPY_STRATEGY_CONFIGURATION
Default copyStrategyConfiguration |
| public static final int | DEFAULT_DISK_ACCESS_STRIPES
Default number of diskAccessStripes. |
| public static final boolean | DEFAULT_DISK_PERSISTENT
Default value for diskPersistent |
| public static final boolean | DEFAULT_ETERNAL_VALUE
Default eternal value |
| public static final long | DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS
The default interval between runs of the expiry thread. |
| public static final boolean | DEFAULT_LOGGING
Logging is off by default. |
| public static final long | DEFAULT_MAX_BYTES_OFF_HEAP
Default maxBytesOffHeap value |
| public static final long | DEFAULT_MAX_BYTES_ON_DISK
Default maxBytesOnDisk value |
| public static final long | DEFAULT_MAX_BYTES_ON_HEAP
Default maxBytesOnHeap value |
| public static final int | DEFAULT_MAX_ELEMENTS_ON_DISK
Default value for maxElementsOnDisk |
| public static final long | DEFAULT_MAX_ENTRIES_IN_CACHE
Default value for maxEntriesInCache |
| public static final MemoryStoreEvictionPolicy | DEFAULT_MEMORY_STORE_EVICTION_POLICY
The default memory store eviction policy is LRU. |
| public static final int | DEFAULT_SPOOL_BUFFER_SIZE
Set a buffer size for the spool of approx 30MB. |
| public static final boolean | DEFAULT_STATISTICS
Default value for statistics |
| public static final CacheConfiguration. | DEFAULT_TRANSACTIONAL_MODE
Default value for transactionalMode |
| public static final long | DEFAULT_TTI
Default value for tti |
| public static final long | DEFAULT_TTL
Default value for ttl |
| protected volatile int | diskAccessStripes
The number of concurrent disk access stripes. |
| protected volatile long | diskExpiryThreadIntervalSeconds
The interval in seconds between runs of the disk expiry thread. |
| protected volatile Boolean | diskPersistent
For caches that overflow to disk, whether the disk cache persists between CacheManager instances. |
| protected volatile int | diskSpoolBufferSizeMB
The size of the disk spool used to buffer writes |
| private volatile Set | |
| private volatile ElementValueComparatorConfiguration | |
| protected volatile boolean | eternal
Sets whether elements are eternal. |
| private DynamicAttributesExtractor | |
| private volatile boolean | |
| private static final int | |
| protected volatile Set | listeners
The listeners for this configuration. |
| private static final Logger | |
| protected volatile boolean | logging
Indicates whether logging is enabled or not. |
| private Long | |
| private volatile boolean | |
| private String | |
| private Integer | |
| private Long | |
| private String | |
| private Integer | |
| private Long | |
| private volatile boolean | |
| private String | |
| private Integer | |
| protected volatile int | maxElementsOnDisk
the maximum objects to be held in the |
| protected volatile long | maxEntriesInCache
the maximum entries to be held in the cache |
| private volatile boolean | |
| protected volatile Integer | maxEntriesLocalHeap
the maximum objects to be held in the |
| protected volatile MemoryStoreEvictionPolicy | memoryStoreEvictionPolicy
The policy used to evict elements from the |
| private static final int | |
| protected volatile String | name
the name of the cache. |
| private CacheConfiguration. | |
| private CacheConfiguration. | |
| private CacheConfiguration. | |
| protected volatile Boolean | overflowToDisk
whether elements can overflow to disk when the in-memory cache has reached the set limit. |
| protected volatile Boolean | overflowToOffHeap
whether elements can overflow to off heap memory when the in-memory cache has reached the set limit. |
| private volatile PersistenceConfiguration | |
| protected volatile PinningConfiguration | pinningConfiguration
The PinningConfiguration. |
| private volatile Searchable | |
| private volatile SizeOfPolicyConfiguration | |
| private volatile boolean | |
| protected TerracottaConfiguration | terracottaConfiguration
The TerracottaConfiguration. |
| protected volatile long | timeToIdleSeconds
the time to idle for an element before it expires. |
| protected volatile long | timeToLiveSeconds
Sets the time to idle for an element before it expires. |
| private volatile CacheConfiguration. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | CacheConfiguration(String
the name of the cache. Note that "default" is a reserved name for the defaultCache. name, int the maximum number of elements in memory, before they are evicted (0 == no limit) maxEntriesLocalHeap)Create a new cache configuration. |
| Modifier and Type | Method and Description |
|---|---|
| public final void | addBootstrapCacheLoaderFactory(CacheConfiguration.
Allows BeanHandler to add the CacheManagerEventListener to the configuration. |
| public final void | addCacheDecoratorFactory(CacheConfiguration.
Used by BeanUtils to add each cacheDecoratorFactory to the cache configuration. |
| public final void | addCacheEventListenerFactory(CacheConfiguration.
Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration. |
| public final void | addCacheExceptionHandlerFactory(CacheConfiguration.
Add the CacheExceptionHandlerFactory to the configuration. |
| public final void | addCacheExtensionFactory(CacheConfiguration.
Used by BeanUtils to add cacheExtensionFactory elements to the cache configuration. |
| public final void | addCacheLoaderFactory(CacheConfiguration.
Used by BeanUtils to add each cacheLoaderFactory to the cache configuration. |
| public final void | addCacheWriter(CacheWriterConfiguration cacheWriterConfiguration)
Allows BeanHandler to add the CacheWriterConfiguration to the configuration. |
| public boolean | Returns: true if a listener was addedlistener instance to add listener)Add a listener to this cache configuration |
| public void | addCopyStrategy(CopyStrategyConfiguration
the CopyStrategy Configuration copyStrategyConfiguration)Sets the CopyStrategyConfiguration for this cache |
| public boolean | Returns: true if a listener was addedAdd a dynamic extractor configuration listener |
| public void | addElementValueComparator(ElementValueComparatorConfiguration
the ElementComparator Configuration elementValueComparatorConfiguration)Sets the ElementValueComparatorConfiguration for this cache
The default configuration will setup a |
| public void | addPersistence(PersistenceConfiguration
the Persistence Configuration persistenceConfiguration)Sets the PersistenceConfiguration for this cache. |
| public final void | addPinning(PinningConfiguration pinningConfiguration)
Allows BeanHandler to add the PinningConfiguration to the configuration. |
| public final void | addSearchable(Searchable
search config to add searchable)Add configuration to make this cache searchable |
| public void | addSizeOfPolicy(SizeOfPolicyConfiguration
the SizeOfPolicy Configuration sizeOfPolicyConfiguration)Sets the SizeOfPolicyConfiguration for this cache. |
| public final void | addTerracotta(TerracottaConfiguration terracottaConfiguration)
Allows BeanHandler to add the TerracottaConfiguration to the configuration. |
| private void | |
| public final CacheConfiguration | Returns: this configuration instance
|
| public final CacheConfiguration | Returns: this configuration instance
|
| public final CacheConfiguration | Returns: this configuration instance
|
| public final CacheConfiguration | Returns: this configuration instance
|
| public final CacheConfiguration | Returns: this configuration instance
|
| public final CacheConfiguration | |
| private void | |
| private void | |
| public final CacheConfiguration | Returns: this configuration instancetrue to clear on flush clearOnFlush)Builder which sets whether the MemoryStore should be cleared when
|
| public CacheConfiguration | Returns: a copy, which independent other than configurations than cannot change.Overrides java. |
| private void | |
| private void | |
| private void | |
| private void | |
| pack-priv void | configCachePools(Configuration
the Configuration of the CacheManager managing this cache configuration)Configures the cache pools |
| private void | |
| public CacheConfiguration | |
| public CacheConfiguration | |
| public final CacheConfiguration | Returns: this configuration instanceBuilder which sets the number of disk stripes. |
| public final CacheConfiguration | Returns: this configuration instanceBuilder which sets the interval in seconds between runs of the disk expiry thread. |
| public final CacheConfiguration | Returns: this configuration instancewhether to persist the cache to disk between JVM restarts. diskPersistent)
Deprecated
The
Builder which sets whether the disk store persists between CacheManager instances.
diskPersistent attribute has been replaced with persistence(PersistenceConfiguration).
|
| public final CacheConfiguration | Returns: this configuration instancea positive number diskSpoolBufferSizeMB)Builder which sets the disk spool size, which is used to buffer writes to the DiskStore. |
| public CacheConfiguration | Returns: thisextractor to use extractor)Sets dynamic search attributes extractor |
| public final CacheConfiguration | Returns: this configuration instancetrue for eternal eternal)Builder which sets whether elements are eternal. |
| private void | |
| private void | fireDynamicAttributesExtractorAdded(DynamicAttributesExtractor oldValue, DynamicAttributesExtractor newValue)
|
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| public void | |
| private void | |
| public CacheConfiguration. | |
| public List | |
| public List | |
| public CacheConfiguration. | |
| public List | |
| public List | |
| public long | |
| public CacheWriterConfiguration | |
| public ClassLoader | |
| public ReadWriteCopyStrategy | Returns: theReadWriteCopyStrategy for instance for this cacheGetter to the configured ReadWriteCopyStrategy. |
| public CopyStrategyConfiguration | Returns: the copyStrategyConfigurationReturns the copyStrategyConfiguration |
| public int | |
| public long | |
| public int | |
| public DynamicAttributesExtractor | |
| public ElementValueComparatorConfiguration | Returns: the elementComparatorConfigurationReturns the elementComparatorConfiguration |
| public boolean | Returns: true if logging is enabled otherwise falseOnly used when cache is clustered with Terracotta |
| public long | Returns: value in bytes, 0 if none setThe maximum amount of bytes the cache should occupy on disk |
| public String | Returns: value as string in bytesThe string form of the maximum amount of bytes the cache should occupy on disk |
| public Integer | Returns: percentage (between 0 and 100)Getter for maximum bytes on disk expressed as a percentage |
| public long | Returns: value in bytes, 0 if none setThe maximum amount of bytes the cache should occupy on heap |
| public String | Returns: value as string in bytesThe string form of the maximum amount of bytes the cache should occupy on heap |
| public Integer | Returns: percentage (between 0 and 100)Getter for maximum bytes on heap expressed as a percentage |
| public long | Returns: value in bytes, 0 if none setThe maximum amount of bytes the cache should occupy off heap |
| public String | Returns: value as string in bytesThe string form of the maximum amount of bytes the cache should occupy off heap |
| public Integer | Returns: percentage (between 0 and 100)Getter for maximum bytes off heap expressed as a percentage |
| public int | |
| public int | getMaxElementsOnDisk()
Deprecated
use
Accessor
getMaxEntriesLocalDisk() for unclustered caches and getMaxEntriesInCache() for clustered caches.
|
| public long | |
| public long | |
| public long | |
| public String | Returns: the max memory of the offheap store for this cache.
Deprecated
See
Accessor
getMaxBytesLocalOffHeapAsString()
|
| public long | Returns: the max memory of the offheap store for this cache, in bytes.
Deprecated
Accessor
getMaxBytesLocalOffHeap()
|
| public MemoryStoreEvictionPolicy | |
| public String | |
| public PersistenceConfiguration | |
| public PinningConfiguration | |
| public Searchable | Returns: search config (may be null)Get the search configuration for this cache (if any) |
| public Map | Returns: search attributesGet the defined search attributes indexed by attribute name |
| public SizeOfPolicyConfiguration | |
| public final boolean | |
| public TerracottaConfiguration | |
| public TerracottaConfiguration. | |
| public long | |
| public long | |
| public final CacheConfiguration. | |
| public void | |
| public void | |
| public void | |
| public void | internalSetMaxBytesLocalOffheap(long maxBytesLocalOffheap)
Intended for internal use only, and subject to change. |
| public void | |
| public void | |
| public void | |
| public void | internalSetOverflowToOffheap(boolean overflowToOffHeap)
Intended for internal use only, and subject to change. |
| public void | |
| public void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | Returns: true if maxEntries set, false otherwiseWhether this cache is Count based |
| public boolean | isDiskPersistent()
Deprecated
The
Accessor
diskPersistent attribute has been replaced with persistence(PersistenceConfiguration).
|
| public boolean | |
| private boolean | |
| public boolean | |
| public boolean | Returns: true if transactionalMode="local"Helper method to compute whether the cache is local transactional or not |
| public boolean | Returns: true if set by user, false otherwiseChecks whether the user explicitly set the maxBytesOnDiskPercentage |
| public boolean | Returns: true if set by user, false otherwiseChecks whether the user explicitly set the maxBytesOnHeapPercentage |
| public boolean | Returns: true if set by user, false otherwiseChecks whether the user explicitly set the maxBytesOffHeapPercentage |
| public boolean | isOverflowToDisk()
Deprecated
The
Accessor
overflowToDisk attribute has been replaced with Strategy#LOCALTEMPSWAP.
|
| public boolean | |
| public boolean | Returns: true if explicitly set, false otherwiseChecks whether the overflowing to off heap behavior was explicitly set |
| private boolean | |
| public boolean | |
| public boolean | Returns: True if the <terracotta/> element exists withclustered="true"Helper method to compute whether the cache is clustered or not |
| public boolean | Returns: true if transactionalMode="xa_strict"Helper method to compute whether the cache is XA transactional or not |
| public boolean | Returns: true if transactionalMode="xa"Helper method to compute whether the cache is local_jta transactional or not |
| public final CacheConfiguration | Returns: this configuration instanceIf true, enables logging otherwise disables logging enable)Builder to enable or disable logging for the cache This property can be modified dynamically while the cache is operating. |
| public CacheConfiguration | Returns: thisthe amount of unit amount, final MemoryUnit the actual unit memoryUnit)Sets the maxOnDisk size This property can be modified dynamically while the cache is operating. |
| public CacheConfiguration | Returns: thisthe amount of unit amount, final MemoryUnit the actual unit memoryUnit)Sets the maxOnHeap size |
| public CacheConfiguration | Returns: thisthe amount of unit amount, final MemoryUnit the actual unit memoryUnit)Sets the maxOffHeap tier size Changes to this property once the cache is operating will have no effect. |
| public final CacheConfiguration | Returns: this configuration instanceThe maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory)
Deprecated
use
Builder that sets the maximum objects to be held in memory (0 = no limit).
maxEntriesLocalHeap(int)
|
| public final CacheConfiguration | Returns: this configuration instancethe maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk)
Deprecated
use
Builder which sets the maximum number elements on Disk.
maxEntriesLocalDisk(int) for unclustered caches and maxEntriesInCache(long) for clustered caches.
|
| public final CacheConfiguration | Returns: this configuration instancethe maximum number of entries to allow in the cache. maxEntriesInCache)Builder which sets the maximum number entries in cache. |
| public final CacheConfiguration | Returns: this configuration instancethe maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk)Builder which sets the maximum number elements on Disk. |
| public final CacheConfiguration | Returns: this configuration instanceThe maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory)Builder that sets the maximum objects to be held in memory (0 = no limit). |
| public CacheConfiguration | Returns: this configuration instancethe max off heap memory size allocated for this cache. maxMemoryOffHeap)
Deprecated
See
Builder to set the max off heap memory size allocated for this cache.
maxBytesLocalOffHeap(long, net.
|
| public final CacheConfiguration | Returns: this configuration instancea String representation of the policy. One of "LRU", "LFU" or "FIFO". memoryStoreEvictionPolicy)Builder that sets the eviction policy. |
| public final CacheConfiguration | Returns: this configuration instanceBuilder which Sets the eviction policy. |
| public final CacheConfiguration | |
| public final CacheConfiguration | Returns: this configuration instancewhether to use the disk store overflowToDisk)
Deprecated
The
Builder which sets whether elements can overflow to disk when the in-memory cache has reached the set limit.
overflowToDisk attribute has been replaced with Strategy#LOCALTEMPSWAP.
|
| public CacheConfiguration | Returns: this configuration instanceIf true, enables offheap store otherwise disables it. overflowToOffHeap)Builder to enable or disable offheap store for the cache. |
| private int | |
| public CacheConfiguration | Returns: this configuration instancethe Persistence Configuration persistenceConfiguration)Builder to set the PersistenceConfiguration for this cache. |
| public final CacheConfiguration | |
| private void | |
| public boolean | Returns: true if a listener was removedlistener to remove listener)Remove the supplied cache configuration listener. |
| public final CacheConfiguration | |
| public final void | setCacheLoaderTimeoutMillis(long
the timeout in milliseconds. cacheLoaderTimeoutMillis)Sets the timeout for CacheLoader execution (0 = no timeout). |
| public void | |
| public final void | setClearOnFlush(boolean
true to clear on flush clearOnFlush)Sets whether the MemoryStore should be cleared when
|
| public void | setCopyOnRead(final boolean
true, if copyOnRead copyOnRead)Whether the Cache should copy elements it returns |
| public void | setCopyOnWrite(final boolean
true, if copyOnWrite copyOnWrite)Whether the Cache should copy elements it gets |
| public void | setDiskAccessStripes(int
number of stripes (rounded up to a power-of-2) stripes)Sets the number of disk stripes. |
| public final void | setDiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)
Sets the interval in seconds between runs of the disk expiry thread. |
| public final void | setDiskPersistent(boolean
whether to persist the cache to disk between JVM restarts diskPersistent)
Deprecated
The
Sets whether the disk store persists between CacheManager instances.
diskPersistent attribute has been replaced with persistence(PersistenceConfiguration).
|
| public void | setDiskSpoolBufferSizeMB(int
a positive number diskSpoolBufferSizeMB)Sets the disk spool size, which is used to buffer writes to the DiskStore. |
| public void | setDynamicAttributesExtractor(DynamicAttributesExtractor
extractor to use extractor)Sets dynamic search attributes extractor |
| public final void | |
| public final void | setLogging(boolean
If true, enables logging otherwise disables logging enable)Enables or disables logging for the cache This property can be modified dynamically while the cache is operating. |
| public void | setMaxBytesLocalDisk(final String
String representation of the size, can be relative (in %) maxBytesDisk)Setter for maxBytesOnDisk as a String. |
| public void | setMaxBytesLocalDisk(final Long
max bytes on disk in bytes maxBytesDisk)Sets the maximum amount of bytes the cache being configured will use on the OnDisk tier This property can be modified dynamically while the cache is operating. |
| public void | setMaxBytesLocalHeap(final String
String representation of the size, can be relative (in %) maxBytesHeap)Setter for maxBytesLocalHeap as a String. |
| public void | setMaxBytesLocalHeap(final Long
max bytes in heap in bytes maxBytesHeap)Setter for maxBytesLocalHeap in bytes This property can be modified dynamically while the cache is operating. |
| public void | setMaxBytesLocalOffHeap(final String
String representation of the size, can be relative (in %) maxBytesOffHeap)Setter for maximum bytes off heap as a String. |
| public void | setMaxBytesLocalOffHeap(final Long
max bytes on disk in bytes maxBytesOffHeap)Sets the maximum amount of bytes the cache being configured will use on the OffHeap tier Changes to this property once the cache is operating will have no effect. |
| public final void | setMaxElementsInMemory(int
The maximum number of elements in memory, before they are evicted (0 == no limit) maxElementsInMemory)
Deprecated
use
Sets the maximum objects to be held in memory (0 = no limit).
setMaxEntriesLocalHeap(long)
|
| public void | setMaxElementsOnDisk(int
the maximum number of Elements to allow on the disk. 0 means unlimited. maxElementsOnDisk)
Deprecated
use
Sets the maximum number elements on Disk.
setMaxEntriesLocalDisk(long) for unclustered caches and setMaxEntriesInCache(long) for clustered caches.
|
| public void | setMaxEntriesInCache(long
maximum number of entries in cache maxEntriesInCache)Sets the maximum number of entries in the cache. |
| public void | setMaxEntriesLocalDisk(long
the maximum number of Elements to allow on the disk. 0 means unlimited. maxEntriesLocalDisk)Sets the maximum number elements on Disk. |
| public final void | setMaxEntriesLocalHeap(long
The maximum number of elements in memory, before they are evicted (0 == no limit) maxEntriesLocalHeap)Sets the maximum objects to be held in local heap memory (0 = no limit). |
| public final void | setMaxMemoryOffHeap(String
the max off heap memory size allocated for this cache. maxMemoryOffHeap)
Deprecated
See
Sets the max off heap memory size allocated for this cache.
setMaxBytesLocalOffHeap(java.
|
| public final void | setMemoryStoreEvictionPolicy(String
a String representation of the policy. One of "LRU", "LFU" or "FIFO". memoryStoreEvictionPolicy)Sets the eviction policy. |
| public final void | setMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Sets the eviction policy. |
| public final void | |
| public final void | setOverflowToDisk(boolean
whether to use the disk store overflowToDisk)
Deprecated
The
Sets whether elements can overflow to disk when the in-memory cache has reached the set limit.
overflowToDisk attribute has been replaced with Strategy#LOCALTEMPSWAP.
|
| public final void | setOverflowToOffHeap(boolean
If true, enables offheap store otherwise disables it. overflowToOffHeap)Enables or disables offheap store for the cache. |
| public final void | |
| public final void | setTimeToIdleSeconds(long
the default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds)Sets the time to idle for an element before it expires. |
| public final void | setTimeToLiveSeconds(long
the default amount of time to live for an element from its creation date timeToLiveSeconds)Sets the time to idle for an element before it expires. |
| public final void | setTransactionalMode(final String
one of OFF, LOCAL, XA, XA_STRICT transactionalMode)Sets the transactionalMode |
| public void | setupFor(final CacheManager
The CacheManager as part of which the cache is being setup cacheManager)Sets up the CacheConfiguration for runtime consumption, also registers this cache configuration with the cache manager's configuration |
| public void | setupFor(final CacheManager
The CacheManager as part of which the cache is being setup cacheManager, final boolean true to register this cache configuration with the cache manager. register, final String parentCache)Sets up the CacheConfiguration for runtime consumption |
| public CacheConfiguration | Returns: this configuration instancethe SizeOfPolicy Configuration sizeOfPolicyConfiguration)Builder to set the SizeOfPolicyConfiguration for this cache. |
| public final CacheConfiguration | Returns: this configuration instance
Deprecated
Builder which sets whether the cache's statistics are enabled.
|
| public final CacheConfiguration | |
| public CacheConfiguration | Returns: this configuration instancethe timeout in milliseconds. timeoutMillis)Builder that sets the timeout for CacheLoader execution (0 = no timeout). |
| public final CacheConfiguration | Returns: this configuration instancethe default amount of time to live for an element from its last accessed or modified date timeToIdleSeconds)Builder which sets the time to idle for an element before it expires. |
| public final CacheConfiguration | Returns: this configuration instancethe default amount of time to live for an element from its creation date timeToLiveSeconds)Builder which sets the time to idle for an element before it expires. |
| public final CacheConfiguration | Returns: this configuration instanceone of OFF, LOCAL, XA, XA_STRICT transactionalMode)Builder which sets the transactionalMode |
| public final CacheConfiguration | Returns: this configuration instanceone of OFF, LOCAL, XA, XA_STRICT transactionalModeBuilder which sets the transactionalMode |
| private void | |
| public Collection | Returns: the errors in the configthe CacheManager configuration this is going to be used with configuration)Validates the configuration |
| pack-priv List | Returns: the list of errors encountered, or an empty listThe CacheManager Configuration configuration)Validates the CacheConfiguration against the CacheManager's Configuration |
| public void | |
| public void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | verifyLocalDisk(final long managerMaxBytesLocalDisk, final List<ConfigError> configErrors, final long totalOnDiskAssignedMemory)
|
| private void | verifyLocalHeap(final long managerMaxBytesLocalHeap, final List<ConfigError> configErrors, final long totalOnHeapAssignedMemory)
|
| private void | verifyLocalOffHeap(final long managerMaxBytesLocalOffHeap, final List<ConfigError> configErrors, final long totalOffHeapAssignedMemory)
|
| pack-priv List | Returns: a list with potential errorsThe cacheManager that will manage the cache cacheManager, long bytes for local heap managerMaxBytesLocalHeap, long bytes for local offheap managerMaxBytesLocalOffHeap, long bytes for local disk managerMaxBytesLocalDisk, String cacheName for parentCache to be used when initializing shadow caches parentCacheName)Will verify that we don't overallocate pools |
| private void | |
| private void | |
| private void | |
| private void |