public class JettyMessageProcessTemplate extends AbstractTransportMessageProcessTemplate implements RequestResponseFlowProcessingPhaseTemplate, ThrottlingPhaseTemplate
logger
Constructor and Description |
---|
JettyMessageProcessTemplate(HttpServletRequest request,
HttpServletResponse response,
AbstractMessageReceiver messageReceiver,
MuleContext muleContext) |
Modifier and Type | Method and Description |
---|---|
Object |
acquireMessage()
This method will only be called once for the
MessageProcessContext |
void |
afterFailureProcessingFlow(MuleException exception)
Call when the processing of the message through the flow fails in an exception strategy
|
protected MuleMessage |
createMessageFromSource(Object message) |
void |
discardMessageOnThrottlingExceeded()
Discards the message due to ThrottlingPolicy configured for the
MessageSource is exceeded |
protected HttpServletResponse |
getServletResponse() |
protected ServletResponseWriter |
getServletResponseWriter() |
void |
sendFailureResponseToClient(MessagingException messagingException) |
void |
sendResponseToClient(MuleEvent muleEvent)
Template method to send a response after processing the message.
|
void |
setThrottlingPolicyStatistics(long remainingRequestInCurrentPeriod,
long maximumRequestAllowedPerPeriod,
long timeUntilNextPeriodInMillis)
Set up throttling policy state to be used by the
MessageSource for debugging or
information purpose. |
afterFailureProcessingFlow, afterRouteEvent, afterSuccessfulProcessingFlow, beforeRouteEvent, createEventFromMuleMessage, discardInvalidMessage, getConnector, getFlowConstruct, getInboundEndpoint, getMessageReceiver, getMuleContext, getMuleEvent, getOriginalMessage, getOutputStream, propagateRootMessageIdProperty, routeEvent, validateMessage, warnIfMuleClientSendUsed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
afterFailureProcessingFlow, afterRouteEvent, afterSuccessfulProcessingFlow, beforeRouteEvent, getMuleEvent, getOriginalMessage, routeEvent
getMuleEvent
public JettyMessageProcessTemplate(HttpServletRequest request, HttpServletResponse response, AbstractMessageReceiver messageReceiver, MuleContext muleContext)
public Object acquireMessage() throws MuleException
AbstractTransportMessageProcessTemplate
MessageProcessContext
acquireMessage
in class AbstractTransportMessageProcessTemplate
MessageSource
MuleException
protected MuleMessage createMessageFromSource(Object message) throws MuleException
createMessageFromSource
in class AbstractTransportMessageProcessTemplate
MuleException
public void discardMessageOnThrottlingExceeded() throws MuleException
ThrottlingPhaseTemplate
MessageSource
is exceededdiscardMessageOnThrottlingExceeded
in interface ThrottlingPhaseTemplate
MuleException
public void setThrottlingPolicyStatistics(long remainingRequestInCurrentPeriod, long maximumRequestAllowedPerPeriod, long timeUntilNextPeriodInMillis)
ThrottlingPhaseTemplate
MessageSource
for debugging or
information purpose.
Not all throttling policy supports statistics so this method may not be calledsetThrottlingPolicyStatistics
in interface ThrottlingPhaseTemplate
remainingRequestInCurrentPeriod
- the remaining allowed messages in the current periodmaximumRequestAllowedPerPeriod
- the maximum allowed messages in a periodtimeUntilNextPeriodInMillis
- time in milliseconds until the next period startspublic void sendResponseToClient(MuleEvent muleEvent) throws MuleException
RequestResponseFlowProcessingPhaseTemplate
sendResponseToClient
in interface RequestResponseFlowProcessingPhaseTemplate
muleEvent
- the event with the content of the response to be sent.MuleException
- exception thrown when processing the message to send the response. If there's a failure when writing the response
using the underlying transport or connector then the exception to throw must be a ResponseDispatchException
.public void sendFailureResponseToClient(MessagingException messagingException) throws MuleException
sendFailureResponseToClient
in interface RequestResponseFlowProcessingPhaseTemplate
messagingException
- exception thrown during the flow execution.MuleException
- exception thrown when processing the message to send the response.public void afterFailureProcessingFlow(MuleException exception) throws MuleException
FlowProcessingPhaseTemplate
afterFailureProcessingFlow
in interface FlowProcessingPhaseTemplate
afterFailureProcessingFlow
in class AbstractTransportMessageProcessTemplate
MuleException
protected ServletResponseWriter getServletResponseWriter()
protected HttpServletResponse getServletResponse()
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.