org.mule.processor
Class AbstractFilteringMessageProcessor

java.lang.Object
  extended by org.mule.processor.AbstractInterceptingMessageProcessorBase
      extended by org.mule.processor.AbstractInterceptingMessageProcessor
          extended by org.mule.processor.AbstractFilteringMessageProcessor
All Implemented Interfaces:
AnnotatedObject, MuleContextAware, InterceptingMessageProcessor, MessageProcessor, MessageSource
Direct Known Subclasses:
AbstractPipeline.ProcessIfPipelineStartedMessageProcessor, IdempotentMessageFilter, MessageFilter, ProcessIfStartedMessageProcessor, ScriptFilter

public abstract class AbstractFilteringMessageProcessor
extends AbstractInterceptingMessageProcessor

Abstract InterceptingMessageProcessor that can be easily be extended and used for filtering message flow through a MessageProcessor chain. The default behaviour when the filter is not accepted is to return the request event.


Field Summary
protected  boolean onUnacceptedFlowConstruct
           
protected  boolean throwOnUnaccepted
          Throw a FilterUnacceptedException when a message is rejected by the filter?
protected  MessageProcessor unacceptedMessageProcessor
          The MessageProcessor that should be used to handle messages that are not accepted by the filter.
 
Fields inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
logger, muleContext, next, notificationHandler
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
AbstractFilteringMessageProcessor()
           
 
Method Summary
protected abstract  boolean accept(MuleEvent event)
           
protected  MuleException filterUnacceptedException(MuleEvent event)
           
 MessageProcessor getUnacceptedMessageProcessor()
           
protected  MuleEvent handleUnaccepted(MuleEvent event)
           
 boolean isThrowOnUnaccepted()
           
 MuleEvent process(MuleEvent event)
          Invokes the MessageProcessor.
 void setThrowOnUnaccepted(boolean throwOnUnaccepted)
           
 void setUnacceptedMessageProcessor(MessageProcessor unacceptedMessageProcessor)
           
 
Methods inherited from class org.mule.processor.AbstractInterceptingMessageProcessorBase
getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener, setMuleContext, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.source.MessageSource
setListener
 

Field Detail

throwOnUnaccepted

protected boolean throwOnUnaccepted
Throw a FilterUnacceptedException when a message is rejected by the filter?


onUnacceptedFlowConstruct

protected boolean onUnacceptedFlowConstruct

unacceptedMessageProcessor

protected MessageProcessor unacceptedMessageProcessor
The MessageProcessor that should be used to handle messages that are not accepted by the filter.

Constructor Detail

AbstractFilteringMessageProcessor

public AbstractFilteringMessageProcessor()
Method Detail

process

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

Parameters:
event - MuleEvent to be processed
Returns:
optional response MuleEvent
Throws:
MuleException

accept

protected abstract boolean accept(MuleEvent event)

handleUnaccepted

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

filterUnacceptedException

protected MuleException filterUnacceptedException(MuleEvent event)

getUnacceptedMessageProcessor

public MessageProcessor getUnacceptedMessageProcessor()

setUnacceptedMessageProcessor

public void setUnacceptedMessageProcessor(MessageProcessor unacceptedMessageProcessor)

isThrowOnUnaccepted

public boolean isThrowOnUnaccepted()

setThrowOnUnaccepted

public void setThrowOnUnaccepted(boolean throwOnUnaccepted)


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