Package com.adaptris.core.services.cache
Class GetValueFromCache
java.lang.Object
com.adaptris.core.ServiceImp
com.adaptris.core.services.cache.CacheServiceImpl
com.adaptris.core.services.cache.SingleKeyCacheService
com.adaptris.core.services.cache.SingleKeyValueCacheImpl
com.adaptris.core.services.cache.GetValueFromCache
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConfigComment
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
@ComponentProfile(summary="Retrieve a value from the configured cache",
since="3.9.2",
tag="service,cache",
recommended=CacheConnection.class)
public class GetValueFromCache
extends SingleKeyValueCacheImpl
Version of
RetrieveFromCacheService
that doesn't use CacheEntryEvaluator
.
Most of the time, you only want to retrieve a single item to the cache rather than a list of
items; this simplified service allows you to do just that. It does not have a list of entries
that are evaluated, you simply specify a key and a CacheValueTranslator
which is used to
insert the value from the cache into the current message.
In the adapter configuration file this class is aliased as get-single-value-from-cache which is the preferred alternative to the fully qualified classname when building your configuration.
-
Field Summary
Fields inherited from class com.adaptris.core.ServiceImp
log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
doService
(AdaptrisMessage msg) Apply the service to the message.void
Whether or not to throw an exception if the key is not in the cache.Methods inherited from class com.adaptris.core.services.cache.SingleKeyValueCacheImpl
getValueTranslator, prepare, setValueTranslator, withValueTranslator
Methods inherited from class com.adaptris.core.services.cache.SingleKeyCacheService
getKey, setKey, withKey
Methods inherited from class com.adaptris.core.services.cache.CacheServiceImpl
closeService, getConnection, initService, retrieveCache, setConnection, start, stop, withConnection
Methods inherited from class com.adaptris.core.ServiceImp
changeState, close, continueOnFailure, createName, createQualifier, getComments, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setComments, setContinueOnFail, setIsTrackingEndpoint, setUniqueId
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.adaptris.core.AdaptrisComponent
getUniqueId
Methods inherited from interface com.adaptris.core.ComponentLifecycle
close, init
Methods inherited from interface com.adaptris.core.ConfigComment
getComments, setComments
Methods inherited from interface com.adaptris.core.MessageEventGenerator
createName, createQualifier, isTrackingEndpoint
Methods inherited from interface com.adaptris.core.Service
continueOnFailure, isBranching, setUniqueId
Methods inherited from interface com.adaptris.core.StateManagedComponent
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
-
Constructor Details
-
GetValueFromCache
public GetValueFromCache()
-
-
Method Details
-
doService
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
getExceptionIfNotFound
-
setExceptionIfNotFound
Whether or not to throw an exception if the key is not in the cache.- Parameters:
b
- default is true
-
withExceptionIfNotFound
-