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 SingleKeyValueCacheImplVersion ofRetrieveFromCacheServicethat 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
CacheValueTranslatorwhich 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 voiddoService(AdaptrisMessage msg)Apply the service to the message.java.lang.BooleangetExceptionIfNotFound()voidsetExceptionIfNotFound(java.lang.Boolean b)Whether or not to throw an exception if the key is not in the cache.GetValueFromCachewithExceptionIfNotFound(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:ServiceApply the service to the message.
- Parameters:
msg- theAdaptrisMessageto process- Throws:
ServiceException- wrapping any underlyingExceptions
-
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)
-
-