org.apache.jcs.engine
Class CompositeCacheAttributes

java.lang.Object
  extended by org.apache.jcs.engine.CompositeCacheAttributes
All Implemented Interfaces:
Serializable, Cloneable, ICompositeCacheAttributes

public class CompositeCacheAttributes
extends Object
implements ICompositeCacheAttributes, Cloneable

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:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.jcs.engine.behavior.ICompositeCacheAttributes
DISK_USAGE_PATTERN_SWAP, DISK_USAGE_PATTERN_UPDATE
 
Constructor Summary
CompositeCacheAttributes()
          Constructor for the CompositeCacheAttributes object
 
Method Summary
 ICompositeCacheAttributes copy()
          Description of the Method
 String getCacheName()
          Gets the cacheName attribute of the CompositeCacheAttributes object
 short getDiskUsagePattern()
           
 long getMaxMemoryIdleTimeSeconds()
          If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.
 int getMaxObjects()
          Gets the maxObjects attribute of the CompositeCacheAttributes object
 int getMaxSpoolPerRun()
          If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.
 String getMemoryCacheName()
          Gets the memoryCacheName attribute of the CompositeCacheAttributes object
 long getShrinkerIntervalSeconds()
          If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.
 int getSpoolChunkSize()
          Number to send to disk at at time when memory is full.
 boolean getUseDisk()
          Gets the useDisk attribute of the CompositeCacheAttributes object
 boolean getUseLateral()
          Gets the useLateral attribute of the CompositeCacheAttributes object
 boolean getUseMemoryShrinker()
          Whether the memory cache should perform background memory shrinkage.
 boolean getUseRemote()
          Gets the useRemote attribute of the CompositeCacheAttributes object
 void setCacheName(String s)
          Sets the cacheName attribute of the CompositeCacheAttributes object
 void setDiskUsagePattern(short 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 object
 void setMaxSpoolPerRun(int maxSpoolPerRun)
          If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.
 void setMemoryCacheName(String s)
          Sets the memoryCacheName attribute of the CompositeCacheAttributes object
 void 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 object
 void setUseLateral(boolean b)
          Sets the useLateral attribute of the CompositeCacheAttributes object
 void setUseMemoryShrinker(boolean useShrinker)
          Whether the memory cache should perform background memory shrinkage.
 void setUseRemote(boolean useRemote)
          Sets the useRemote attribute of the CompositeCacheAttributes object
 String toString()
          Dumps the core attributes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompositeCacheAttributes

public CompositeCacheAttributes()
Constructor for the CompositeCacheAttributes object

Method Detail

setMaxObjects

public void setMaxObjects(int maxObjs)
Sets the maxObjects attribute of the CompositeCacheAttributes object

Specified by:
setMaxObjects in interface ICompositeCacheAttributes
Parameters:
maxObjs - The new maxObjects value

getMaxObjects

public int getMaxObjects()
Gets the maxObjects attribute of the CompositeCacheAttributes object

Specified by:
getMaxObjects in interface ICompositeCacheAttributes
Returns:
The maxObjects value

setUseDisk

public void setUseDisk(boolean useDisk)
Sets the useDisk attribute of the CompositeCacheAttributes object

Specified by:
setUseDisk in interface ICompositeCacheAttributes
Parameters:
useDisk - The new useDisk value

getUseDisk

public boolean getUseDisk()
Gets the useDisk attribute of the CompositeCacheAttributes object

Specified by:
getUseDisk in interface ICompositeCacheAttributes
Returns:
The useDisk value

setUseLateral

public void setUseLateral(boolean b)
Sets the useLateral attribute of the CompositeCacheAttributes object

Specified by:
setUseLateral in interface ICompositeCacheAttributes
Parameters:
b - The new useLateral value

getUseLateral

public boolean getUseLateral()
Gets the useLateral attribute of the CompositeCacheAttributes object

Specified by:
getUseLateral in interface ICompositeCacheAttributes
Returns:
The useLateral value

setUseRemote

public void setUseRemote(boolean useRemote)
Sets the useRemote attribute of the CompositeCacheAttributes object

Specified by:
setUseRemote in interface ICompositeCacheAttributes
Parameters:
useRemote - The new useRemote value

getUseRemote

public boolean getUseRemote()
Gets the useRemote attribute of the CompositeCacheAttributes object

Specified by:
getUseRemote in interface ICompositeCacheAttributes
Returns:
The useRemote value

setCacheName

public void setCacheName(String s)
Sets the cacheName attribute of the CompositeCacheAttributes object

Specified by:
setCacheName in interface ICompositeCacheAttributes
Parameters:
s - The new cacheName value

getCacheName

public String getCacheName()
Gets the cacheName attribute of the CompositeCacheAttributes object

Specified by:
getCacheName in interface ICompositeCacheAttributes
Returns:
The cacheName value

setMemoryCacheName

public void setMemoryCacheName(String s)
Sets the memoryCacheName attribute of the CompositeCacheAttributes object

Specified by:
setMemoryCacheName in interface ICompositeCacheAttributes
Parameters:
s - The new memoryCacheName value

getMemoryCacheName

public String getMemoryCacheName()
Gets the memoryCacheName attribute of the CompositeCacheAttributes object

Specified by:
getMemoryCacheName in interface ICompositeCacheAttributes
Returns:
The memoryCacheName value

setUseMemoryShrinker

public void setUseMemoryShrinker(boolean useShrinker)
Whether the memory cache should perform background memory shrinkage.

Specified by:
setUseMemoryShrinker in interface ICompositeCacheAttributes
Parameters:
useShrinker - The new UseMemoryShrinker value

getUseMemoryShrinker

public boolean getUseMemoryShrinker()
Whether the memory cache should perform background memory shrinkage.

Specified by:
getUseMemoryShrinker in interface ICompositeCacheAttributes
Returns:
The UseMemoryShrinker value

setMaxMemoryIdleTimeSeconds

public void setMaxMemoryIdleTimeSeconds(long seconds)
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.

Specified by:
setMaxMemoryIdleTimeSeconds in interface ICompositeCacheAttributes
Parameters:
seconds - The new MaxMemoryIdleTimeSeconds value

getMaxMemoryIdleTimeSeconds

public long getMaxMemoryIdleTimeSeconds()
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space.

Specified by:
getMaxMemoryIdleTimeSeconds in interface ICompositeCacheAttributes
Returns:
The MaxMemoryIdleTimeSeconds value

setShrinkerIntervalSeconds

public void setShrinkerIntervalSeconds(long seconds)
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This sets the shrinker interval.

Specified by:
setShrinkerIntervalSeconds in interface ICompositeCacheAttributes
Parameters:
seconds - The new ShrinkerIntervalSeconds value

getShrinkerIntervalSeconds

public long getShrinkerIntervalSeconds()
If UseMemoryShrinker is true the memory cache should auto-expire elements to reclaim space. This gets the shrinker interval.

Specified by:
getShrinkerIntervalSeconds in interface ICompositeCacheAttributes
Returns:
The ShrinkerIntervalSeconds value

setMaxSpoolPerRun

public void setMaxSpoolPerRun(int maxSpoolPerRun)
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 interface ICompositeCacheAttributes
Parameters:
maxSpoolPerRun - The new maxSpoolPerRun value

getMaxSpoolPerRun

public int 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 interface ICompositeCacheAttributes
Returns:
The maxSpoolPerRun value

setDiskUsagePattern

public void setDiskUsagePattern(short diskUsagePattern)
By default this is SWAP_ONLY.

Specified by:
setDiskUsagePattern in interface ICompositeCacheAttributes
Parameters:
diskUsagePattern - The diskUsagePattern to set.

setDiskUsagePatternName

public void setDiskUsagePatternName(String diskUsagePatternName)
Translates the name to the disk usage pattern short value.

The allowed values are SWAP and UPDATE.

Specified by:
setDiskUsagePatternName in interface ICompositeCacheAttributes
Parameters:
diskUsagePatternName - The diskUsagePattern to set.

getSpoolChunkSize

public int getSpoolChunkSize()
Number to send to disk at at time when memory is full.

Specified by:
getSpoolChunkSize in interface ICompositeCacheAttributes
Returns:
int

setSpoolChunkSize

public void setSpoolChunkSize(int spoolChunkSize)
Number to send to disk at a time.

Specified by:
setSpoolChunkSize in interface ICompositeCacheAttributes
Parameters:
spoolChunkSize -

getDiskUsagePattern

public short getDiskUsagePattern()
Specified by:
getDiskUsagePattern in interface ICompositeCacheAttributes
Returns:
Returns the diskUsagePattern.

copy

public ICompositeCacheAttributes copy()
Description of the Method

Specified by:
copy in interface ICompositeCacheAttributes
Returns:
ICompositeCacheAttributes a copy

toString

public String toString()
Dumps the core attributes.

Overrides:
toString in class Object
Returns:
For debugging.


Copyright © 2002-2012 Apache Software Foundation. All Rights Reserved.