public abstract class AbstractRequestResponseMessageProcessor extends AbstractInterceptingMessageProcessor implements NonBlockingSupported
MessageProcessor
that may performs processing during both the
request and response processing phases while supporting non-blocking execution.
In order to define the process during the request phase you should override the
processRequest(org.mule.api.MuleEvent)
method. Symmetrically, if you need to define a process to be executed
during the response phase, then you should override the processResponse(MuleEvent, MuleEvent)
method.
In some cases you'll have some code that should be always executed, even if an error occurs, for those cases you
should override the processFinally(org.mule.api.MuleEvent, org.mule.api.MessagingException)
method.logger, muleContext, next, notificationHandler
PROPERTY_NAME
Constructor and Description |
---|
AbstractRequestResponseMessageProcessor() |
Modifier and Type | Method and Description |
---|---|
protected ReplyToHandler |
createReplyToHandler(MuleEvent request) |
MuleEvent |
process(MuleEvent event)
Invokes the MessageProcessor.
|
protected MuleEvent |
processBlocking(MuleEvent event) |
protected void |
processFinally(MuleEvent event,
MessagingException exception)
Used to perform post processing after both request and response phases have been completed.
|
protected MuleEvent |
processNonBlocking(MuleEvent event) |
protected MuleEvent |
processRequest(MuleEvent request)
Processes the request phase before the next message processor is invoked.
|
protected MuleEvent |
processResponse(MuleEvent response)
Deprecated.
|
protected MuleEvent |
processResponse(MuleEvent response,
MuleEvent request)
Processes the response phase after the next message processor and it's response phase have been invoked
|
addMessageProcessorPathElements, getListener, getMuleContext, isEventValid, processNext, setListener, setMuleContext, toString
getAnnotation, getAnnotations, setAnnotations
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setListener
public AbstractRequestResponseMessageProcessor()
public final MuleEvent process(MuleEvent event) throws MuleException
MessageProcessor
process
in interface MessageProcessor
event
- MuleEvent to be processedMuleException
protected MuleEvent processBlocking(MuleEvent event) throws MuleException
MuleException
protected MuleEvent processNonBlocking(MuleEvent event) throws MuleException
MuleException
protected ReplyToHandler createReplyToHandler(MuleEvent request)
protected MuleEvent processRequest(MuleEvent request) throws MuleException
request
- event to be processed.MuleException
- exception thrown by implementations of this method whiile performing response processingprotected MuleEvent processResponse(MuleEvent response, MuleEvent request) throws MuleException
response
- response event to be processed.request
- the request eventMuleException
- exception thrown by implementations of this method whiile performing response processing@Deprecated protected MuleEvent processResponse(MuleEvent response) throws MuleException
processResponse(MuleEvent, MuleEvent)
instead.response
- response event to be processed.MuleException
- exception thrown by implementations of this method whiile performing response processingprotected void processFinally(MuleEvent event, MessagingException exception)
event
- the result of request and response processing. Note that this includes the request and response
processing of the rest of the Flow following this message processor too.exception
- the exception thrown during processing if any. If not exception was thrown then this parameter
is nullCopyright © 2003–2016 MuleSoft, Inc.. All rights reserved.