|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mule.transport.AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector> org.mule.transport.http.HttpMessageProcessTemplate
public class HttpMessageProcessTemplate
Field Summary | |
---|---|
static int |
MESSAGE_DISCARD_STATUS_CODE
|
static String |
X_RATE_LIMIT_LIMIT_HEADER
|
static String |
X_RATE_LIMIT_REMAINING_HEADER
|
static String |
X_RATE_LIMIT_RESET_HEADER
|
Fields inherited from class org.mule.transport.AbstractTransportMessageProcessTemplate |
---|
logger |
Constructor Summary | |
---|---|
HttpMessageProcessTemplate(HttpMessageReceiver messageReceiver,
HttpServerConnection httpServerConnection,
WorkManager flowExecutionWorkManager)
|
Method Summary | |
---|---|
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 |
void |
awaitTermination()
|
MuleEvent |
beforeRouteEvent(MuleEvent muleEvent)
Pre processing of the MuleEvent to route |
protected MuleMessage |
createMessageFromSource(Object message)
|
void |
discardInvalidMessage()
Discards the message because the validation failed |
void |
discardMessageOnThrottlingExceeded()
Discards the message due to ThrottlingPolicy configured for the MessageSource is exceeded |
protected HttpResponse |
doBad(RequestLine requestLine)
|
protected HttpServerConnection |
getHttpServerConnection()
|
Latch |
getMessageProcessedLatch()
|
void |
messageProcessingEnded()
template method call when the message processing ends |
protected String |
processRelativePath(String contextPath,
String path)
|
void |
sendFailureResponseToClient(MessagingException messagingException)
|
void |
sendResponseToClient(MuleEvent responseMuleEvent)
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. |
boolean |
supportsAsynchronousProcessing()
|
protected HttpResponse |
transformResponse(Object response)
|
boolean |
validateMessage()
Validates the message content. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.mule.execution.FlowProcessingPhaseTemplate |
---|
afterFailureProcessingFlow, afterRouteEvent, afterSuccessfulProcessingFlow, getMuleEvent, getOriginalMessage, routeEvent |
Field Detail |
---|
public static final int MESSAGE_DISCARD_STATUS_CODE
public static final String X_RATE_LIMIT_LIMIT_HEADER
public static final String X_RATE_LIMIT_REMAINING_HEADER
public static final String X_RATE_LIMIT_RESET_HEADER
Constructor Detail |
---|
public HttpMessageProcessTemplate(HttpMessageReceiver messageReceiver, HttpServerConnection httpServerConnection, WorkManager flowExecutionWorkManager)
Method Detail |
---|
public void sendResponseToClient(MuleEvent responseMuleEvent) throws MuleException
RequestResponseFlowProcessingPhaseTemplate
sendResponseToClient
in interface RequestResponseFlowProcessingPhaseTemplate
responseMuleEvent
- 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<HttpMessageReceiver,HttpConnector>
MuleException
public MuleEvent beforeRouteEvent(MuleEvent muleEvent) throws MuleException
FlowProcessingPhaseTemplate
MuleEvent
to route
beforeRouteEvent
in interface FlowProcessingPhaseTemplate
beforeRouteEvent
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
MuleException
protected HttpResponse transformResponse(Object response) throws MuleException
MuleException
protected MuleMessage createMessageFromSource(Object message) throws MuleException
createMessageFromSource
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
MuleException
protected String processRelativePath(String contextPath, String path)
public Object acquireMessage() throws MuleException
AbstractTransportMessageProcessTemplate
MessageProcessContext
acquireMessage
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
MessageSource
MuleException
public boolean validateMessage()
ValidationPhaseTemplate
ValidationPhaseTemplate.discardInvalidMessage()
will be executed so the implementation can save the reason why the message is invalid
to report why the message has been discarded when ValidationPhaseTemplate.discardInvalidMessage()
is called
validateMessage
in interface ValidationPhaseTemplate
validateMessage
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
public void discardInvalidMessage() throws MuleException
ValidationPhaseTemplate
discardInvalidMessage
in interface ValidationPhaseTemplate
discardInvalidMessage
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
MuleException
public boolean supportsAsynchronousProcessing()
supportsAsynchronousProcessing
in interface MessageProcessContext
supportsAsynchronousProcessing
in class AbstractTransportMessageProcessTemplate<HttpMessageReceiver,HttpConnector>
protected HttpResponse doBad(RequestLine requestLine) throws MuleException
MuleException
protected HttpServerConnection getHttpServerConnection()
public Latch getMessageProcessedLatch()
public void discardMessageOnThrottlingExceeded() throws MuleException
ThrottlingPhaseTemplate
MessageSource
is exceeded
discardMessageOnThrottlingExceeded
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 called
setThrottlingPolicyStatistics
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 messageProcessingEnded()
EndPhaseTemplate
messageProcessingEnded
in interface EndPhaseTemplate
public void awaitTermination() throws InterruptedException
InterruptedException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |