public abstract class AbstractFilteringMessageProcessor extends AbstractInterceptingMessageProcessor
InterceptingMessageProcessor that can be easily be extended and used for filtering message flow through a
Processor chain. The default behaviour when the filter is not accepted is to return the request event.ReactiveProcessor.ProcessingType| Modifier and Type | Field and Description |
|---|---|
protected boolean |
onUnacceptedFlowConstruct |
protected boolean |
throwOnUnaccepted
Throw a FilterUnacceptedException when a message is rejected by the filter?
|
protected Processor |
unacceptedMessageProcessor
The
MessageProcessor that should be used to handle messages that are not accepted by the filter. |
flowConstruct, logger, muleContext, next| Constructor and Description |
|---|
AbstractFilteringMessageProcessor() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract boolean |
accept(Event event,
Event.Builder builder) |
org.reactivestreams.Publisher<Event> |
apply(org.reactivestreams.Publisher<Event> publisher)
Applies a
Publisher function transforming a stream of Event's. |
protected MessagingException |
filterFailureException(Event event,
Exception ex) |
protected org.mule.runtime.api.exception.MuleException |
filterUnacceptedException(Event event) |
Processor |
getUnacceptedMessageProcessor() |
protected Event |
handleUnaccepted(Event event) |
boolean |
isThrowOnUnaccepted() |
Event |
process(Event event)
Invokes the MessageProcessor.
|
void |
setThrowOnUnaccepted(boolean throwOnUnaccepted) |
void |
setUnacceptedMessageProcessor(Processor unacceptedMessageProcessor) |
applyNext, getListener, getMuleContext, isEventValid, processNext, setFlowConstruct, setListener, setMuleContext, toStringgetAnnotation, getAnnotations, getLocation, setAnnotationsclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetListenergetProcessingTypeprotected boolean throwOnUnaccepted
protected boolean onUnacceptedFlowConstruct
protected Processor unacceptedMessageProcessor
MessageProcessor that should be used to handle messages that are not accepted by the filter.public Event process(Event event) throws org.mule.runtime.api.exception.MuleException
Processorevent - MuleEvent to be processedorg.mule.runtime.api.exception.MuleExceptionpublic org.reactivestreams.Publisher<Event> apply(org.reactivestreams.Publisher<Event> publisher)
ProcessorPublisher function transforming a stream of Event's.
The default implementation delegates to Processor.process(Event) and will:
Processor.process(Event) returns null.publisher - the event stream to transformprotected abstract boolean accept(Event event, Event.Builder builder)
protected Event handleUnaccepted(Event event) throws org.mule.runtime.api.exception.MuleException
org.mule.runtime.api.exception.MuleExceptionprotected MessagingException filterFailureException(Event event, Exception ex)
protected org.mule.runtime.api.exception.MuleException filterUnacceptedException(Event event)
public Processor getUnacceptedMessageProcessor()
public void setUnacceptedMessageProcessor(Processor unacceptedMessageProcessor)
public boolean isThrowOnUnaccepted()
public void setThrowOnUnaccepted(boolean throwOnUnaccepted)
Copyright © 2003–2017 MuleSoft, Inc.. All rights reserved.