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
,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 ofRetrieveFromCacheService
that doesn't useCacheEntryEvaluator
.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
Constructors Constructor Description GetValueFromCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doService(AdaptrisMessage msg)
Apply the service to the message.java.lang.Boolean
getExceptionIfNotFound()
void
setExceptionIfNotFound(java.lang.Boolean b)
Whether or not to throw an exception if the key is not in the cache.GetValueFromCache
withExceptionIfNotFound(java.lang.Boolean b)
-
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, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, 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.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
-
-
-
-
Method Detail
-
doService
public void doService(AdaptrisMessage msg) throws ServiceException
Description copied from interface:Service
Apply the service to the message.
- Parameters:
msg
- theAdaptrisMessage
to process- Throws:
ServiceException
- wrapping any underlyingException
s
-
getExceptionIfNotFound
public java.lang.Boolean getExceptionIfNotFound()
-
setExceptionIfNotFound
public void setExceptionIfNotFound(java.lang.Boolean b)
Whether or not to throw an exception if the key is not in the cache.- Parameters:
b
- default is true
-
withExceptionIfNotFound
public GetValueFromCache withExceptionIfNotFound(java.lang.Boolean b)
-
-