public class CacheConfiguration
extends java.lang.Object
| Constructor and Description |
|---|
CacheConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getEvictionPolicy() |
int |
getMaxElementsInMemory()
the maximum number of elements the cache will keep in memory
|
int |
getMaxElementsOnDisk()
the maximum number of element the cache will keep on disk after the limit of elements in memory is reached
|
java.lang.String |
getName() |
long |
getTimeToLiveSeconds()
The time to live is the time elements from this cache will be kept.
|
boolean |
isCopyOnRead() |
boolean |
isCopyOnWrite() |
boolean |
isEternal()
true if the elements are never evicted automatically
|
boolean |
isInMemoryOnly()
if true nothing is stored on disk
|
boolean |
isReadIntensive()
Are the elements stored in the cache read more often than written ?
|
void |
setCopyOnRead(boolean copyOnRead) |
void |
setCopyOnWrite(boolean copyOnWrite) |
void |
setEternal(boolean eternal) |
void |
setEvictionPolicy(java.lang.String evictionPolicy)
most implementation support LRU and LFU
some implementation (ehcache) support FIFO also
by default set to LRU
|
void |
setInMemoryOnly(boolean inMemoryOnly) |
void |
setMaxElementsInMemory(int maxElementsInMemory) |
void |
setMaxElementsOnDisk(int maxElementsOnDisk) |
void |
setName(java.lang.String name) |
void |
setReadIntensive(boolean readIntensive) |
void |
setTimeToLiveSeconds(long timeToLiveSeconds) |
public java.lang.String getEvictionPolicy()
public void setEvictionPolicy(java.lang.String evictionPolicy)
evictionPolicy - the evictionPolicy to setpublic boolean isEternal()
public void setEternal(boolean eternal)
eternal - the eternal to setpublic long getTimeToLiveSeconds()
public int getMaxElementsInMemory()
public int getMaxElementsOnDisk()
public boolean isInMemoryOnly()
public void setTimeToLiveSeconds(long timeToLiveSeconds)
timeToLiveSeconds - the timeToLiveSeconds to setpublic void setMaxElementsInMemory(int maxElementsInMemory)
maxElementsInMemory - the maxElementsInMemory to setpublic void setMaxElementsOnDisk(int maxElementsOnDisk)
maxElementsOnDisk - the maxElementsOnDisk to setpublic void setInMemoryOnly(boolean inMemoryOnly)
inMemoryOnly - the inMemoryOnly to setpublic void setName(java.lang.String name)
public java.lang.String getName()
public boolean isReadIntensive()
public void setReadIntensive(boolean readIntensive)
readIntensive - the readIntensive to setpublic boolean isCopyOnRead()
public void setCopyOnRead(boolean copyOnRead)
public boolean isCopyOnWrite()
public void setCopyOnWrite(boolean copyOnWrite)