@ComponentProfile(summary="Add values to a cache", tag="service,cache", recommended=CacheConnection.class) public class AddToCacheService extends CacheServiceBase
Service
implementation that adds entries to a cache based on its configured CacheEntryEvaluator
s.
The standard use case for this is if you wish to cache certain information across workflows (e.g. a CorrelationId). In your
source workflow you would use this service to add your required value into the cache. Subsequent workflows could then use
RetrieveFromCacheService
or RemoveFromCacheService
to subsequently retrieve those values from the cache.
Cache
,
RemoveFromCacheService
,
RetrieveFromCacheService
In the adapter configuration file this class is aliased as add-to-cache which is the preferred alternative to the fully qualified classname when building your configuration.
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
AddToCacheService() |
Modifier and Type | Method and Description |
---|---|
void |
doService(AdaptrisMessage msg)
Apply the service to the message.
|
boolean |
enforceSerializable() |
java.lang.Boolean |
getEnforceSerializable() |
void |
setEnforceSerializable(java.lang.Boolean bool)
If this is set to true then the service will only attempt to cache values that are
Serializable . |
addCacheEntryEvaluator, addCacheValueToMessage, getCacheEntryEvaluators, setCacheEntryEvaluators
closeService, getConnection, initService, prepare, retrieveCache, setConnection, start, stop, withConnection
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public void doService(AdaptrisMessage msg) throws ServiceException
Service
Apply the service to the message.
msg
- the AdaptrisMessage
to processServiceException
- wrapping any underlying Exception
spublic void setEnforceSerializable(java.lang.Boolean bool)
Serializable
.
An exception will be thrown if any non-serializable object is attempted to be cached. This is to enable non-memory based caching engines to be used (where serialization may be used to store the value)
bool
- default is false.public java.lang.Boolean getEnforceSerializable()
public boolean enforceSerializable()