Class CacheConfiguration
- java.lang.Object
-
- net.sf.ehcache.config.CacheConfiguration
-
- All Implemented Interfaces:
java.lang.Cloneable
public class CacheConfiguration extends java.lang.Object implements java.lang.CloneableA value object used to represent cache configuration.Construction Patterns
The recommended way of creating aCachein Ehcache 2.0 and above is to create aCacheConfigurationobject and pass it to theCacheconstructor. SeeCache(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.xmlconfiguration file. e.g.<cache name="testCache1" maxEntriesLocalHeap="10000" eternal="false" timeToIdleSeconds="3600" timeToLiveSeconds="10" overflowToDisk="true" diskPersistent="true" diskExpiryThreadIntervalSeconds="120" maxEntriesLocalDisk="10000" />Dynamic Configuration
CacheConfiguration instances retrieved from Cache instances allow the dynamic modification of certain configuration properties. Currently the dynamic properties are:- Time To Idle
- Time To Live
- Max Entries in Local Heap
- Max Entries on Local Disk
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".
- Version:
- $Id$
- Author:
- Greg Luck, Chris Dennis
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCacheConfiguration.BootstrapCacheLoaderFactoryConfigurationConfiguration for the BootstrapCacheLoaderFactoryConfiguration.static classCacheConfiguration.CacheDecoratorFactoryConfigurationConfiguration for the CacheDecoratorFactoryConfiguration.static classCacheConfiguration.CacheEventListenerFactoryConfigurationConfiguration for the CacheEventListenerFactory.static classCacheConfiguration.CacheExceptionHandlerFactoryConfigurationConfiguration for the BootstrapCacheLoaderFactoryConfiguration.static classCacheConfiguration.CacheExtensionFactoryConfigurationConfiguration for the CacheExtensionFactoryConfiguration.static classCacheConfiguration.CacheLoaderFactoryConfigurationConfiguration for the CacheLoaderFactoryConfiguration.static classCacheConfiguration.TransactionalModeRepresents whether the Cache is transactional or not.
-
Field Summary
Fields Modifier and Type Field Description protected CacheConfiguration.BootstrapCacheLoaderFactoryConfigurationbootstrapCacheLoaderFactoryConfigurationThe BootstrapCacheLoaderFactoryConfiguration.protected java.util.List<CacheConfiguration.CacheDecoratorFactoryConfiguration>cacheDecoratorConfigurationsThe cache decorator factories added by BeanUtils.protected java.util.List<CacheConfiguration.CacheEventListenerFactoryConfiguration>cacheEventListenerConfigurationsThe event listener factories added by BeanUtils.protected CacheConfiguration.CacheExceptionHandlerFactoryConfigurationcacheExceptionHandlerFactoryConfigurationThe CacheExceptionHandlerFactoryConfiguration.protected java.util.List<CacheConfiguration.CacheExtensionFactoryConfiguration>cacheExtensionConfigurationsThe cache extension factories added by BeanUtils.protected java.util.List<CacheConfiguration.CacheLoaderFactoryConfiguration>cacheLoaderConfigurationsThe cache loader factories added by BeanUtils.protected longcacheLoaderTimeoutMillisTimeout in milliseconds for CacheLoader related callsprotected CacheWriterConfigurationcacheWriterConfigurationThe CacheWriterConfiguration.protected booleanclearOnFlushSets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.static CacheWriterConfigurationDEFAULT_CACHE_WRITER_CONFIGURATIONThe default cacheWriterConfigurationstatic booleanDEFAULT_CLEAR_ON_FLUSHDefault value for clearOnFlushstatic booleanDEFAULT_COPY_ON_READDefault value for copyOnReadstatic booleanDEFAULT_COPY_ON_WRITEDefault value for copyOnReadstatic CopyStrategyConfigurationDEFAULT_COPY_STRATEGY_CONFIGURATIONDefault copyStrategyConfigurationstatic intDEFAULT_DISK_ACCESS_STRIPESDefault number of diskAccessStripes.static booleanDEFAULT_DISK_PERSISTENTDeprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).static booleanDEFAULT_ETERNAL_VALUEDefault eternal valuestatic longDEFAULT_EXPIRY_THREAD_INTERVAL_SECONDSThe default interval between runs of the expiry thread.static booleanDEFAULT_LOGGINGLogging is off by default.static longDEFAULT_MAX_BYTES_OFF_HEAPDefault maxBytesOffHeap valuestatic longDEFAULT_MAX_BYTES_ON_DISKDefault maxBytesOnDisk valuestatic longDEFAULT_MAX_BYTES_ON_HEAPDeprecated.UseDEFAULT_MAX_BYTES_OFF_HEAPinsteadstatic intDEFAULT_MAX_ELEMENTS_ON_DISKDefault value for maxElementsOnDiskstatic longDEFAULT_MAX_ENTRIES_IN_CACHEDefault value for maxEntriesInCachestatic MemoryStoreEvictionPolicyDEFAULT_MEMORY_STORE_EVICTION_POLICYThe default memory store eviction policy is LRU.static intDEFAULT_SPOOL_BUFFER_SIZESet a buffer size for the spool of approx 30MB.static booleanDEFAULT_STATISTICSDefault value for statisticsstatic CacheConfiguration.TransactionalModeDEFAULT_TRANSACTIONAL_MODEDefault value for transactionalModestatic longDEFAULT_TTIDefault value for ttistatic longDEFAULT_TTLDefault value for ttlprotected intdiskAccessStripesThe number of concurrent disk access stripes.protected longdiskExpiryThreadIntervalSecondsThe interval in seconds between runs of the disk expiry thread.protected java.lang.BooleandiskPersistentDeprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).protected intdiskSpoolBufferSizeMBThe size of the disk spool used to buffer writesprotected booleaneternalSets whether elements are eternal.protected java.util.Set<CacheConfigurationListener>listenersThe listeners for this configuration.protected booleanloggingIndicates whether logging is enabled or not.protected intmaxElementsOnDiskthe maximum objects to be held in theDiskStore.protected longmaxEntriesInCachethe maximum entries to be held in the cacheprotected java.lang.IntegermaxEntriesLocalHeapthe maximum objects to be held in theMemoryStore.protected MemoryStoreEvictionPolicymemoryStoreEvictionPolicyThe policy used to evict elements from theMemoryStore.protected java.lang.Stringnamethe name of the cache.protected java.lang.BooleanoverflowToDiskDeprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.protected java.lang.BooleanoverflowToOffHeapwhether elements can overflow to off heap memory when the in-memory cache has reached the set limit.protected PinningConfigurationpinningConfigurationThe PinningConfiguration.protected TerracottaConfigurationterracottaConfigurationThe TerracottaConfiguration.protected longtimeToIdleSecondsthe time to idle for an element before it expires.protected longtimeToLiveSecondsSets the time to idle for an element before it expires.
-
Constructor Summary
Constructors Constructor Description CacheConfiguration()Default constructor.CacheConfiguration(java.lang.String name, int maxEntriesLocalHeap)Create a new cache configuration.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddBootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration factory)Allows BeanHandler to add the CacheManagerEventListener to the configuration.voidaddCacheDecoratorFactory(CacheConfiguration.CacheDecoratorFactoryConfiguration factory)Used by BeanUtils to add each cacheDecoratorFactory to the cache configuration.voidaddCacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration.voidaddCacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factory)Add the CacheExceptionHandlerFactory to the configuration.voidaddCacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)Used by BeanUtils to add cacheExtensionFactory elements to the cache configuration.voidaddCacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)Used by BeanUtils to add each cacheLoaderFactory to the cache configuration.voidaddCacheWriter(CacheWriterConfiguration cacheWriterConfiguration)Allows BeanHandler to add the CacheWriterConfiguration to the configuration.booleanaddConfigurationListener(CacheConfigurationListener listener)Add a listener to this cache configurationvoidaddCopyStrategy(CopyStrategyConfiguration copyStrategyConfiguration)Sets the CopyStrategyConfiguration for this cachebooleanaddDynamicSearchListener(DynamicSearchListener listener)Add a dynamic extractor configuration listenervoidaddElementValueComparator(ElementValueComparatorConfiguration elementValueComparatorConfiguration)Sets the ElementValueComparatorConfiguration for this cache The default configuration will setup aDefaultElementValueComparatorvoidaddPersistence(PersistenceConfiguration persistenceConfiguration)Sets the PersistenceConfiguration for this cache.voidaddPinning(PinningConfiguration pinningConfiguration)Allows BeanHandler to add the PinningConfiguration to the configuration.voidaddSearchable(Searchable searchable)Add configuration to make this cache searchablevoidaddSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)Sets the SizeOfPolicyConfiguration for this cache.voidaddTerracotta(TerracottaConfiguration terracottaConfiguration)Allows BeanHandler to add the TerracottaConfiguration to the configuration.CacheConfigurationbootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration factory)CacheConfigurationcacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)CacheConfigurationcacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factory)CacheConfigurationcacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)CacheConfigurationcacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)CacheConfigurationcacheWriter(CacheWriterConfiguration cacheWriterConfiguration)CacheConfigurationclearOnFlush(boolean clearOnFlush)Builder which sets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.CacheConfigurationclone()Clones this object, following the usual contract.CacheConfigurationcopyOnRead(boolean copyOnRead)Whether the Cache should copy elements it returnsCacheConfigurationcopyOnWrite(boolean copyOnWrite)Whether the Cache should copy elements it getsCacheConfigurationdiskAccessStripes(int stripes)Builder which sets the number of disk stripes.CacheConfigurationdiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)Builder which sets the interval in seconds between runs of the disk expiry thread.CacheConfigurationdiskPersistent(boolean diskPersistent)Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).CacheConfigurationdiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)Builder which sets the disk spool size, which is used to buffer writes to the DiskStore.CacheConfigurationdynamicAttributeExtractor(DynamicAttributesExtractor extractor)Sets dynamic search attributes extractorCacheConfigurationeternal(boolean eternal)Builder which sets whether elements are eternal.voidfreezeConfiguration()Freeze this configuration.CacheConfiguration.BootstrapCacheLoaderFactoryConfigurationgetBootstrapCacheLoaderFactoryConfiguration()Accessorjava.util.List<CacheConfiguration.CacheDecoratorFactoryConfiguration>getCacheDecoratorConfigurations()Accessorjava.util.ListgetCacheEventListenerConfigurations()AccessorCacheConfiguration.CacheExceptionHandlerFactoryConfigurationgetCacheExceptionHandlerFactoryConfiguration()Accessorjava.util.ListgetCacheExtensionConfigurations()Accessorjava.util.ListgetCacheLoaderConfigurations()AccessorlonggetCacheLoaderTimeoutMillis()AccessorCacheWriterConfigurationgetCacheWriterConfiguration()Accessorjava.lang.ClassLoadergetClassLoader()ReadWriteCopyStrategy<Element>getCopyStrategy()Getter to the configured ReadWriteCopyStrategy.CopyStrategyConfigurationgetCopyStrategyConfiguration()Returns the copyStrategyConfigurationintgetDiskAccessStripes()AccessorlonggetDiskExpiryThreadIntervalSeconds()AccessorintgetDiskSpoolBufferSizeMB()AccessorDynamicAttributesExtractorgetDynamicExtractor()AccessorElementValueComparatorConfigurationgetElementValueComparatorConfiguration()Returns the elementComparatorConfigurationbooleangetLogging()Only used when cache is clustered with TerracottalonggetMaxBytesLocalDisk()The maximum amount of bytes the cache should occupy on diskjava.lang.StringgetMaxBytesLocalDiskAsString()The string form of the maximum amount of bytes the cache should occupy on diskjava.lang.IntegergetMaxBytesLocalDiskPercentage()Getter for maximum bytes on disk expressed as a percentagelonggetMaxBytesLocalHeap()Deprecated.UsegetMaxEntriesLocalHeap()insteadjava.lang.StringgetMaxBytesLocalHeapAsString()Deprecated.UsegetMaxEntriesLocalHeap()insteadjava.lang.IntegergetMaxBytesLocalHeapPercentage()Deprecated.UsesetMaxEntriesLocalHeap(long)insteadlonggetMaxBytesLocalOffHeap()The maximum amount of bytes the cache should occupy off heapjava.lang.StringgetMaxBytesLocalOffHeapAsString()The string form of the maximum amount of bytes the cache should occupy off heapjava.lang.IntegergetMaxBytesLocalOffHeapPercentage()Getter for maximum bytes off heap expressed as a percentageintgetMaxElementsInMemory()Deprecated.intgetMaxElementsOnDisk()Deprecated.usegetMaxEntriesLocalDisk()for unclustered caches andgetMaxEntriesInCache()for clustered caches.longgetMaxEntriesInCache()AccessorlonggetMaxEntriesLocalDisk()Configured maximum number of entries for the local disk store.longgetMaxEntriesLocalHeap()Configured maximum number of entries for the local memory heap.java.lang.StringgetMaxMemoryOffHeap()Deprecated.longgetMaxMemoryOffHeapInBytes()Deprecated.MemoryStoreEvictionPolicygetMemoryStoreEvictionPolicy()Accessorjava.lang.StringgetName()AccessorPersistenceConfigurationgetPersistenceConfiguration()AccessorPinningConfigurationgetPinningConfiguration()AccessorSearchablegetSearchable()Get the search configuration for this cache (if any)java.util.Map<java.lang.String,SearchAttribute>getSearchAttributes()Get the defined search attributes indexed by attribute nameSizeOfPolicyConfigurationgetSizeOfPolicyConfiguration()AccessorbooleangetStatistics()Gets whether the cache's statistics will be enabled at startupTerracottaConfigurationgetTerracottaConfiguration()AccessorTerracottaConfiguration.ConsistencygetTerracottaConsistency()AccessorlonggetTimeToIdleSeconds()AccessorlonggetTimeToLiveSeconds()AccessorCacheConfiguration.TransactionalModegetTransactionalMode()To what transactionalMode was the Cache setvoidinternalSetDiskCapacity(int capacity)Intended for internal use only, and subject to change.voidinternalSetEternal(boolean eternal)Intended for internal use only, and subject to change.voidinternalSetLogging(boolean logging)Intended for internal use only, and subject to change.voidinternalSetMaxBytesLocalOffheap(long maxBytesLocalOffheap)Intended for internal use only, and subject to change.voidinternalSetMaxEntriesInCache(int entries)Intended for internal use only, and subject to change.voidinternalSetMemCapacity(int capacity)Intended for internal use only, and subject to change.voidinternalSetMemCapacityInBytes(long capacity)Deprecated.UseinternalSetMemCapacity(int)insteadvoidinternalSetOverflowToOffheap(boolean overflowToOffHeap)Intended for internal use only, and subject to change.voidinternalSetTimeToIdle(long timeToIdle)Intended for internal use only, and subject to change.voidinternalSetTimeToLive(long timeToLive)Intended for internal use only, and subject to change.booleanisClearOnFlush()AccessorbooleanisCopyOnRead()Whether the Cache should copy elements it returnsbooleanisCopyOnWrite()Whether the Cache should copy elements it getsbooleanisCountBasedTuned()Whether this cache is Count basedbooleanisDiskPersistent()Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).booleanisEternal()AccessorbooleanisFrozen()booleanisLocalTransactional()Helper method to compute whether the cache is local transactional or notbooleanisMaxBytesLocalDiskPercentageSet()Checks whether the user explicitly set the maxBytesOnDiskPercentagebooleanisMaxBytesLocalHeapPercentageSet()Deprecated.UsemaxEntriesLocalHeapinsteadbooleanisMaxBytesLocalOffHeapPercentageSet()Checks whether the user explicitly set the maxBytesOffHeapPercentagebooleanisOverflowToDisk()Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.booleanisOverflowToOffHeap()AccessorbooleanisOverflowToOffHeapSet()Checks whether the overflowing to off heap behavior was explicitly setbooleanisSearchable()AccessorbooleanisTerracottaClustered()Helper method to compute whether the cache is clustered or notbooleanisXaStrictTransactional()Helper method to compute whether the cache is XA transactional or notbooleanisXaTransactional()Helper method to compute whether the cache is local_jta transactional or notCacheConfigurationlogging(boolean enable)Builder to enable or disable logging for the cacheCacheConfigurationmaxBytesLocalDisk(long amount, MemoryUnit memoryUnit)Sets the maxOnDisk sizeCacheConfigurationmaxBytesLocalHeap(long amount, MemoryUnit memoryUnit)Sets the maxOnHeap sizeCacheConfigurationmaxBytesLocalOffHeap(long amount, MemoryUnit memoryUnit)Sets the maxOffHeap tier sizeCacheConfigurationmaxElementsInMemory(int maxElementsInMemory)Deprecated.CacheConfigurationmaxElementsOnDisk(int maxElementsOnDisk)Deprecated.usemaxEntriesLocalDisk(int)for unclustered caches andmaxEntriesInCache(long)for clustered caches.CacheConfigurationmaxEntriesInCache(long maxEntriesInCache)Builder which sets the maximum number entries in cache.CacheConfigurationmaxEntriesLocalDisk(int maxElementsOnDisk)Builder which sets the maximum number elements on Disk.CacheConfigurationmaxEntriesLocalHeap(int maxElementsInMemory)Builder that sets the maximum objects to be held in memory (0 = no limit).CacheConfigurationmaxMemoryOffHeap(java.lang.String maxMemoryOffHeap)Deprecated.CacheConfigurationmemoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)Builder that sets the eviction policy.CacheConfigurationmemoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)Builder which Sets the eviction policy.CacheConfigurationname(java.lang.String name)Builder to set the name of the cache.CacheConfigurationoverflowToDisk(boolean overflowToDisk)Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.CacheConfigurationoverflowToOffHeap(boolean overflowToOffHeap)Builder to enable or disable offheap store for the cache.CacheConfigurationpersistence(PersistenceConfiguration persistenceConfiguration)Builder to set the PersistenceConfiguration for this cache.CacheConfigurationpinning(PinningConfiguration pinningConfiguration)booleanremoveConfigurationListener(CacheConfigurationListener listener)Remove the supplied cache configuration listener.CacheConfigurationsearchable(Searchable searchable)voidsetCacheLoaderTimeoutMillis(long cacheLoaderTimeoutMillis)Sets the timeout for CacheLoader execution (0 = no timeout).voidsetClassLoader(java.lang.ClassLoader classLoader)voidsetClearOnFlush(boolean clearOnFlush)Sets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.voidsetCopyOnRead(boolean copyOnRead)Whether the Cache should copy elements it returnsvoidsetCopyOnWrite(boolean copyOnWrite)Whether the Cache should copy elements it getsvoidsetDiskAccessStripes(int stripes)Sets the number of disk stripes.voidsetDiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)Sets the interval in seconds between runs of the disk expiry thread.voidsetDiskPersistent(boolean diskPersistent)Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).voidsetDiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)Sets the disk spool size, which is used to buffer writes to the DiskStore.voidsetDynamicAttributesExtractor(DynamicAttributesExtractor extractor)Sets dynamic search attributes extractorvoidsetEternal(boolean eternal)Sets whether elements are eternal.voidsetLogging(boolean enable)Enables or disables logging for the cachevoidsetMaxBytesLocalDisk(java.lang.Long maxBytesDisk)Sets the maximum amount of bytes the cache being configured will use on the OnDisk tiervoidsetMaxBytesLocalDisk(java.lang.String maxBytesDisk)Setter for maxBytesOnDisk as a String.voidsetMaxBytesLocalHeap(java.lang.Long maxBytesHeap)Deprecated.UsesetMaxEntriesLocalHeap(long)insteadvoidsetMaxBytesLocalHeap(java.lang.String maxBytesHeap)Deprecated.UsesetMaxEntriesLocalHeap(long)insteadvoidsetMaxBytesLocalOffHeap(java.lang.Long maxBytesOffHeap)Sets the maximum amount of bytes the cache being configured will use on the OffHeap tiervoidsetMaxBytesLocalOffHeap(java.lang.String maxBytesOffHeap)Setter for maximum bytes off heap as a String.voidsetMaxElementsInMemory(int maxElementsInMemory)Deprecated.voidsetMaxElementsOnDisk(int maxElementsOnDisk)Deprecated.usesetMaxEntriesLocalDisk(long)for unclustered caches andsetMaxEntriesInCache(long)for clustered caches.voidsetMaxEntriesInCache(long maxEntriesInCache)Sets the maximum number of entries in the cache.voidsetMaxEntriesLocalDisk(long maxEntriesLocalDisk)Sets the maximum number elements on Disk.voidsetMaxEntriesLocalHeap(long maxEntriesLocalHeap)Sets the maximum objects to be held in local heap memory (0 = no limit).voidsetMaxMemoryOffHeap(java.lang.String maxMemoryOffHeap)Deprecated.voidsetMemoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)Sets the eviction policy.voidsetMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)Sets the eviction policy.voidsetName(java.lang.String name)Sets the name of the cache.voidsetOverflowToDisk(boolean overflowToDisk)Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.voidsetOverflowToOffHeap(boolean overflowToOffHeap)Enables or disables offheap store for the cache.voidsetStatistics(boolean enabled)Deprecated.voidsetTimeToIdleSeconds(long timeToIdleSeconds)Sets the time to idle for an element before it expires.voidsetTimeToLiveSeconds(long timeToLiveSeconds)Sets the time to idle for an element before it expires.voidsetTransactionalMode(java.lang.String transactionalMode)Sets the transactionalModevoidsetupFor(CacheManager cacheManager)Sets up the CacheConfiguration for runtime consumption, also registers this cache configuration with the cache manager's configurationvoidsetupFor(CacheManager cacheManager, boolean register, java.lang.String parentCache)Sets up the CacheConfiguration for runtime consumptionCacheConfigurationsizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)Builder to set the SizeOfPolicyConfiguration for this cache.CacheConfigurationstatistics(boolean statistics)Deprecated.CacheConfigurationterracotta(TerracottaConfiguration terracottaConfiguration)CacheConfigurationtimeoutMillis(long timeoutMillis)Builder that sets the timeout for CacheLoader execution (0 = no timeout).CacheConfigurationtimeToIdleSeconds(long timeToIdleSeconds)Builder which sets the time to idle for an element before it expires.CacheConfigurationtimeToLiveSeconds(long timeToLiveSeconds)Builder which sets the time to idle for an element before it expires.CacheConfigurationtransactionalMode(java.lang.String transactionalMode)Builder which sets the transactionalModeCacheConfigurationtransactionalMode(CacheConfiguration.TransactionalMode transactionalMode)Builder which sets the transactionalModejava.util.Collection<ConfigError>validate(Configuration configuration)Validates the configurationvoidvalidateCompleteConfiguration()Used to validate what should be a complete Cache Configuration.voidvalidateConfiguration()Used to validate a Cache Configuration.
-
-
-
Field Detail
-
DEFAULT_CLEAR_ON_FLUSH
public static final boolean DEFAULT_CLEAR_ON_FLUSH
Default value for clearOnFlush- See Also:
- Constant Field Values
-
DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS
public static final long DEFAULT_EXPIRY_THREAD_INTERVAL_SECONDS
The default interval between runs of the expiry thread.- See Also:
- Constant Field Values
-
DEFAULT_SPOOL_BUFFER_SIZE
public static final int DEFAULT_SPOOL_BUFFER_SIZE
Set a buffer size for the spool of approx 30MB.- See Also:
- Constant Field Values
-
DEFAULT_DISK_ACCESS_STRIPES
public static final int DEFAULT_DISK_ACCESS_STRIPES
Default number of diskAccessStripes.- See Also:
- Constant Field Values
-
DEFAULT_LOGGING
public static final boolean DEFAULT_LOGGING
Logging is off by default.- See Also:
- Constant Field Values
-
DEFAULT_MEMORY_STORE_EVICTION_POLICY
public static final MemoryStoreEvictionPolicy DEFAULT_MEMORY_STORE_EVICTION_POLICY
The default memory store eviction policy is LRU.
-
DEFAULT_CACHE_WRITER_CONFIGURATION
public static final CacheWriterConfiguration DEFAULT_CACHE_WRITER_CONFIGURATION
The default cacheWriterConfiguration
-
DEFAULT_COPY_ON_READ
public static final boolean DEFAULT_COPY_ON_READ
Default value for copyOnRead- See Also:
- Constant Field Values
-
DEFAULT_COPY_ON_WRITE
public static final boolean DEFAULT_COPY_ON_WRITE
Default value for copyOnRead- See Also:
- Constant Field Values
-
DEFAULT_TTL
public static final long DEFAULT_TTL
Default value for ttl- See Also:
- Constant Field Values
-
DEFAULT_TTI
public static final long DEFAULT_TTI
Default value for tti- See Also:
- Constant Field Values
-
DEFAULT_MAX_ELEMENTS_ON_DISK
public static final int DEFAULT_MAX_ELEMENTS_ON_DISK
Default value for maxElementsOnDisk- See Also:
- Constant Field Values
-
DEFAULT_MAX_ENTRIES_IN_CACHE
public static final long DEFAULT_MAX_ENTRIES_IN_CACHE
Default value for maxEntriesInCache- See Also:
- Constant Field Values
-
DEFAULT_TRANSACTIONAL_MODE
public static final CacheConfiguration.TransactionalMode DEFAULT_TRANSACTIONAL_MODE
Default value for transactionalMode
-
DEFAULT_STATISTICS
public static final boolean DEFAULT_STATISTICS
Default value for statistics- See Also:
- Constant Field Values
-
DEFAULT_DISK_PERSISTENT
@Deprecated public static final boolean DEFAULT_DISK_PERSISTENT
Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).Default value for diskPersistent- See Also:
- Constant Field Values
-
DEFAULT_COPY_STRATEGY_CONFIGURATION
public static final CopyStrategyConfiguration DEFAULT_COPY_STRATEGY_CONFIGURATION
Default copyStrategyConfiguration
-
DEFAULT_MAX_BYTES_ON_HEAP
@Deprecated public static final long DEFAULT_MAX_BYTES_ON_HEAP
Deprecated.UseDEFAULT_MAX_BYTES_OFF_HEAPinsteadDefault maxBytesOnHeap value- See Also:
- Constant Field Values
-
DEFAULT_MAX_BYTES_OFF_HEAP
public static final long DEFAULT_MAX_BYTES_OFF_HEAP
Default maxBytesOffHeap value- See Also:
- Constant Field Values
-
DEFAULT_MAX_BYTES_ON_DISK
public static final long DEFAULT_MAX_BYTES_ON_DISK
Default maxBytesOnDisk value- See Also:
- Constant Field Values
-
DEFAULT_ETERNAL_VALUE
public static final boolean DEFAULT_ETERNAL_VALUE
Default eternal value- See Also:
- Constant Field Values
-
name
protected volatile java.lang.String name
the name of the cache.
-
cacheLoaderTimeoutMillis
protected volatile long cacheLoaderTimeoutMillis
Timeout in milliseconds for CacheLoader related calls
-
maxEntriesLocalHeap
protected volatile java.lang.Integer maxEntriesLocalHeap
the maximum objects to be held in theMemoryStore.0translates to no-limit.
-
maxElementsOnDisk
protected volatile int maxElementsOnDisk
the maximum objects to be held in theDiskStore.0translates to no-limit.
-
maxEntriesInCache
protected volatile long maxEntriesInCache
the maximum entries to be held in the cache
-
memoryStoreEvictionPolicy
protected volatile MemoryStoreEvictionPolicy memoryStoreEvictionPolicy
The policy used to evict elements from theMemoryStore. This can be one of:- LRU - least recently used
- LFU - Less frequently used
- FIFO - first in first out, the oldest element by creation time
- Since:
- 1.2
-
clearOnFlush
protected volatile boolean clearOnFlush
Sets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.
-
eternal
protected volatile boolean eternal
Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired.
-
timeToIdleSeconds
protected volatile long timeToIdleSeconds
the time to idle for an element before it expires. Is only used if the element is not eternal.A value of 0 means do not check for idling.
-
timeToLiveSeconds
protected volatile long timeToLiveSeconds
Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This attribute is optional in the configuration. A value of 0 means do not check time to live.
-
overflowToDisk
@Deprecated protected volatile java.lang.Boolean overflowToDisk
Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.whether elements can overflow to disk when the in-memory cache has reached the set limit.
-
diskPersistent
@Deprecated protected volatile java.lang.Boolean diskPersistent
Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).For caches that overflow to disk, whether the disk cache persists between CacheManager instances.
-
diskSpoolBufferSizeMB
protected volatile int diskSpoolBufferSizeMB
The size of the disk spool used to buffer writes
-
diskAccessStripes
protected volatile int diskAccessStripes
The number of concurrent disk access stripes.
-
diskExpiryThreadIntervalSeconds
protected volatile long diskExpiryThreadIntervalSeconds
The interval in seconds between runs of the disk expiry thread.2 minutes is the default. This is not the same thing as time to live or time to idle. When the thread runs it checks these things. So this value is how often we check for expiry.
-
logging
protected volatile boolean logging
Indicates whether logging is enabled or not. False by default. Only used when cache is clustered with Terracotta.
-
overflowToOffHeap
protected volatile java.lang.Boolean overflowToOffHeap
whether elements can overflow to off heap memory when the in-memory cache has reached the set limit.
-
cacheEventListenerConfigurations
protected volatile java.util.List<CacheConfiguration.CacheEventListenerFactoryConfiguration> cacheEventListenerConfigurations
The event listener factories added by BeanUtils.
-
cacheExtensionConfigurations
protected volatile java.util.List<CacheConfiguration.CacheExtensionFactoryConfiguration> cacheExtensionConfigurations
The cache extension factories added by BeanUtils.
-
bootstrapCacheLoaderFactoryConfiguration
protected CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration bootstrapCacheLoaderFactoryConfiguration
The BootstrapCacheLoaderFactoryConfiguration.
-
cacheExceptionHandlerFactoryConfiguration
protected CacheConfiguration.CacheExceptionHandlerFactoryConfiguration cacheExceptionHandlerFactoryConfiguration
The CacheExceptionHandlerFactoryConfiguration.
-
terracottaConfiguration
protected TerracottaConfiguration terracottaConfiguration
The TerracottaConfiguration.
-
pinningConfiguration
protected volatile PinningConfiguration pinningConfiguration
The PinningConfiguration.
-
cacheWriterConfiguration
protected CacheWriterConfiguration cacheWriterConfiguration
The CacheWriterConfiguration.
-
cacheLoaderConfigurations
protected volatile java.util.List<CacheConfiguration.CacheLoaderFactoryConfiguration> cacheLoaderConfigurations
The cache loader factories added by BeanUtils.
-
cacheDecoratorConfigurations
protected volatile java.util.List<CacheConfiguration.CacheDecoratorFactoryConfiguration> cacheDecoratorConfigurations
The cache decorator factories added by BeanUtils.
-
listeners
protected volatile java.util.Set<CacheConfigurationListener> listeners
The listeners for this configuration.
-
-
Constructor Detail
-
CacheConfiguration
public CacheConfiguration()
Default constructor.Note that an empty Cache is not valid and must have extra configuration added which can be done through the fluent methods in this class. Call
validateConfiguration()to check your configuration.- See Also:
validateCompleteConfiguration()
-
CacheConfiguration
public CacheConfiguration(java.lang.String name, int maxEntriesLocalHeap)Create a new cache configuration.Extra configuration can added after construction via the fluent methods in this class. Call
validateConfiguration()to check your configuration.- Parameters:
name- the name of the cache. Note that "default" is a reserved name for the defaultCache.maxEntriesLocalHeap- the maximum number of elements in memory, before they are evicted (0 == no limit)- See Also:
validateCompleteConfiguration()
-
-
Method Detail
-
clone
public CacheConfiguration clone()
Clones this object, following the usual contract.- Overrides:
clonein classjava.lang.Object- Returns:
- a copy, which independent other than configurations than cannot change.
-
setName
public final void setName(java.lang.String name)
Sets the name of the cache.Cache names have constraints on the characters they can use:
- the '/' character is illegal,
- the '#' character does not work with RMI replication,
- caches that are registered as MBeans must obey the
ObjectNamerules for unquoted value. This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
- Parameters:
name- the cache name. This must be unique.
-
name
public final CacheConfiguration name(java.lang.String name)
Builder to set the name of the cache.Cache names have constraints on the characters they can use:
- the '/' character is illegal,
- the '#' character does not work with RMI replication,
- caches that are registered as MBeans must obey the
ObjectNamerules for unquoted value. This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
- Parameters:
name- the cache name. This must be unique.- Returns:
- this configuration instance
- See Also:
setName(String)
-
setLogging
public final void setLogging(boolean enable)
Enables or disables logging for the cacheThis property can be modified dynamically while the cache is operating. Only used when cache is clustered with Terracotta
- Parameters:
enable- If true, enables logging otherwise disables logging
-
setOverflowToOffHeap
public final void setOverflowToOffHeap(boolean overflowToOffHeap)
Enables or disables offheap store for the cache.- Parameters:
overflowToOffHeap- If true, enables offheap store otherwise disables it.
-
overflowToOffHeap
public CacheConfiguration overflowToOffHeap(boolean overflowToOffHeap)
Builder to enable or disable offheap store for the cache.- Parameters:
overflowToOffHeap- If true, enables offheap store otherwise disables it.- Returns:
- this configuration instance
- See Also:
setOverflowToOffHeap(boolean)
-
addSizeOfPolicy
public void addSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)
Sets the SizeOfPolicyConfiguration for this cache.- Parameters:
sizeOfPolicyConfiguration- the SizeOfPolicy Configuration
-
sizeOfPolicy
public CacheConfiguration sizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)
Builder to set the SizeOfPolicyConfiguration for this cache.- Parameters:
sizeOfPolicyConfiguration- the SizeOfPolicy Configuration- Returns:
- this configuration instance
- See Also:
addSizeOfPolicy(SizeOfPolicyConfiguration)
-
addPersistence
public void addPersistence(PersistenceConfiguration persistenceConfiguration)
Sets the PersistenceConfiguration for this cache.- Parameters:
persistenceConfiguration- the Persistence Configuration
-
persistence
public CacheConfiguration persistence(PersistenceConfiguration persistenceConfiguration)
Builder to set the PersistenceConfiguration for this cache.- Parameters:
persistenceConfiguration- the Persistence Configuration- Returns:
- this configuration instance
- See Also:
addPersistence(PersistenceConfiguration)
-
setMaxMemoryOffHeap
@Deprecated public final void setMaxMemoryOffHeap(java.lang.String maxMemoryOffHeap)
Deprecated.Sets the max off heap memory size allocated for this cache.- Parameters:
maxMemoryOffHeap- the max off heap memory size allocated for this cache.
-
maxMemoryOffHeap
@Deprecated public CacheConfiguration maxMemoryOffHeap(java.lang.String maxMemoryOffHeap)
Deprecated.Builder to set the max off heap memory size allocated for this cache.- Parameters:
maxMemoryOffHeap- the max off heap memory size allocated for this cache.- Returns:
- this configuration instance
-
logging
public final CacheConfiguration logging(boolean enable)
Builder to enable or disable logging for the cacheThis property can be modified dynamically while the cache is operating. Only used when cache is clustered with Terracotta
- Parameters:
enable- If true, enables logging otherwise disables logging- Returns:
- this configuration instance
- See Also:
setLogging(boolean)
-
setMaxElementsInMemory
@Deprecated public final void setMaxElementsInMemory(int maxElementsInMemory)
Deprecated.Sets the maximum objects to be held in memory (0 = no limit).This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsInMemory- The maximum number of elements in memory, before they are evicted (0 == no limit)
-
setMaxEntriesLocalHeap
public final void setMaxEntriesLocalHeap(long maxEntriesLocalHeap)
Sets the maximum objects to be held in local heap memory (0 = no limit).This property can be modified dynamically while the cache is operating.
- Parameters:
maxEntriesLocalHeap- The maximum number of elements in memory, before they are evicted (0 == no limit)
-
maxElementsInMemory
@Deprecated public final CacheConfiguration maxElementsInMemory(int maxElementsInMemory)
Deprecated.Builder that sets the maximum objects to be held in memory (0 = no limit).This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsInMemory- The maximum number of elements in memory, before they are evicted (0 == no limit)- Returns:
- this configuration instance
-
maxEntriesLocalHeap
public final CacheConfiguration maxEntriesLocalHeap(int maxElementsInMemory)
Builder that sets the maximum objects to be held in memory (0 = no limit).This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsInMemory- The maximum number of elements in memory, before they are evicted (0 == no limit)- Returns:
- this configuration instance
-
setCacheLoaderTimeoutMillis
public final void setCacheLoaderTimeoutMillis(long cacheLoaderTimeoutMillis)
Sets the timeout for CacheLoader execution (0 = no timeout).- Parameters:
cacheLoaderTimeoutMillis- the timeout in milliseconds.
-
timeoutMillis
public CacheConfiguration timeoutMillis(long timeoutMillis)
Builder that sets the timeout for CacheLoader execution (0 = no timeout).- Parameters:
timeoutMillis- the timeout in milliseconds.- Returns:
- this configuration instance
-
setMemoryStoreEvictionPolicy
public final void setMemoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)
Sets the eviction policy. An invalid argument will set it to LRU.- Parameters:
memoryStoreEvictionPolicy- a String representation of the policy. One of "LRU", "LFU" or "FIFO".
-
memoryStoreEvictionPolicy
public final CacheConfiguration memoryStoreEvictionPolicy(java.lang.String memoryStoreEvictionPolicy)
Builder that sets the eviction policy. An invalid argument will set it to null.- Parameters:
memoryStoreEvictionPolicy- a String representation of the policy. One of "LRU", "LFU" or "FIFO".- Returns:
- this configuration instance
- See Also:
setMemoryStoreEvictionPolicy(String)
-
setMemoryStoreEvictionPolicyFromObject
public final void setMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Sets the eviction policy. This method has a strange name to workaround a problem with XML parsing.
-
memoryStoreEvictionPolicy
public final CacheConfiguration memoryStoreEvictionPolicy(MemoryStoreEvictionPolicy memoryStoreEvictionPolicy)
Builder which Sets the eviction policy. An invalid argument will set it to null.- Returns:
- this configuration instance
- See Also:
setMemoryStoreEvictionPolicyFromObject(MemoryStoreEvictionPolicy)
-
setClearOnFlush
public final void setClearOnFlush(boolean clearOnFlush)
Sets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.- Parameters:
clearOnFlush- true to clear on flush
-
clearOnFlush
public final CacheConfiguration clearOnFlush(boolean clearOnFlush)
Builder which sets whether the MemoryStore should be cleared whenflush()is called on the cache - true by default.- Parameters:
clearOnFlush- true to clear on flush- Returns:
- this configuration instance
- See Also:
setClearOnFlush(boolean)
-
setEternal
public final void setEternal(boolean eternal)
Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default.- Parameters:
eternal- true for eternal
-
eternal
public final CacheConfiguration eternal(boolean eternal)
Builder which sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired. False by default.- Parameters:
eternal- true for eternal- Returns:
- this configuration instance
- See Also:
setEternal(boolean)
-
setTimeToIdleSeconds
public final void setTimeToIdleSeconds(long timeToIdleSeconds)
Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This can be overidden inElementThis property can be modified dynamically while the cache is operating.
- Parameters:
timeToIdleSeconds- the default amount of time to live for an element from its last accessed or modified date
-
timeToIdleSeconds
public final CacheConfiguration timeToIdleSeconds(long timeToIdleSeconds)
Builder which sets the time to idle for an element before it expires. Is only used if the element is not eternal. This default can be overridden inElementThis property can be modified dynamically while the cache is operating.
- Parameters:
timeToIdleSeconds- the default amount of time to live for an element from its last accessed or modified date- Returns:
- this configuration instance
- See Also:
setTimeToIdleSeconds(long)
-
setTimeToLiveSeconds
public final void setTimeToLiveSeconds(long timeToLiveSeconds)
Sets the time to idle for an element before it expires. Is only used if the element is not eternal. This default can be overridden inElementThis property can be modified dynamically while the cache is operating.
- Parameters:
timeToLiveSeconds- the default amount of time to live for an element from its creation date
-
timeToLiveSeconds
public final CacheConfiguration timeToLiveSeconds(long timeToLiveSeconds)
Builder which sets the time to idle for an element before it expires. Is only used if the element is not eternal. This default can be overridden inElementThis property can be modified dynamically while the cache is operating.
- Parameters:
timeToLiveSeconds- the default amount of time to live for an element from its creation date- Returns:
- this configuration instance
- See Also:
setTimeToLiveSeconds(long)
-
setOverflowToDisk
@Deprecated public final void setOverflowToDisk(boolean overflowToDisk)
Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.Sets whether elements can overflow to disk when the in-memory cache has reached the set limit.- Parameters:
overflowToDisk- whether to use the disk store
-
overflowToDisk
@Deprecated public final CacheConfiguration overflowToDisk(boolean overflowToDisk)
Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.Builder which sets whether elements can overflow to disk when the in-memory cache has reached the set limit.- Parameters:
overflowToDisk- whether to use the disk store- Returns:
- this configuration instance
- See Also:
setOverflowToDisk(boolean)
-
setDiskPersistent
@Deprecated public final void setDiskPersistent(boolean diskPersistent)
Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).Sets whether the disk store persists between CacheManager instances. Note that this operates independently ofoverflowToDisk.- Parameters:
diskPersistent- whether to persist the cache to disk between JVM restarts
-
diskPersistent
@Deprecated public final CacheConfiguration diskPersistent(boolean diskPersistent)
Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).Builder which sets whether the disk store persists between CacheManager instances. Note that this operates independently ofoverflowToDisk.- Parameters:
diskPersistent- whether to persist the cache to disk between JVM restarts.- Returns:
- this configuration instance
- See Also:
setDiskPersistent(boolean)
-
setDiskSpoolBufferSizeMB
public void setDiskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)
Sets the disk spool size, which is used to buffer writes to the DiskStore. If not set it defaults toDEFAULT_SPOOL_BUFFER_SIZE- Parameters:
diskSpoolBufferSizeMB- a positive number
-
diskSpoolBufferSizeMB
public final CacheConfiguration diskSpoolBufferSizeMB(int diskSpoolBufferSizeMB)
Builder which sets the disk spool size, which is used to buffer writes to the DiskStore. If not set it defaults toDEFAULT_SPOOL_BUFFER_SIZE- Parameters:
diskSpoolBufferSizeMB- a positive number- Returns:
- this configuration instance
- See Also:
setDiskSpoolBufferSizeMB(int)
-
setDiskAccessStripes
public void setDiskAccessStripes(int stripes)
Sets the number of disk stripes. RandomAccessFiles used to access the data file. By default there is one stripe.- Parameters:
stripes- number of stripes (rounded up to a power-of-2)
-
diskAccessStripes
public final CacheConfiguration diskAccessStripes(int stripes)
Builder which sets the number of disk stripes. RandomAccessFiles used to access the data file. By default there is one stripe.- Returns:
- this configuration instance
- See Also:
setDiskAccessStripes(int)
-
setMaxElementsOnDisk
public void setMaxElementsOnDisk(int maxElementsOnDisk)
Deprecated.usesetMaxEntriesLocalDisk(long)for unclustered caches andsetMaxEntriesInCache(long)for clustered caches.Sets the maximum number elements on Disk. 0 means unlimited.This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsOnDisk- the maximum number of Elements to allow on the disk. 0 means unlimited.
-
setMaxEntriesInCache
public void setMaxEntriesInCache(long maxEntriesInCache)
Sets the maximum number of entries in the cache. Only applies to terracotta clustered caches.The values for maxEntriesInCache must be equal or superior to 0 and are interpreted as follows:
maxEntriesInCache == 0means no capacity based eviction, but resource based eviction can happen.maxEntriesInCache > 0means both capacity based and resource based eviction can happen
This property can be modified dynamically while the cache is operating.
- Parameters:
maxEntriesInCache- maximum number of entries in cache
-
setMaxEntriesLocalDisk
public void setMaxEntriesLocalDisk(long maxEntriesLocalDisk)
Sets the maximum number elements on Disk. 0 means unlimited.This property can be modified dynamically while the cache is operating.
- Parameters:
maxEntriesLocalDisk- the maximum number of Elements to allow on the disk. 0 means unlimited.
-
maxElementsOnDisk
public final CacheConfiguration maxElementsOnDisk(int maxElementsOnDisk)
Deprecated.usemaxEntriesLocalDisk(int)for unclustered caches andmaxEntriesInCache(long)for clustered caches.Builder which sets the maximum number elements on Disk. 0 means unlimited.This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsOnDisk- the maximum number of Elements to allow on the disk. 0 means unlimited.- Returns:
- this configuration instance
- See Also:
setMaxElementsOnDisk(int)
-
maxEntriesInCache
public final CacheConfiguration maxEntriesInCache(long maxEntriesInCache)
Builder which sets the maximum number entries in cache.This property can be modified dynamically while the cache is operating.
- Parameters:
maxEntriesInCache- the maximum number of entries to allow in the cache.- Returns:
- this configuration instance
- See Also:
setMaxEntriesInCache(long)
-
maxEntriesLocalDisk
public final CacheConfiguration maxEntriesLocalDisk(int maxElementsOnDisk)
Builder which sets the maximum number elements on Disk. 0 means unlimited.This property can be modified dynamically while the cache is operating.
- Parameters:
maxElementsOnDisk- the maximum number of Elements to allow on the disk. 0 means unlimited.- Returns:
- this configuration instance
- See Also:
setMaxElementsOnDisk(int)
-
setDiskExpiryThreadIntervalSeconds
public final void setDiskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)
Sets the interval in seconds between runs of the disk expiry thread.2 minutes is the default. This is not the same thing as time to live or time to idle. When the thread runs it checks these things. So this value is how often we check for expiry.
-
diskExpiryThreadIntervalSeconds
public final CacheConfiguration diskExpiryThreadIntervalSeconds(long diskExpiryThreadIntervalSeconds)
Builder which sets the interval in seconds between runs of the disk expiry thread.2 minutes is the default. This is not the same thing as time to live or time to idle. When the thread runs it checks these things. So this value is how often we check for expiry.
- Returns:
- this configuration instance
- See Also:
setDiskExpiryThreadIntervalSeconds(long)
-
freezeConfiguration
public void freezeConfiguration()
Freeze this configuration. Any subsequent changes will throw a CacheException
-
isFrozen
public boolean isFrozen()
- Returns:
- true is this configuration is frozen - it cannot be changed dynamically.
-
getCopyStrategy
public ReadWriteCopyStrategy<Element> getCopyStrategy()
Getter to the configured ReadWriteCopyStrategy. This will always return the same unique instance per cache- Returns:
- the
ReadWriteCopyStrategyfor instance for this cache
-
copyOnRead
public CacheConfiguration copyOnRead(boolean copyOnRead)
Whether the Cache should copy elements it returns- Parameters:
copyOnRead- true, if copyOnRead
-
isCopyOnRead
public boolean isCopyOnRead()
Whether the Cache should copy elements it returns- Returns:
- true, is copyOnRead
-
setCopyOnRead
public void setCopyOnRead(boolean copyOnRead)
Whether the Cache should copy elements it returns- Parameters:
copyOnRead- true, if copyOnRead
-
copyOnWrite
public CacheConfiguration copyOnWrite(boolean copyOnWrite)
Whether the Cache should copy elements it gets- Parameters:
copyOnWrite- true, if copyOnWrite
-
isCopyOnWrite
public boolean isCopyOnWrite()
Whether the Cache should copy elements it gets- Returns:
- true, if copyOnWrite
-
setCopyOnWrite
public void setCopyOnWrite(boolean copyOnWrite)
Whether the Cache should copy elements it gets- Parameters:
copyOnWrite- true, if copyOnWrite
-
addCopyStrategy
public void addCopyStrategy(CopyStrategyConfiguration copyStrategyConfiguration)
Sets the CopyStrategyConfiguration for this cache- Parameters:
copyStrategyConfiguration- the CopyStrategy Configuration
-
addElementValueComparator
public void addElementValueComparator(ElementValueComparatorConfiguration elementValueComparatorConfiguration)
Sets the ElementValueComparatorConfiguration for this cache The default configuration will setup aDefaultElementValueComparator- Parameters:
elementValueComparatorConfiguration- the ElementComparator Configuration
-
addSearchable
public final void addSearchable(Searchable searchable)
Add configuration to make this cache searchable- Parameters:
searchable- search config to add
-
getMaxBytesLocalHeap
@Deprecated public long getMaxBytesLocalHeap()
Deprecated.UsegetMaxEntriesLocalHeap()insteadThe maximum amount of bytes the cache should occupy on heap- Returns:
- value in bytes, 0 if none set
-
setMaxBytesLocalHeap
@Deprecated public void setMaxBytesLocalHeap(java.lang.String maxBytesHeap)
Deprecated.UsesetMaxEntriesLocalHeap(long)insteadSetter for maxBytesLocalHeap as a String. Value can have a one char unit suffix or be a percentage (ending in %)This property can be modified dynamically while the cache is operating.
- Parameters:
maxBytesHeap- String representation of the size, can be relative (in %)
-
setMaxBytesLocalHeap
@Deprecated public void setMaxBytesLocalHeap(java.lang.Long maxBytesHeap)
Deprecated.UsesetMaxEntriesLocalHeap(long)insteadSetter for maxBytesLocalHeap in bytesThis property can be modified dynamically while the cache is operating.
- Parameters:
maxBytesHeap- max bytes in heap in bytes
-
maxBytesLocalHeap
public CacheConfiguration maxBytesLocalHeap(long amount, MemoryUnit memoryUnit)
Sets the maxOnHeap size- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
-
getMaxBytesLocalOffHeap
public long getMaxBytesLocalOffHeap()
The maximum amount of bytes the cache should occupy off heap- Returns:
- value in bytes, 0 if none set
-
getMaxBytesLocalOffHeapAsString
public java.lang.String getMaxBytesLocalOffHeapAsString()
The string form of the maximum amount of bytes the cache should occupy off heap- Returns:
- value as string in bytes
-
setMaxBytesLocalOffHeap
public void setMaxBytesLocalOffHeap(java.lang.String maxBytesOffHeap)
Setter for maximum bytes off heap as a String. Value can have a one char unit suffix or be a percentage (ending in %)Changes to this property once the cache is operating will have no effect.
- Parameters:
maxBytesOffHeap- String representation of the size, can be relative (in %)
-
getMaxBytesLocalOffHeapPercentage
public java.lang.Integer getMaxBytesLocalOffHeapPercentage()
Getter for maximum bytes off heap expressed as a percentage- Returns:
- percentage (between 0 and 100)
-
getMaxBytesLocalHeapPercentage
@Deprecated public java.lang.Integer getMaxBytesLocalHeapPercentage()
Deprecated.UsesetMaxEntriesLocalHeap(long)insteadGetter for maximum bytes on heap expressed as a percentage- Returns:
- percentage (between 0 and 100)
-
getMaxBytesLocalHeapAsString
@Deprecated public java.lang.String getMaxBytesLocalHeapAsString()
Deprecated.UsegetMaxEntriesLocalHeap()insteadThe string form of the maximum amount of bytes the cache should occupy on heap- Returns:
- value as string in bytes
-
getMaxBytesLocalDiskPercentage
public java.lang.Integer getMaxBytesLocalDiskPercentage()
Getter for maximum bytes on disk expressed as a percentage- Returns:
- percentage (between 0 and 100)
-
setMaxBytesLocalOffHeap
public void setMaxBytesLocalOffHeap(java.lang.Long maxBytesOffHeap)
Sets the maximum amount of bytes the cache being configured will use on the OffHeap tierChanges to this property once the cache is operating will have no effect.
- Parameters:
maxBytesOffHeap- max bytes on disk in bytes
-
maxBytesLocalOffHeap
public CacheConfiguration maxBytesLocalOffHeap(long amount, MemoryUnit memoryUnit)
Sets the maxOffHeap tier sizeChanges to this property once the cache is operating will have no effect.
- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
-
getMaxBytesLocalDisk
public long getMaxBytesLocalDisk()
The maximum amount of bytes the cache should occupy on disk- Returns:
- value in bytes, 0 if none set
-
getMaxBytesLocalDiskAsString
public java.lang.String getMaxBytesLocalDiskAsString()
The string form of the maximum amount of bytes the cache should occupy on disk- Returns:
- value as string in bytes
-
setMaxBytesLocalDisk
public void setMaxBytesLocalDisk(java.lang.String maxBytesDisk)
Setter for maxBytesOnDisk as a String. Value can have a one char unit suffix or be a percentage (ending in %)This property can be modified dynamically while the cache is operating.
- Parameters:
maxBytesDisk- String representation of the size, can be relative (in %)
-
setMaxBytesLocalDisk
public void setMaxBytesLocalDisk(java.lang.Long maxBytesDisk)
Sets the maximum amount of bytes the cache being configured will use on the OnDisk tierThis property can be modified dynamically while the cache is operating.
- Parameters:
maxBytesDisk- max bytes on disk in bytes
-
maxBytesLocalDisk
public CacheConfiguration maxBytesLocalDisk(long amount, MemoryUnit memoryUnit)
Sets the maxOnDisk sizeThis property can be modified dynamically while the cache is operating.
- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
-
setDynamicAttributesExtractor
public void setDynamicAttributesExtractor(DynamicAttributesExtractor extractor)
Sets dynamic search attributes extractor- Parameters:
extractor- extractor to use
-
dynamicAttributeExtractor
public CacheConfiguration dynamicAttributeExtractor(DynamicAttributesExtractor extractor)
Sets dynamic search attributes extractor- Parameters:
extractor- extractor to use- Returns:
- this
-
getCopyStrategyConfiguration
public CopyStrategyConfiguration getCopyStrategyConfiguration()
Returns the copyStrategyConfiguration- Returns:
- the copyStrategyConfiguration
-
getElementValueComparatorConfiguration
public ElementValueComparatorConfiguration getElementValueComparatorConfiguration()
Returns the elementComparatorConfiguration- Returns:
- the elementComparatorConfiguration
-
isMaxBytesLocalHeapPercentageSet
@Deprecated public boolean isMaxBytesLocalHeapPercentageSet()
Deprecated.UsemaxEntriesLocalHeapinsteadChecks whether the user explicitly set the maxBytesOnHeapPercentage- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalHeap(String)
-
isMaxBytesLocalOffHeapPercentageSet
public boolean isMaxBytesLocalOffHeapPercentageSet()
Checks whether the user explicitly set the maxBytesOffHeapPercentage- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalOffHeap(String)
-
isMaxBytesLocalDiskPercentageSet
public boolean isMaxBytesLocalDiskPercentageSet()
Checks whether the user explicitly set the maxBytesOnDiskPercentage- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalDisk(String)
-
setupFor
public void setupFor(CacheManager cacheManager)
Sets up the CacheConfiguration for runtime consumption, also registers this cache configuration with the cache manager's configuration- Parameters:
cacheManager- The CacheManager as part of which the cache is being setup
-
setupFor
public void setupFor(CacheManager cacheManager, boolean register, java.lang.String parentCache)
Sets up the CacheConfiguration for runtime consumption- Parameters:
cacheManager- The CacheManager as part of which the cache is being setupregister- true to register this cache configuration with the cache manager.
-
validate
public java.util.Collection<ConfigError> validate(Configuration configuration)
Validates the configuration- Parameters:
configuration- the CacheManager configuration this is going to be used with- Returns:
- the errors in the config
-
isCountBasedTuned
public boolean isCountBasedTuned()
Whether this cache is Count based- Returns:
- true if maxEntries set, false otherwise
-
isOverflowToOffHeapSet
public boolean isOverflowToOffHeapSet()
Checks whether the overflowing to off heap behavior was explicitly set- Returns:
- true if explicitly set, false otherwise
-
addCacheEventListenerFactory
public final void addCacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)
Used by BeanUtils to add cacheEventListenerFactory elements to the cache configuration.
-
cacheEventListenerFactory
public final CacheConfiguration cacheEventListenerFactory(CacheConfiguration.CacheEventListenerFactoryConfiguration factory)
- Returns:
- this configuration instance
- See Also:
addCacheEventListenerFactory(CacheEventListenerFactoryConfiguration)
-
addCacheExtensionFactory
public final void addCacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)
Used by BeanUtils to add cacheExtensionFactory elements to the cache configuration.
-
cacheExtensionFactory
public final CacheConfiguration cacheExtensionFactory(CacheConfiguration.CacheExtensionFactoryConfiguration factory)
- Returns:
- this configuration instance
- See Also:
addCacheExtensionFactory(CacheExtensionFactoryConfiguration)
-
addBootstrapCacheLoaderFactory
public final void addBootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration factory)
Allows BeanHandler to add the CacheManagerEventListener to the configuration.
-
bootstrapCacheLoaderFactory
public final CacheConfiguration bootstrapCacheLoaderFactory(CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration factory)
- Returns:
- this configuration instance
- See Also:
addBootstrapCacheLoaderFactory(BootstrapCacheLoaderFactoryConfiguration)
-
addCacheExceptionHandlerFactory
public final void addCacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factory)
Add the CacheExceptionHandlerFactory to the configuration.Note that this will not have any effect when creating a cache solely through its constructed. The exception handler will only be taken into account when
ConfigurationHelperis used, for example throughCacheManager.
-
cacheExceptionHandlerFactory
public final CacheConfiguration cacheExceptionHandlerFactory(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factory)
- Returns:
- this configuration instance
- See Also:
addCacheExceptionHandlerFactory(CacheExceptionHandlerFactoryConfiguration)
-
addCacheLoaderFactory
public final void addCacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)
Used by BeanUtils to add each cacheLoaderFactory to the cache configuration.- Parameters:
factory-
-
addCacheDecoratorFactory
public final void addCacheDecoratorFactory(CacheConfiguration.CacheDecoratorFactoryConfiguration factory)
Used by BeanUtils to add each cacheDecoratorFactory to the cache configuration.- Parameters:
factory-
-
cacheLoaderFactory
public final CacheConfiguration cacheLoaderFactory(CacheConfiguration.CacheLoaderFactoryConfiguration factory)
- Returns:
- this configuration instance
- See Also:
addCacheLoaderFactory(CacheLoaderFactoryConfiguration)
-
addTerracotta
public final void addTerracotta(TerracottaConfiguration terracottaConfiguration)
Allows BeanHandler to add the TerracottaConfiguration to the configuration.
-
addPinning
public final void addPinning(PinningConfiguration pinningConfiguration)
Allows BeanHandler to add the PinningConfiguration to the configuration.
-
pinning
public final CacheConfiguration pinning(PinningConfiguration pinningConfiguration)
- Returns:
- this configuration instance
- See Also:
addPinning(PinningConfiguration)
-
terracotta
public final CacheConfiguration terracotta(TerracottaConfiguration terracottaConfiguration)
- Returns:
- this configuration instance
- See Also:
addTerracotta(TerracottaConfiguration)
-
searchable
public final CacheConfiguration searchable(Searchable searchable)
- Parameters:
searchable-- Returns:
- this
- See Also:
addSearchable(Searchable)
-
addCacheWriter
public final void addCacheWriter(CacheWriterConfiguration cacheWriterConfiguration)
Allows BeanHandler to add the CacheWriterConfiguration to the configuration.
-
cacheWriter
public final CacheConfiguration cacheWriter(CacheWriterConfiguration cacheWriterConfiguration)
- Returns:
- this configuration instance
- See Also:
addCacheWriter(CacheWriterConfiguration)
-
setTransactionalMode
public final void setTransactionalMode(java.lang.String transactionalMode)
Sets the transactionalMode- Parameters:
transactionalMode- one of OFF, LOCAL, XA, XA_STRICT
-
transactionalMode
public final CacheConfiguration transactionalMode(java.lang.String transactionalMode)
Builder which sets the transactionalMode- Parameters:
transactionalMode- one of OFF, LOCAL, XA, XA_STRICT- Returns:
- this configuration instance
- See Also:
setTransactionalMode(String)
-
transactionalMode
public final CacheConfiguration transactionalMode(CacheConfiguration.TransactionalMode transactionalMode)
Builder which sets the transactionalMode- Parameters:
transactionalMode- one of OFF, LOCAL, XA, XA_STRICT- Returns:
- this configuration instance
- See Also:
setTransactionalMode(String)
-
setStatistics
@Deprecated public final void setStatistics(boolean enabled)
Deprecated.Sets whether the cache's statistics are enabled. at startup
-
statistics
@Deprecated public final CacheConfiguration statistics(boolean statistics)
Deprecated.Builder which sets whether the cache's statistics are enabled.- Returns:
- this configuration instance
- See Also:
setStatistics(boolean)
-
getStatistics
public final boolean getStatistics()
Gets whether the cache's statistics will be enabled at startup
-
validateCompleteConfiguration
public void validateCompleteConfiguration()
Used to validate what should be a complete Cache Configuration.
-
validateConfiguration
public void validateConfiguration()
Used to validate a Cache Configuration.
-
getName
public java.lang.String getName()
Accessor
-
getMaxElementsInMemory
@Deprecated public int getMaxElementsInMemory()
Deprecated.Accessor
-
getCacheLoaderTimeoutMillis
public long getCacheLoaderTimeoutMillis()
Accessor
-
getMaxElementsOnDisk
public int getMaxElementsOnDisk()
Deprecated.usegetMaxEntriesLocalDisk()for unclustered caches andgetMaxEntriesInCache()for clustered caches.Accessor
-
getMaxEntriesInCache
public long getMaxEntriesInCache()
Accessor
-
getMaxEntriesLocalDisk
public long getMaxEntriesLocalDisk()
Configured maximum number of entries for the local disk store.
-
getMaxEntriesLocalHeap
public long getMaxEntriesLocalHeap()
Configured maximum number of entries for the local memory heap.
-
getMemoryStoreEvictionPolicy
public MemoryStoreEvictionPolicy getMemoryStoreEvictionPolicy()
Accessor
-
isClearOnFlush
public boolean isClearOnFlush()
Accessor
-
isEternal
public boolean isEternal()
Accessor
-
getTimeToIdleSeconds
public long getTimeToIdleSeconds()
Accessor
-
getTimeToLiveSeconds
public long getTimeToLiveSeconds()
Accessor
-
isOverflowToDisk
@Deprecated public boolean isOverflowToDisk()
Deprecated.TheoverflowToDiskattribute has been replaced withPersistenceConfiguration.Strategy.LOCALTEMPSWAP.Accessor
-
isDiskPersistent
@Deprecated public boolean isDiskPersistent()
Deprecated.ThediskPersistentattribute has been replaced withpersistence(PersistenceConfiguration).Accessor
-
isSearchable
public boolean isSearchable()
Accessor
-
getDiskSpoolBufferSizeMB
public int getDiskSpoolBufferSizeMB()
Accessor
-
getDiskExpiryThreadIntervalSeconds
public long getDiskExpiryThreadIntervalSeconds()
Accessor
-
getDiskAccessStripes
public int getDiskAccessStripes()
Accessor
-
getDynamicExtractor
public DynamicAttributesExtractor getDynamicExtractor()
Accessor
-
getLogging
public boolean getLogging()
Only used when cache is clustered with Terracotta- Returns:
- true if logging is enabled otherwise false
-
isOverflowToOffHeap
public boolean isOverflowToOffHeap()
Accessor- Returns:
- true if offheap store is enabled, otherwise false.
-
getSizeOfPolicyConfiguration
public SizeOfPolicyConfiguration getSizeOfPolicyConfiguration()
Accessor- Returns:
- the SizeOfPolicy Configuration for this cache.
-
getPersistenceConfiguration
public PersistenceConfiguration getPersistenceConfiguration()
Accessor- Returns:
- the persistence configuration for this cache.
-
getMaxMemoryOffHeap
@Deprecated public java.lang.String getMaxMemoryOffHeap()
Deprecated.Accessor- Returns:
- the max memory of the offheap store for this cache.
-
getMaxMemoryOffHeapInBytes
@Deprecated public long getMaxMemoryOffHeapInBytes()
Deprecated.Accessor- Returns:
- the max memory of the offheap store for this cache, in bytes.
-
getCacheEventListenerConfigurations
public java.util.List getCacheEventListenerConfigurations()
Accessor
-
getCacheExtensionConfigurations
public java.util.List getCacheExtensionConfigurations()
Accessor- Returns:
- the configuration
-
getCacheLoaderConfigurations
public java.util.List getCacheLoaderConfigurations()
Accessor- Returns:
- the configuration
-
getCacheDecoratorConfigurations
public java.util.List<CacheConfiguration.CacheDecoratorFactoryConfiguration> getCacheDecoratorConfigurations()
Accessor- Returns:
- the configuration
-
getBootstrapCacheLoaderFactoryConfiguration
public CacheConfiguration.BootstrapCacheLoaderFactoryConfiguration getBootstrapCacheLoaderFactoryConfiguration()
Accessor- Returns:
- the configuration
-
getCacheExceptionHandlerFactoryConfiguration
public CacheConfiguration.CacheExceptionHandlerFactoryConfiguration getCacheExceptionHandlerFactoryConfiguration()
Accessor- Returns:
- the configuration
-
getTerracottaConfiguration
public TerracottaConfiguration getTerracottaConfiguration()
Accessor- Returns:
- the terracotta configuration
-
getPinningConfiguration
public PinningConfiguration getPinningConfiguration()
Accessor- Returns:
- the pinning configuration
-
getCacheWriterConfiguration
public CacheWriterConfiguration getCacheWriterConfiguration()
Accessor- Returns:
- the writer configuration
-
isTerracottaClustered
public boolean isTerracottaClustered()
Helper method to compute whether the cache is clustered or not- Returns:
- True if the <terracotta/> element exists with
clustered="true"
-
getTerracottaConsistency
public TerracottaConfiguration.Consistency getTerracottaConsistency()
Accessor- Returns:
- the CoherenceMode if Terracotta-clustered or null
-
getTransactionalMode
public final CacheConfiguration.TransactionalMode getTransactionalMode()
To what transactionalMode was the Cache set- Returns:
- transactionaMode
-
isXaStrictTransactional
public boolean isXaStrictTransactional()
Helper method to compute whether the cache is XA transactional or not- Returns:
- true if transactionalMode="xa_strict"
-
isLocalTransactional
public boolean isLocalTransactional()
Helper method to compute whether the cache is local transactional or not- Returns:
- true if transactionalMode="local"
-
isXaTransactional
public boolean isXaTransactional()
Helper method to compute whether the cache is local_jta transactional or not- Returns:
- true if transactionalMode="xa"
-
addConfigurationListener
public boolean addConfigurationListener(CacheConfigurationListener listener)
Add a listener to this cache configuration- Parameters:
listener- listener instance to add- Returns:
- true if a listener was added
-
addDynamicSearchListener
public boolean addDynamicSearchListener(DynamicSearchListener listener)
Add a dynamic extractor configuration listener- Parameters:
listener-- Returns:
- true if a listener was added
-
removeConfigurationListener
public boolean removeConfigurationListener(CacheConfigurationListener listener)
Remove the supplied cache configuration listener.- Parameters:
listener- listener to remove- Returns:
- true if a listener was removed
-
internalSetTimeToIdle
public void internalSetTimeToIdle(long timeToIdle)
Intended for internal use only, and subject to change. This is required so that changes in store implementation's config (probably from other nodes) can propagate up to here
-
internalSetTimeToLive
public void internalSetTimeToLive(long timeToLive)
Intended for internal use only, and subject to change.
-
internalSetEternal
public void internalSetEternal(boolean eternal)
Intended for internal use only, and subject to change.
-
internalSetMemCapacity
public void internalSetMemCapacity(int capacity)
Intended for internal use only, and subject to change.
-
internalSetMemCapacityInBytes
@Deprecated public void internalSetMemCapacityInBytes(long capacity)
Deprecated.UseinternalSetMemCapacity(int)insteadIntended for internal use only, and subject to change.
-
internalSetDiskCapacity
public void internalSetDiskCapacity(int capacity)
Intended for internal use only, and subject to change.
-
internalSetMaxEntriesInCache
public void internalSetMaxEntriesInCache(int entries)
Intended for internal use only, and subject to change.
-
internalSetLogging
public void internalSetLogging(boolean logging)
Intended for internal use only, and subject to change.
-
internalSetMaxBytesLocalOffheap
public void internalSetMaxBytesLocalOffheap(long maxBytesLocalOffheap)
Intended for internal use only, and subject to change.
-
internalSetOverflowToOffheap
public void internalSetOverflowToOffheap(boolean overflowToOffHeap)
Intended for internal use only, and subject to change.
-
getSearchAttributes
public java.util.Map<java.lang.String,SearchAttribute> getSearchAttributes()
Get the defined search attributes indexed by attribute name- Returns:
- search attributes
-
getSearchable
public Searchable getSearchable()
Get the search configuration for this cache (if any)- Returns:
- search config (may be null)
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
-
-