@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 CacheEntryEvaluators.
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,
RetrieveFromCacheServiceIn 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| 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, setCacheEntryEvaluatorscloseService, getConnection, initService, prepare, retrieveCache, setConnection, start, stop, withConnectionchangeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsTrackingEndpoint, getUniqueId, init, isBranching, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, setContinueOnFail, setIsTrackingEndpoint, setUniqueIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontinueOnFailure, isBranching, setUniqueIdcreateName, createQualifier, isTrackingEndpointchangeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentStategetUniqueIdclose, initpublic void doService(AdaptrisMessage msg) throws ServiceException
ServiceApply the service to the message.
msg - the AdaptrisMessage to processServiceException - wrapping any underlying Exceptionspublic 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()