Class CacheAdapterBase<V>

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

public abstract class CacheAdapterBase<V> extends Object implements ICache<String,V>, IConfigurationAware
Baseclass for caching. Provides key transformation functionality.
Since:
4.11
Author:
Gerrit van Brakel
  • Field Details

    • log

      protected org.apache.logging.log4j.Logger log
  • Constructor Details

    • CacheAdapterBase

      public CacheAdapterBase()
  • Method Details

    • configure

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

      protected abstract V getElement(String key)
    • putElement

      protected abstract void putElement(String key, V value)
    • removeElement

      protected abstract boolean removeElement(Object key)
    • toValue

      protected abstract V toValue(Message value)
    • transformKey

      public String transformKey(String input, PipeLineSession session)
      Description copied from interface: ICache
      Transform the the current request message to a key in the cache-map. Allows for instance XPath translations.
      Specified by:
      transformKey in interface ICache<String,V>
    • transformValue

      public V transformValue(Message value, PipeLineSession session)
      Description copied from interface: ICache
      Transform the the current response message to a value in the cache-map. Allows for instance XPath translations.
      Specified by:
      transformValue in interface ICache<String,V>
    • get

      public V get(String key)
      Description copied from interface: ICache
      Obtain a potentially cached value, set by put().
      Specified by:
      get in interface ICache<String,V>
    • put

      public void put(String key, V value)
      Description copied from interface: ICache
      store a value in the cache, that can be retrieved later using get().
      Specified by:
      put in interface ICache<String,V>
    • remove

      public boolean remove(String key)
    • setName

      public void setName(String name)
      name of the cache, will be lowercased
      Default value
      <ownerName>_cache
    • getLogPrefix

      public String getLogPrefix()
    • setKeyXPath

      public void setKeyXPath(String keyXPath)
      xpath expression to extract cache key from request message
    • setKeyXPathOutputType

      public void setKeyXPathOutputType(TransformerPool.OutputType keyXPathOutputType)
      output type of xpath expression to extract cache key from request message
      Default value
      text
    • setKeyNamespaceDefs

      public void setKeyNamespaceDefs(String keyNamespaceDefs)
      namespace defintions for keyxpath. must be in the form of a comma or space separated list of prefix=namespaceuri-definitions
    • setKeyStyleSheet

      public void setKeyStyleSheet(String keyStyleSheet)
      stylesheet to extract cache key from request message. Use in combination with cacheEmptyKeys to inhibit caching for certain groups of request messages
    • setKeyInputSessionKey

      public void setKeyInputSessionKey(String keyInputSessionKey)
      session key to use as input for transformation of request message to key by keyxpath or keystylesheet
    • setCacheEmptyKeys

      public void setCacheEmptyKeys(boolean cacheEmptyKeys)
      controls whether empty keys are used for caching. when set true, cache entries with empty keys can exist.
      Default value
      false
    • setValueXPath

      public void setValueXPath(String valueXPath)
      xpath expression to extract value to be cached key from response message. Use in combination with cacheEmptyValues to inhibit caching for certain groups of response messages
    • setValueXPathOutputType

      public void setValueXPathOutputType(TransformerPool.OutputType valueXPathOutputType)
    • setValueNamespaceDefs

      public void setValueNamespaceDefs(String valueNamespaceDefs)
      namespace defintions for valuexpath. must be in the form of a comma or space separated list of prefix=namespaceuri-definitions
    • setValueStyleSheet

      public void setValueStyleSheet(String valueStyleSheet)
      stylesheet to extract value to be cached from response message
    • setValueInputSessionKey

      public void setValueInputSessionKey(String valueInputSessionKey)
      session key to use as input for transformation of response message to cached value by valuexpath or valuestylesheet
    • setCacheEmptyValues

      public void setCacheEmptyValues(boolean cacheEmptyValues)
      controls whether empty values will be cached. when set true, empty cache entries can exist for any key.
      Default value
      false
    • getConfigurationClassLoader

      public ClassLoader getConfigurationClassLoader()
      Description copied from interface: IScopeProvider
      This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.
      Specified by:
      getConfigurationClassLoader in interface IScopeProvider
      Returns:
      returns the ClassLoader created by the ClassLoaderManager.
    • getApplicationContext

      public org.springframework.context.ApplicationContext getApplicationContext()
      Specified by:
      getApplicationContext in interface IConfigurationAware
    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
    • getName

      public String getName()
      Specified by:
      getName in interface IConfigurationAware
    • getKeyXPath

      public String getKeyXPath()
    • getKeyXPathOutputType

      public TransformerPool.OutputType getKeyXPathOutputType()
    • getKeyNamespaceDefs

      public String getKeyNamespaceDefs()
    • getKeyStyleSheet

      public String getKeyStyleSheet()
    • getKeyInputSessionKey

      public String getKeyInputSessionKey()
    • isCacheEmptyKeys

      public boolean isCacheEmptyKeys()
    • getValueXPath

      public String getValueXPath()
    • getValueXPathOutputType

      public TransformerPool.OutputType getValueXPathOutputType()
    • getValueNamespaceDefs

      public String getValueNamespaceDefs()
    • getValueStyleSheet

      public String getValueStyleSheet()
    • getValueInputSessionKey

      public String getValueInputSessionKey()
    • isCacheEmptyValues

      public boolean isCacheEmptyValues()