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.htmlModifier and Type | Field and Description |
---|---|
protected Filter |
filter |
onUnacceptedFlowConstruct, throwOnUnaccepted, unacceptedMessageProcessor
logger, muleContext, next, notificationHandler
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
PROPERTY_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, setUnacceptedMessageProcessor
addMessageProcessorPathElements, getAnnotation, getAnnotations, getListener, getMuleContext, isEventValid, processNext, setAnnotations, setListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setListener
protected 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 AbstractFilteringMessageProcessor
protected MuleException filterUnacceptedException(MuleEvent event)
filterUnacceptedException
in class AbstractFilteringMessageProcessor
public Filter getFilter()
public void setFilter(Filter filter)
public String toString()
toString
in class AbstractInterceptingMessageProcessorBase
public void setMuleContext(MuleContext context)
setMuleContext
in interface MuleContextAware
setMuleContext
in class AbstractInterceptingMessageProcessorBase
public void setFlowConstruct(FlowConstruct flowConstruct)
setFlowConstruct
in interface FlowConstructAware
public void initialise() throws InitialisationException
Initialisable
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.initialise
in interface Initialisable
InitialisationException
- 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 Startable
MuleException
public void stop() throws MuleException
stop
in interface Stoppable
MuleException
public void dispose()
Disposable
dispose
in interface Disposable
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.