Class EhCache<V>

java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<V>
org.frankframework.cache.EhCache<V>
All Implemented Interfaces:
ICache<String,V>, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, NameAware, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

@FrankDocGroup(OTHER) public class EhCache<V> extends AbstractCacheAdapter<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() throws ConfigurationException
      Description copied from interface: IConfigurable
      Configure this component.

      configure() is called once at startup of the framework in the configure method of the owner of this IConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in the configure(), to improve performance.

      In the case of a container, this will propagate the configure signal to all components that apply.

      Specified by:
      configure in interface IConfigurable
      Overrides:
      configure in class AbstractCacheAdapter<V>
      Throws:
      ConfigurationException - in case it was not able to configure the component.
    • open

      public void open()
    • close

      public void close()
    • getElement

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

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

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

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