Package org.frankframework.cache
Class AbstractCacheAdapter<V>
java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<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 AbstractCacheAdapter<V>
extends Object
implements ICache<String,V>, IConfigurationAware
Baseclass for caching.
Provides key transformation functionality.
- Since:
- 4.11
- Author:
- Gerrit van Brakel
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Obtain a potentially cached value, set by put().org.springframework.context.ApplicationContext
This ClassLoader is set upon creation of the object, used to retrieve resources configured by the Ibis application.protected abstract V
getElement
(String key) getName()
boolean
boolean
void
store a value in the cache, that can be retrieved later using get().protected abstract void
putElement
(String key, V value) boolean
protected abstract boolean
removeElement
(Object key) void
setApplicationContext
(org.springframework.context.ApplicationContext applicationContext) void
setCacheEmptyKeys
(boolean cacheEmptyKeys) controls whether empty keys are used for caching. when set true, cache entries with empty keys can exist.void
setCacheEmptyValues
(boolean cacheEmptyValues) controls whether empty values will be cached. when set true, empty cache entries can exist for any key.void
setKeyInputSessionKey
(String keyInputSessionKey) session key to use as input for transformation of request message to key by keyxpath or keystylesheetvoid
setKeyNamespaceDefs
(String keyNamespaceDefs) namespace defintions for keyxpath. must be in the form of a comma or space separated list ofprefix=namespaceuri
definitionsvoid
setKeyStyleSheet
(String keyStyleSheet) stylesheet to extract cache key from request message.void
setKeyXPath
(String keyXPath) xpath expression to extract cache key from request messagevoid
setKeyXPathOutputType
(TransformerPool.OutputType keyXPathOutputType) output type of xpath expression to extract cache key from request messagevoid
name of the cache, will be lowercasedvoid
setValueInputSessionKey
(String valueInputSessionKey) session key to use as input for transformation of response message to cached value by valuexpath or valuestylesheetvoid
setValueNamespaceDefs
(String valueNamespaceDefs) namespace defintions for valuexpath. must be in the form of a comma or space separated list ofprefix=namespaceuri
definitionsvoid
setValueStyleSheet
(String valueStyleSheet) stylesheet to extract value to be cached from response messagevoid
setValueXPath
(String valueXPath) xpath expression to extract value to be cached key from response message.void
setValueXPathOutputType
(TransformerPool.OutputType valueXPathOutputType) protected abstract V
transformKey
(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.
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log
-
-
Constructor Details
-
AbstractCacheAdapter
public AbstractCacheAdapter()
-
-
Method Details
-
configure
- Specified by:
configure
in interfaceICache<String,
V> - Throws:
ConfigurationException
-
getElement
-
putElement
-
removeElement
-
toValue
-
transformKey
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 interfaceICache<String,
V>
-
transformValue
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 interfaceICache<String,
V>
-
get
Description copied from interface:ICache
Obtain a potentially cached value, set by put(). -
put
Description copied from interface:ICache
store a value in the cache, that can be retrieved later using get(). -
remove
-
setName
name of the cache, will be lowercased- Default value
<ownerName>
_cache
-
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=namespaceuri
definitions -
setKeyStyleSheet
stylesheet to extract cache key from request message. Use in combination withcacheEmptyKeys
to 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 withcacheEmptyValues
to 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=namespaceuri
definitions -
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
-
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 interfaceIScopeProvider
- Returns:
- returns the ClassLoader created by the
ClassLoaderManager
.
-
getApplicationContext
public org.springframework.context.ApplicationContext getApplicationContext()- Specified by:
getApplicationContext
in interfaceIConfigurationAware
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) - Specified by:
setApplicationContext
in interfaceorg.springframework.context.ApplicationContextAware
-
getName
- Specified by:
getName
in interfaceIConfigurationAware
-
getKeyXPath
-
getKeyXPathOutputType
-
getKeyNamespaceDefs
-
getKeyStyleSheet
-
getKeyInputSessionKey
-
isCacheEmptyKeys
public boolean isCacheEmptyKeys() -
getValueXPath
-
getValueXPathOutputType
-
getValueNamespaceDefs
-
getValueStyleSheet
-
getValueInputSessionKey
-
isCacheEmptyValues
public boolean isCacheEmptyValues()
-