Package org.frankframework.cache
Class AbstractCacheAdapter<V>
java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<V>
- All Implemented Interfaces:
ICache<String,,V> FrankElement,HasApplicationContext,HasName,IConfigurable,IScopeProvider,NameAware,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
EhCache
public abstract class AbstractCacheAdapter<V>
extends Object
implements ICache<String,V>, FrankElement
Baseclass for caching.
Provides key transformation functionality.
- Since:
- 4.11
- Author:
- Gerrit van Brakel
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigure this component.Obtain a potentially cached value, set by put().protected abstract VgetElement(String key) voidstore a value in the cache, that can be retrieved later using get().protected abstract voidputElement(String key, V value) booleanprotected abstract booleanremoveElement(Object key) voidsetCacheEmptyKeys(boolean cacheEmptyKeys) controls whether empty keys are used for caching. when set true, cache entries with empty keys can exist.voidsetCacheEmptyValues(boolean cacheEmptyValues) controls whether empty values will be cached. when set true, empty cache entries can exist for any key.voidsetKeyInputSessionKey(String keyInputSessionKey) session key to use as input for transformation of request message to key by keyxpath or keystylesheetvoidsetKeyNamespaceDefs(String keyNamespaceDefs) namespace defintions for keyxpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitionsvoidsetKeyStyleSheet(String keyStyleSheet) stylesheet to extract cache key from request message.voidsetKeyXPath(String keyXPath) xpath expression to extract cache key from request messagevoidsetKeyXPathOutputType(TransformerPool.OutputType keyXPathOutputType) output type of xpath expression to extract cache key from request messagevoidName of the cache, will be lowercasedvoidsetValueInputSessionKey(String valueInputSessionKey) session key to use as input for transformation of response message to cached value by valuexpath or valuestylesheetvoidsetValueNamespaceDefs(String valueNamespaceDefs) namespace defintions for valuexpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitionsvoidsetValueStyleSheet(String valueStyleSheet) stylesheet to extract value to be cached from response messagevoidsetValueXPath(String valueXPath) xpath expression to extract value to be cached key from response message.voidsetValueXPathOutputType(TransformerPool.OutputType valueXPathOutputType) protected abstract VtransformKey(String input, PipeLineSession session) Transform the the current request message to a key in the cache-map.transformValue(Message value, PipeLineSession session) Transform the the current response message to a value in the cache-map.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface org.frankframework.core.FrankElement
addConfigWarningMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
AbstractCacheAdapter
public AbstractCacheAdapter()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. 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 theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
getElement
-
putElement
-
removeElement
-
toValue
-
transformKey
Description copied from interface:ICacheTransform the the current request message to a key in the cache-map. Allows for instance XPath translations.- Specified by:
transformKeyin interfaceICache<String,V>
-
transformValue
Description copied from interface:ICacheTransform the the current response message to a value in the cache-map. Allows for instance XPath translations.- Specified by:
transformValuein interfaceICache<String,V>
-
get
Description copied from interface:ICacheObtain a potentially cached value, set by put(). -
put
Description copied from interface:ICachestore a value in the cache, that can be retrieved later using get(). -
remove
-
setName
Name of the cache, will be lowercased -
getLogPrefix
-
setKeyXPath
xpath expression to extract cache key from request message -
setKeyXPathOutputType
output type of xpath expression to extract cache key from request message- Default value
- text
-
setKeyNamespaceDefs
namespace defintions for keyxpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitions -
setKeyStyleSheet
stylesheet to extract cache key from request message. Use in combination withcacheEmptyKeysto inhibit caching for certain groups of request messages -
setKeyInputSessionKey
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
xpath expression to extract value to be cached key from response message. Use in combination withcacheEmptyValuesto inhibit caching for certain groups of response messages -
setValueXPathOutputType
-
setValueNamespaceDefs
namespace defintions for valuexpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitions -
setValueStyleSheet
stylesheet to extract value to be cached from response message -
setValueInputSessionKey
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
-