org.mule.cache
Class ObjectStoreCachingStrategy
java.lang.Object
org.mule.cache.ObjectStoreCachingStrategy
- All Implemented Interfaces:
- CachingStrategy
public class ObjectStoreCachingStrategy
- extends Object
- implements CachingStrategy
Implements CachingStrategy
using an ObjectStore
as a cache.
Object's keys are generated using a KeyGenerator
and the responses
are generated using a ResponseGenerator
.
The caching strategy will only cache the MuleEvent
that have a
non consumable message's payload. This check is done in both request and response
events using a configurable Filter
.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected Log logger
ObjectStoreCachingStrategy
public ObjectStoreCachingStrategy()
process
public MuleEvent process(MuleEvent request,
MessageProcessor messageProcessor)
throws MuleException
- Description copied from interface:
CachingStrategy
- Processes a
MuleEvent
using a caching schema. Uses a message processor
to process the request when it is not found in the cache or when it must
be processed without using the cache.
Different calls to this method using the same request does not implies
that the same instance will be returned. Each implementation could
choose to create new instances every time.
- Specified by:
process
in interface CachingStrategy
- Parameters:
request
- the event to processmessageProcessor
- the message processor that will be executed when
the response for the event is not in the cache.
- Returns:
- a response for the request that could be obtained using the
cache.
- Throws:
MuleException
store
protected void store(Serializable key,
MuleEvent value)
retrieve
protected MuleEvent retrieve(Serializable key)
getStore
public ObjectStore<MuleEvent> getStore()
setStore
public void setStore(ObjectStore<MuleEvent> store)
getKeyGenerator
public KeyGenerator getKeyGenerator()
setKeyGenerator
public void setKeyGenerator(KeyGenerator keyGenerator)
getResponseGenerator
public ResponseGenerator getResponseGenerator()
setResponseGenerator
public void setResponseGenerator(ResponseGenerator responseGenerator)
getConsumableFilter
public Filter getConsumableFilter()
setConsumableFilter
public void setConsumableFilter(Filter consumableFilter)
getName
public String getName()
setName
public void setName(String name)
Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.