net.sf.ehcache.config
Class Configuration.Cache

java.lang.Object
  extended bynet.sf.ehcache.config.Configuration.Cache
Direct Known Subclasses:
Configuration.DefaultCache
Enclosing class:
Configuration

public static class Configuration.Cache
extends java.lang.Object

A class to represent Cache configuration e.g.


Field Summary
protected  boolean eternal
          Sets whether elements are eternal.
protected  int maxElementsInMemory
          the maximum objects to be held in memory
protected  java.lang.String name
          the name of the cache
protected  boolean overflowToDisk
          whether elements can overflow to disk when the in-memory cache has reached the set limit.
protected  int timeToIdleSeconds
          the time to idle for an element before it expires.
protected  int timeToLiveSeconds
          Sets the time to idle for an element before it expires.
 
Constructor Summary
Configuration.Cache()
           
 
Method Summary
 void setEternal(boolean eternal)
          Sets whether elements are eternal.
 void setMaxElementsInMemory(int maxElementsInMemory)
          Sets the maximum objects to be held in memory
 void setName(java.lang.String name)
          Sets the name of the cache.
 void setOverflowToDisk(boolean overflowToDisk)
          Sets whether elements can overflow to disk when the in-memory cache has reached the set limit.
 void setTimeToIdleSeconds(int timeToIdleSeconds)
          Sets the time to idle for an element before it expires.
 void setTimeToLiveSeconds(int timeToLiveSeconds)
          Sets the time to idle for an element before it expires.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
the name of the cache


maxElementsInMemory

protected int maxElementsInMemory
the maximum objects to be held in memory


eternal

protected boolean eternal
Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired.


timeToIdleSeconds

protected int timeToIdleSeconds
the time to idle for an element before it expires. Is only used if the element is not eternal.


timeToLiveSeconds

protected int timeToLiveSeconds
Sets the time to idle for an element before it expires. Is only used if the element is not eternal.


overflowToDisk

protected boolean overflowToDisk
whether elements can overflow to disk when the in-memory cache has reached the set limit.

Constructor Detail

Configuration.Cache

public Configuration.Cache()
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the cache. This must be unique


setMaxElementsInMemory

public void setMaxElementsInMemory(int maxElementsInMemory)
Sets the maximum objects to be held in memory


setEternal

public void setEternal(boolean eternal)
Sets whether elements are eternal. If eternal, timeouts are ignored and the element is never expired.


setTimeToIdleSeconds

public void setTimeToIdleSeconds(int timeToIdleSeconds)
Sets the time to idle for an element before it expires. Is only used if the element is not eternal.


setTimeToLiveSeconds

public void setTimeToLiveSeconds(int timeToLiveSeconds)
Sets the time to idle for an element before it expires. Is only used if the element is not eternal.


setOverflowToDisk

public void setOverflowToDisk(boolean overflowToDisk)
Sets whether elements can overflow to disk when the in-memory cache has reached the set limit.