Package org.bonitasoft.engine.cache
Class CacheConfiguration
- java.lang.Object
-
- org.bonitasoft.engine.cache.CacheConfiguration
-
public class CacheConfiguration extends java.lang.Object- Author:
- Emmanuel Duchastenier
-
-
Constructor Summary
Constructors Constructor Description CacheConfiguration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetEvictionPolicy()intgetMaxElementsInMemory()the maximum number of elements the cache will keep in memoryintgetMaxElementsOnDisk()the maximum number of element the cache will keep on disk after the limit of elements in memory is reachedjava.lang.StringgetName()longgetTimeToLiveSeconds()The time to live is the time elements from this cache will be kept.booleanisCopyOnRead()booleanisCopyOnWrite()booleanisEternal()true if the elements are never evicted automaticallybooleanisInMemoryOnly()if true nothing is stored on diskbooleanisReadIntensive()Are the elements stored in the cache read more often than written ?voidsetCopyOnRead(boolean copyOnRead)voidsetCopyOnWrite(boolean copyOnWrite)voidsetEternal(boolean eternal)voidsetEvictionPolicy(java.lang.String evictionPolicy)most implementation support LRU and LFU some implementation (ehcache) support FIFO also by default set to LRUvoidsetInMemoryOnly(boolean inMemoryOnly)voidsetMaxElementsInMemory(int maxElementsInMemory)voidsetMaxElementsOnDisk(int maxElementsOnDisk)voidsetName(java.lang.String name)voidsetReadIntensive(boolean readIntensive)voidsetTimeToLiveSeconds(long timeToLiveSeconds)
-
-
-
Method Detail
-
getEvictionPolicy
public java.lang.String getEvictionPolicy()
- Returns:
- the evictionPolicy
-
setEvictionPolicy
public void setEvictionPolicy(java.lang.String evictionPolicy)
most implementation support LRU and LFU some implementation (ehcache) support FIFO also by default set to LRU- Parameters:
evictionPolicy- the evictionPolicy to set
-
isEternal
public boolean isEternal()
true if the elements are never evicted automatically- Returns:
- the eternal
-
setEternal
public void setEternal(boolean eternal)
- Parameters:
eternal- the eternal to set
-
getTimeToLiveSeconds
public long getTimeToLiveSeconds()
The time to live is the time elements from this cache will be kept. After this time the element can be evicted- Returns:
- the timeToLiveSeconds
-
getMaxElementsInMemory
public int getMaxElementsInMemory()
the maximum number of elements the cache will keep in memory- Returns:
- the maxElementsInMemory
-
getMaxElementsOnDisk
public int getMaxElementsOnDisk()
the maximum number of element the cache will keep on disk after the limit of elements in memory is reached- Returns:
- the maxElementsOnDisk
-
isInMemoryOnly
public boolean isInMemoryOnly()
if true nothing is stored on disk- Returns:
- the inMemoryOnly
-
setTimeToLiveSeconds
public void setTimeToLiveSeconds(long timeToLiveSeconds)
- Parameters:
timeToLiveSeconds- the timeToLiveSeconds to set
-
setMaxElementsInMemory
public void setMaxElementsInMemory(int maxElementsInMemory)
- Parameters:
maxElementsInMemory- the maxElementsInMemory to set
-
setMaxElementsOnDisk
public void setMaxElementsOnDisk(int maxElementsOnDisk)
- Parameters:
maxElementsOnDisk- the maxElementsOnDisk to set
-
setInMemoryOnly
public void setInMemoryOnly(boolean inMemoryOnly)
- Parameters:
inMemoryOnly- the inMemoryOnly to set
-
setName
public void setName(java.lang.String name)
-
getName
public java.lang.String getName()
-
isReadIntensive
public boolean isReadIntensive()
Are the elements stored in the cache read more often than written ?- Returns:
- readIntensive
-
setReadIntensive
public void setReadIntensive(boolean readIntensive)
- Parameters:
readIntensive- the readIntensive to set
-
isCopyOnRead
public boolean isCopyOnRead()
-
setCopyOnRead
public void setCopyOnRead(boolean copyOnRead)
-
isCopyOnWrite
public boolean isCopyOnWrite()
-
setCopyOnWrite
public void setCopyOnWrite(boolean copyOnWrite)
-
-