Package org.frankframework.cache
Class EhCache<V>
java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<V>
org.frankframework.cache.EhCache<V>
- All Implemented Interfaces:
ICache<String,
,V> IConfigurationAware
,IScopeProvider
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
General Cache provider.
N.B. the default values shown can be overridden using properties in appConstants. The property names are found by prefixing the attribute name with
cache.default.
.- Since:
- 4.11
- Author:
- Gerrit van Brakel
-
Field Summary
Fields inherited from class org.frankframework.cache.AbstractCacheAdapter
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
int
protected V
getElement
(String key) int
int
int
int
boolean
boolean
boolean
void
open()
protected void
putElement
(String key, V value) protected boolean
removeElement
(Object key) void
setDiskExpiryThreadIntervalSeconds
(int diskExpiryThreadIntervalSeconds) How often to run the disk store expiry threadvoid
setDiskPersistent
(boolean diskPersistent) Iftrue
, the cache is stored on disk and survives configuration reloads & JVM restarts.void
setEternal
(boolean eternal) Iftrue
, the elements in the cache are eternal, i.e. never expirevoid
setMaxElementsInMemory
(int maxElementsInMemory) The maximum number of elements in memory, before they are evictedvoid
setMaxElementsOnDisk
(int maxElementsOnDisk) The maximum number of elements on disk, before they are removedvoid
setMemoryStoreEvictionPolicy
(String memoryStoreEvictionPolicy) EitherLRU
=Least Recent Use,LFU
=Least Frequent Use orFIFO
=First In - First Outvoid
setOverflowToDisk
(boolean overflowToDisk) Iftrue
, the elements that are evicted from memory are spooled to diskvoid
setTimeToIdleSeconds
(int timeToIdleSeconds) The amount of time in seconds to live for an element from its last accessed or modified datevoid
setTimeToLiveSeconds
(int timeToLiveSeconds) The amount of time in seconds to live for an element from its creation dateprotected V
Methods inherited from class org.frankframework.cache.AbstractCacheAdapter
get, getApplicationContext, getConfigurationClassLoader, getKeyInputSessionKey, getKeyNamespaceDefs, getKeyStyleSheet, getKeyXPath, getKeyXPathOutputType, getLogPrefix, getName, getValueInputSessionKey, getValueNamespaceDefs, getValueStyleSheet, getValueXPath, getValueXPathOutputType, isCacheEmptyKeys, isCacheEmptyValues, put, remove, setApplicationContext, setCacheEmptyKeys, setCacheEmptyValues, setKeyInputSessionKey, setKeyNamespaceDefs, setKeyStyleSheet, setKeyXPath, setKeyXPathOutputType, setName, setValueInputSessionKey, setValueNamespaceDefs, setValueStyleSheet, setValueXPath, setValueXPathOutputType, transformKey, transformValue
-
Constructor Details
-
EhCache
public EhCache()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceICache<String,
V> - Overrides:
configure
in classAbstractCacheAdapter<V>
- Throws:
ConfigurationException
-
open
public void open() -
close
public void close() -
getElement
- Specified by:
getElement
in classAbstractCacheAdapter<V>
-
putElement
- Specified by:
putElement
in classAbstractCacheAdapter<V>
-
removeElement
- Specified by:
removeElement
in classAbstractCacheAdapter<V>
-
toValue
- Specified by:
toValue
in classAbstractCacheAdapter<V>
-
setMaxElementsInMemory
public void setMaxElementsInMemory(int maxElementsInMemory) The maximum number of elements in memory, before they are evicted- Default value
- 100
-
getMaxElementsInMemory
public int getMaxElementsInMemory() -
setMemoryStoreEvictionPolicy
EitherLRU
=Least Recent Use,LFU
=Least Frequent Use orFIFO
=First In - First Out- Default value
- LRU
-
getMemoryStoreEvictionPolicy
-
setEternal
public void setEternal(boolean eternal) Iftrue
, the elements in the cache are eternal, i.e. never expire- Default value
- false
-
isEternal
public boolean isEternal() -
setTimeToLiveSeconds
public void setTimeToLiveSeconds(int timeToLiveSeconds) The amount of time in seconds to live for an element from its creation date- Default value
- 36000
-
getTimeToLiveSeconds
public int getTimeToLiveSeconds() -
setTimeToIdleSeconds
public void setTimeToIdleSeconds(int timeToIdleSeconds) The amount of time in seconds to live for an element from its last accessed or modified date- Default value
- 36000
-
getTimeToIdleSeconds
public int getTimeToIdleSeconds() -
setOverflowToDisk
public void setOverflowToDisk(boolean overflowToDisk) Iftrue
, the elements that are evicted from memory are spooled to disk- Default value
- false
-
isOverflowToDisk
public boolean isOverflowToDisk() -
setMaxElementsOnDisk
public void setMaxElementsOnDisk(int maxElementsOnDisk) The maximum number of elements on disk, before they are removed- Default value
- 10000
-
getMaxElementsOnDisk
public int getMaxElementsOnDisk() -
setDiskPersistent
public void setDiskPersistent(boolean diskPersistent) Iftrue
, the cache is stored on disk and survives configuration reloads & JVM restarts.- Default value
- false
-
isDiskPersistent
public boolean isDiskPersistent() -
setDiskExpiryThreadIntervalSeconds
public void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds) How often to run the disk store expiry thread- Default value
- 600
-
getDiskExpiryThreadIntervalSeconds
public int getDiskExpiryThreadIntervalSeconds()
-