Class EhCache<V>

java.lang.Object
org.frankframework.cache.CacheAdapterBase<V>
org.frankframework.cache.EhCache<V>
All Implemented Interfaces:
ICache<String,V>, IConfigurationAware, IScopeProvider, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

public class EhCache<V> extends CacheAdapterBase<V>
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
  • Constructor Details

    • EhCache

      public EhCache()
  • Method Details

    • configure

      public void configure(String ownerName) throws ConfigurationException
      Specified by:
      configure in interface ICache<String,V>
      Overrides:
      configure in class CacheAdapterBase<V>
      Throws:
      ConfigurationException
    • open

      public void open()
    • close

      public void close()
    • getElement

      protected V getElement(String key)
      Specified by:
      getElement in class CacheAdapterBase<V>
    • putElement

      protected void putElement(String key, V value)
      Specified by:
      putElement in class CacheAdapterBase<V>
    • removeElement

      protected boolean removeElement(Object key)
      Specified by:
      removeElement in class CacheAdapterBase<V>
    • toValue

      protected V toValue(Message value)
      Specified by:
      toValue in class CacheAdapterBase<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

      public void setMemoryStoreEvictionPolicy(String memoryStoreEvictionPolicy)
      Either LRU=Least Recent Use,LFU=Least Frequent Use or FIFO=First In - First Out
      Default value
      LRU
    • getMemoryStoreEvictionPolicy

      public String getMemoryStoreEvictionPolicy()
    • setEternal

      public void setEternal(boolean eternal)
      If true, 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)
      If true, 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)
      If true, 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()