Package com.adaptris.core.services.cache
Class RetrieveFromCacheService
- java.lang.Object
-
- com.adaptris.core.ServiceImp
-
- com.adaptris.core.services.cache.CacheServiceImpl
-
- com.adaptris.core.services.cache.CacheServiceBase
-
- com.adaptris.core.services.cache.RetrieveFromCacheService
-
- All Implemented Interfaces:
AdaptrisComponent,ComponentLifecycle,ComponentLifecycleExtension,ConnectedService,MessageEventGenerator,Service,StateManagedComponent
- Direct Known Subclasses:
RemoveFromCacheService
@ComponentProfile(summary="Retrieve values from the cache", tag="service,cache", recommended=CacheConnection.class) public class RetrieveFromCacheService extends CacheServiceBaseService that looks up an object from the cache using the configuredCacheEntryEvaluatorinstances.This service uses its configured
CacheEntryEvaluatorinstances to lookup keys stored in the cache, retrieves the value and then stores it against the message using the supplied value translator.In the adapter configuration file this class is aliased as retrieve-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 RetrieveFromCacheService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoService(AdaptrisMessage msg)Looks up an object from the cache and then stores it in the metadatajava.lang.BooleangetExceptionIfNotFound()voidsetExceptionIfNotFound(java.lang.Boolean b)Whether or not to throw an exception if the key is not in the cache.-
Methods inherited from class com.adaptris.core.services.cache.CacheServiceBase
addCacheEntryEvaluator, addCacheValueToMessage, getCacheEntryEvaluators, setCacheEntryEvaluators
-
Methods inherited from class com.adaptris.core.services.cache.CacheServiceImpl
closeService, getConnection, initService, prepare, 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
Looks up an object from the cache and then stores it in the metadata- 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.
-
-