org.mule.cache
Class CachingMessageProcessor

java.lang.Object
  extended by org.mule.processor.AbstractMessageProcessorOwner
      extended by org.mule.cache.CachingMessageProcessor
All Implemented Interfaces:
AnnotatedObject, FlowConstructAware, MuleContextAware, Disposable, Initialisable, Lifecycle, Startable, Stoppable, InterceptingMessageProcessor, MessageProcessor, MessageSource

public class CachingMessageProcessor
extends AbstractMessageProcessorOwner
implements Initialisable, InterceptingMessageProcessor

Processes a MuleEvent using a CachingStrategy.

Provides a configurable filter to check whether or not a given request has to go through the cache or not. All requests are processed using the caching strategy by default.


Field Summary
protected  Log logger
           
 
Fields inherited from class org.mule.processor.AbstractMessageProcessorOwner
flowConstruct, muleContext
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Startable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Stoppable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
CachingMessageProcessor()
           
 
Method Summary
protected  AcceptAllFilter createDefaultCacheFilter()
           
protected  CachingStrategy createDefaultCachingStrategy()
           
 CachingStrategy getCachingStrategy()
           
 Filter getFilter()
           
protected  List<MessageProcessor> getOwnedMessageProcessors()
           
 void initialise()
          Method used to perform any initialisation work.
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
protected  MuleEvent processNext(MuleEvent event)
           
 void setCachingStrategy(CachingStrategy cachingStrategy)
           
 void setFilter(Filter filter)
           
 void setListener(MessageProcessor listener)
          Set the MessageProcessor listener on a message source which will be invoked when a message is received or generated.
 void setMessageProcessors(List<MessageProcessor> messageProcessors)
           
 
Methods inherited from class org.mule.processor.AbstractMessageProcessorOwner
dispose, getAnnotation, getAnnotations, setAnnotations, setFlowConstruct, setMuleContext, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected Log logger
Constructor Detail

CachingMessageProcessor

public CachingMessageProcessor()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Description copied from interface: Initialisable
Method used to perform any initialisation work. If a fatal error occurs during initialisation an InitialisationException should be thrown, causing the Mule instance to shutdown. If the error is recoverable, say by retrying to connect, a RecoverableException should be thrown. There is no guarantee that by throwing a Recoverable exception that the Mule instance will not shut down.

Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractMessageProcessorOwner
Throws:
InitialisationException - if a fatal error occurs causing the Mule instance to shutdown
RecoverableException - if an error occurs that can be recovered from

createDefaultCacheFilter

protected AcceptAllFilter createDefaultCacheFilter()

createDefaultCachingStrategy

protected CachingStrategy createDefaultCachingStrategy()

process

public MuleEvent process(MuleEvent event)
                  throws MuleException
Description copied from interface: MessageProcessor
Invokes the MessageProcessor.

Specified by:
process in interface MessageProcessor
Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

processNext

protected MuleEvent processNext(MuleEvent event)
                         throws MuleException
Throws:
MuleException

setMessageProcessors

public void setMessageProcessors(List<MessageProcessor> messageProcessors)
                          throws MuleException
Throws:
MuleException

getOwnedMessageProcessors

protected List<MessageProcessor> getOwnedMessageProcessors()
Specified by:
getOwnedMessageProcessors in class AbstractMessageProcessorOwner

setListener

public void setListener(MessageProcessor listener)
Description copied from interface: MessageSource
Set the MessageProcessor listener on a message source which will be invoked when a message is received or generated.

Specified by:
setListener in interface MessageSource

getCachingStrategy

public CachingStrategy getCachingStrategy()

setCachingStrategy

public void setCachingStrategy(CachingStrategy cachingStrategy)

getFilter

public Filter getFilter()

setFilter

public void setFilter(Filter filter)


Copyright © 2003-2011 MuleSoft, Inc.. All Rights Reserved.