Package org.apache.commons.jcs3.engine
Class CompositeCacheAttributes
java.lang.Object
org.apache.commons.jcs3.engine.CompositeCacheAttributes
- All Implemented Interfaces:
Serializable
,Cloneable
,ICompositeCacheAttributes
The CompositeCacheAttributes defines the general cache region settings. If a region is not
explicitly defined in the cache.ccf then it inherits the cache default settings.
If all the default attributes are not defined in the default region definition in the cache.ccf, the hard coded defaults will be used.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.commons.jcs3.engine.behavior.ICompositeCacheAttributes
ICompositeCacheAttributes.DiskUsagePattern
-
Constructor Summary
ConstructorDescriptionConstructor for the CompositeCacheAttributes object -
Method Summary
Modifier and TypeMethodDescriptionclone()
Clone objectGets the cacheName attribute of the CompositeCacheAttributes objectlong
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.int
Gets the maxObjects attribute of the CompositeCacheAttributes objectint
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.Gets the memoryCacheName attribute of the CompositeCacheAttributes objectlong
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.int
Number to send to disk at the time when memory is full.boolean
Gets the useDisk attribute of the CompositeCacheAttributes objectboolean
Gets the useLateral attribute of the CompositeCacheAttributes objectboolean
Whether the memory cache should perform background memory shrinkage.boolean
Gets the useRemote attribute of the CompositeCacheAttributes objectvoid
Sets the cacheName attribute of the CompositeCacheAttributes objectvoid
setDiskUsagePattern
(ICompositeCacheAttributes.DiskUsagePattern diskUsagePattern) By default this is SWAP_ONLY.void
setDiskUsagePatternName
(String diskUsagePatternName) Translates the name to the disk usage pattern short value.void
setMaxMemoryIdleTimeSeconds
(long seconds) If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.void
setMaxObjects
(int maxObjs) Sets the maxObjects attribute of the CompositeCacheAttributes objectvoid
setMaxSpoolPerRun
(int maxSpoolPerRun) If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.void
Sets the memoryCacheName attribute of the CompositeCacheAttributes objectvoid
setShrinkerIntervalSeconds
(long seconds) If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.void
setSpoolChunkSize
(int spoolChunkSize) Number to send to disk at a time.void
setUseDisk
(boolean useDisk) Sets the useDisk attribute of the CompositeCacheAttributes objectvoid
setUseLateral
(boolean b) Sets the useLateral attribute of the CompositeCacheAttributes objectvoid
setUseMemoryShrinker
(boolean useShrinker) Whether the memory cache should perform background memory shrinkage.void
setUseRemote
(boolean useRemote) Sets the useRemote attribute of the CompositeCacheAttributes objecttoString()
Dumps the core attributes.
-
Constructor Details
-
CompositeCacheAttributes
public CompositeCacheAttributes()Constructor for the CompositeCacheAttributes object
-
-
Method Details
-
setMaxObjects
Sets the maxObjects attribute of the CompositeCacheAttributes object- Specified by:
setMaxObjects
in interfaceICompositeCacheAttributes
- Parameters:
maxObjs
- The new maxObjects value
-
getMaxObjects
Gets the maxObjects attribute of the CompositeCacheAttributes object- Specified by:
getMaxObjects
in interfaceICompositeCacheAttributes
- Returns:
- The maxObjects value
-
setUseDisk
Sets the useDisk attribute of the CompositeCacheAttributes object- Specified by:
setUseDisk
in interfaceICompositeCacheAttributes
- Parameters:
useDisk
- The new useDisk value
-
isUseDisk
Gets the useDisk attribute of the CompositeCacheAttributes object- Specified by:
isUseDisk
in interfaceICompositeCacheAttributes
- Returns:
- The useDisk value
-
setUseLateral
Sets the useLateral attribute of the CompositeCacheAttributes object- Specified by:
setUseLateral
in interfaceICompositeCacheAttributes
- Parameters:
b
- The new useLateral value
-
isUseLateral
Gets the useLateral attribute of the CompositeCacheAttributes object- Specified by:
isUseLateral
in interfaceICompositeCacheAttributes
- Returns:
- The useLateral value
-
setUseRemote
Sets the useRemote attribute of the CompositeCacheAttributes object- Specified by:
setUseRemote
in interfaceICompositeCacheAttributes
- Parameters:
useRemote
- The new useRemote value
-
isUseRemote
Gets the useRemote attribute of the CompositeCacheAttributes object- Specified by:
isUseRemote
in interfaceICompositeCacheAttributes
- Returns:
- The useRemote value
-
setCacheName
Sets the cacheName attribute of the CompositeCacheAttributes object- Specified by:
setCacheName
in interfaceICompositeCacheAttributes
- Parameters:
s
- The new cacheName value
-
getCacheName
Gets the cacheName attribute of the CompositeCacheAttributes object- Specified by:
getCacheName
in interfaceICompositeCacheAttributes
- Returns:
- The cacheName value
-
setMemoryCacheName
Sets the memoryCacheName attribute of the CompositeCacheAttributes object- Specified by:
setMemoryCacheName
in interfaceICompositeCacheAttributes
- Parameters:
s
- The new memoryCacheName value
-
getMemoryCacheName
Gets the memoryCacheName attribute of the CompositeCacheAttributes object- Specified by:
getMemoryCacheName
in interfaceICompositeCacheAttributes
- Returns:
- The memoryCacheName value
-
setUseMemoryShrinker
Whether the memory cache should perform background memory shrinkage.- Specified by:
setUseMemoryShrinker
in interfaceICompositeCacheAttributes
- Parameters:
useShrinker
- The new UseMemoryShrinker value
-
isUseMemoryShrinker
Whether the memory cache should perform background memory shrinkage.- Specified by:
isUseMemoryShrinker
in interfaceICompositeCacheAttributes
- Returns:
- The UseMemoryShrinker value
-
setMaxMemoryIdleTimeSeconds
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.- Specified by:
setMaxMemoryIdleTimeSeconds
in interfaceICompositeCacheAttributes
- Parameters:
seconds
- The new MaxMemoryIdleTimeSeconds value
-
getMaxMemoryIdleTimeSeconds
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.- Specified by:
getMaxMemoryIdleTimeSeconds
in interfaceICompositeCacheAttributes
- Returns:
- The MaxMemoryIdleTimeSeconds value
-
setShrinkerIntervalSeconds
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This sets the shrinker interval.- Specified by:
setShrinkerIntervalSeconds
in interfaceICompositeCacheAttributes
- Parameters:
seconds
- The new ShrinkerIntervalSeconds value
-
getShrinkerIntervalSeconds
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This gets the shrinker interval.- Specified by:
getShrinkerIntervalSeconds
in interfaceICompositeCacheAttributes
- Returns:
- The ShrinkerIntervalSeconds value
-
setMaxSpoolPerRun
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This sets the maximum number of items to spool per run.If the value is -1, then there is no limit to the number of items to be spooled.
- Specified by:
setMaxSpoolPerRun
in interfaceICompositeCacheAttributes
- Parameters:
maxSpoolPerRun
- The new maxSpoolPerRun value
-
getMaxSpoolPerRun
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This gets the maximum number of items to spool per run.- Specified by:
getMaxSpoolPerRun
in interfaceICompositeCacheAttributes
- Returns:
- The maxSpoolPerRun value
-
setDiskUsagePattern
By default this is SWAP_ONLY.- Specified by:
setDiskUsagePattern
in interfaceICompositeCacheAttributes
- Parameters:
diskUsagePattern
- The diskUsagePattern to set.
-
setDiskUsagePatternName
Translates the name to the disk usage pattern short value.The allowed values are SWAP and UPDATE.
- Specified by:
setDiskUsagePatternName
in interfaceICompositeCacheAttributes
- Parameters:
diskUsagePatternName
- The diskUsagePattern to set.
-
getSpoolChunkSize
Number to send to disk at the time when memory is full.- Specified by:
getSpoolChunkSize
in interfaceICompositeCacheAttributes
- Returns:
- int
-
setSpoolChunkSize
Number to send to disk at a time.- Specified by:
setSpoolChunkSize
in interfaceICompositeCacheAttributes
- Parameters:
spoolChunkSize
-
-
getDiskUsagePattern
- Specified by:
getDiskUsagePattern
in interfaceICompositeCacheAttributes
- Returns:
- Returns the diskUsagePattern.
-
toString
Dumps the core attributes. -
clone
Description copied from interface:ICompositeCacheAttributes
Clone object- Specified by:
clone
in interfaceICompositeCacheAttributes
- Overrides:
clone
in classObject
- See Also:
-