Class AddToCacheService
- All Implemented Interfaces:
AdaptrisComponent
,ComponentLifecycle
,ComponentLifecycleExtension
,ConnectedService
,MessageEventGenerator
,Service
,StateManagedComponent
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.
- See Also:
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.
-
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.boolean
void
If this is set to true then the service will only attempt to cache values that areSerializable
.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
-
Constructor Details
-
AddToCacheService
public AddToCacheService()
-
-
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
-
setEnforceSerializable
If this is set to true then the service will only attempt to cache values that areSerializable
.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)
- Parameters:
bool
- default is false.
-
getEnforceSerializable
-
enforceSerializable
public boolean enforceSerializable()
-