public class MessageFilter extends AbstractFilteringMessageProcessor implements FlowConstructAware, Lifecycle
InterceptingMessageProcessor that filters message flow
using a Filter. Is the filter accepts the message then message flow
continues to the next message processor. If the filter does not accept the message
processor and a message processor is configured for handling unaccepted message
then this will be invoked, otherwise null will be returned.
EIP Reference: http://www.eaipatterns
.com/Filter.html| Modifier and Type | Field and Description |
|---|---|
protected Filter |
filter |
onUnacceptedFlowConstruct, throwOnUnaccepted, unacceptedMessageProcessorlogger, muleContext, next, notificationHandlerPHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_NAMEPROPERTY_NAME| Constructor and Description |
|---|
MessageFilter()
Deprecated.
Use MessageFilter(Filter filter)
|
MessageFilter(Filter filter) |
MessageFilter(Filter filter,
boolean throwExceptionOnUnaccepted,
MessageProcessor messageProcessor) |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
accept(MuleEvent event) |
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
protected MuleException |
filterUnacceptedException(MuleEvent event) |
Filter |
getFilter() |
void |
initialise()
Method used to perform any initialisation work.
|
void |
setFilter(Filter filter) |
void |
setFlowConstruct(FlowConstruct flowConstruct) |
void |
setMuleContext(MuleContext context) |
void |
start() |
void |
stop() |
String |
toString() |
getUnacceptedMessageProcessor, handleUnaccepted, isThrowOnUnaccepted, process, setThrowOnUnaccepted, setUnacceptedMessageProcessoraddMessageProcessorPathElements, getListener, getMuleContext, isEventValid, processNext, setListenergetAnnotation, getAnnotations, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetListenerprotected Filter filter
@Deprecated public MessageFilter()
public MessageFilter(Filter filter)
public MessageFilter(Filter filter, boolean throwExceptionOnUnaccepted, MessageProcessor messageProcessor)
filter - throwExceptionOnUnaccepted - throw a FilterUnacceptedException when a
message is rejected by the filter?messageProcessor - used to handler unaccepted messagesprotected boolean accept(MuleEvent event)
accept in class AbstractFilteringMessageProcessorprotected MuleException filterUnacceptedException(MuleEvent event)
filterUnacceptedException in class AbstractFilteringMessageProcessorpublic Filter getFilter()
public void setFilter(Filter filter)
public String toString()
toString in class AbstractInterceptingMessageProcessorBasepublic void setMuleContext(MuleContext context)
setMuleContext in interface MuleContextAwaresetMuleContext in class AbstractInterceptingMessageProcessorBasepublic void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct in interface FlowConstructAwarepublic void initialise()
throws InitialisationException
InitialisableInitialisationException 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.initialise in interface InitialisableInitialisationException - if a fatal error occurs causing the Mule instance to shutdownRecoverableException - if an error occurs that can be recovered frompublic void start()
throws MuleException
start in interface StartableMuleExceptionpublic void stop()
throws MuleException
stop in interface StoppableMuleExceptionpublic void dispose()
Disposabledispose in interface DisposableCopyright © 2003–2015 MuleSoft, Inc.. All rights reserved.