Class AbstractCacheAdapter<V>
java.lang.Object
org.frankframework.cache.AbstractCacheAdapter<V>
- All Implemented Interfaces:
ICache<String,V>, FrankElement, HasApplicationContext, HasName, IConfigurable, IScopeProvider, IWithParameters, 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, IWithParameters
Baseclass for caching.
Provides key transformation functionality.
- Since:
- 4.11
- Author:
- Gerrit van Brakel
- Specific parameters
- key provides the
key., value provides thevalue.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.logging.log4j.Loggerprotected @NonNull ParameterList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidConfigure this component.Obtain a potentially cached value, set by put().protected abstract VgetElement(String key) @NonNull ParameterListvoidstore 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) Deprecated, for removal: This API element is subject to removal in a future version.voidsetKeyNamespaceDefs(String keyNamespaceDefs) Deprecated, for removal: This API element is subject to removal in a future version.voidsetKeyStyleSheet(String keyStyleSheet) Deprecated, for removal: This API element is subject to removal in a future version.voidsetKeyXPath(String keyXPath) Deprecated, for removal: This API element is subject to removal in a future version.voidsetKeyXPathOutputType(TransformerPool.OutputType keyXPathOutputType) Deprecated, for removal: This API element is subject to removal in a future version.voidName of the cache, will be lowercasedvoidsetValueInputSessionKey(String valueInputSessionKey) Deprecated, for removal: This API element is subject to removal in a future version.voidsetValueNamespaceDefs(String valueNamespaceDefs) Deprecated, for removal: This API element is subject to removal in a future version.voidsetValueStyleSheet(String valueStyleSheet) Deprecated, for removal: This API element is subject to removal in a future version.voidsetValueXPath(String valueXPath) Deprecated, for removal: This API element is subject to removal in a future version.voidsetValueXPathOutputType(TransformerPool.OutputType valueXPathOutputType) Deprecated, for removal: This API element is subject to removal in a future version.protected abstract VtransformKey(String input, PipeLineSession session) Transform the current request message to a key in the cache-map.transformValue(Message value, PipeLineSession session) Transform the current response message to a value in the cache-map.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationContextAware
setApplicationContextMethods inherited from interface FrankElement
addConfigWarningMethods inherited from interface HasApplicationContext
getApplicationContext, getConfigurationClassLoader
-
Field Details
-
log
protected org.apache.logging.log4j.Logger log -
parameterList
-
-
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 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 current response message to a value in the cache-map. Allows for instance XPath translations.- Specified by:
transformValuein interfaceICache<String,V>
-
get
-
put
-
remove
-
setName
-
getLogPrefix
-
setKeyXPath
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyXPath(String keyXPath) Deprecated, for removal: This API element is subject to removal in a future version.xpath expression to extract cache key from request message -
setKeyXPathOutputType
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyXPathOutputType(TransformerPool.OutputType keyXPathOutputType) Deprecated, for removal: This API element is subject to removal in a future version.output type of xpath expression to extract cache key from request message- Default value
- text
-
setKeyNamespaceDefs
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyNamespaceDefs(String keyNamespaceDefs) Deprecated, for removal: This API element is subject to removal in a future version.namespace definitions for keyxpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitions -
setKeyStyleSheet
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyStyleSheet(String keyStyleSheet) Deprecated, for removal: This API element is subject to removal in a future version.stylesheet to extract cache key from request message. Use in combination withcacheEmptyKeysto inhibit caching for certain groups of request messages -
setKeyInputSessionKey
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'key' parameter to provide the key") public void setKeyInputSessionKey(String keyInputSessionKey) Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueXPath(String valueXPath) Deprecated, for removal: This API element is subject to removal in a future version.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
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueXPathOutputType(TransformerPool.OutputType valueXPathOutputType) Deprecated, for removal: This API element is subject to removal in a future version. -
setValueNamespaceDefs
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueNamespaceDefs(String valueNamespaceDefs) Deprecated, for removal: This API element is subject to removal in a future version.namespace definitions for valuexpath. must be in the form of a comma or space separated list ofprefix=namespaceuridefinitions -
setValueStyleSheet
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueStyleSheet(String valueStyleSheet) Deprecated, for removal: This API element is subject to removal in a future version.stylesheet to extract value to be cached from response message -
setValueInputSessionKey
@Deprecated(forRemoval=true, since="10.2") @ConfigurationWarning("Use the 'value' parameter to provide the value") public void setValueInputSessionKey(String valueInputSessionKey) Deprecated, for removal: This API element is subject to removal in a future version.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
-
addParameter
- Specified by:
addParameterin interfaceIWithParameters
-
getParameterList
- Specified by:
getParameterListin interfaceIWithParameters
-