org.mule.transport
Class AbstractTransportMessageProcessTemplate<MessageReceiverType extends AbstractMessageReceiver,ConnectorType extends AbstractConnector>
java.lang.Object
org.mule.transport.AbstractTransportMessageProcessTemplate<MessageReceiverType,ConnectorType>
- All Implemented Interfaces:
- FlowProcessingPhaseTemplate, MessageProcessContext, MessageProcessTemplate, ValidationPhaseTemplate
public abstract class AbstractTransportMessageProcessTemplate<MessageReceiverType extends AbstractMessageReceiver,ConnectorType extends AbstractConnector>
- extends Object
- implements FlowProcessingPhaseTemplate, ValidationPhaseTemplate, MessageProcessContext
|
Field Summary |
protected org.apache.commons.logging.Log |
logger
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected transient org.apache.commons.logging.Log logger
AbstractTransportMessageProcessTemplate
public AbstractTransportMessageProcessTemplate(MessageReceiverType messageReceiver,
WorkManager flowExecutionWorkManager)
getMuleEvent
public MuleEvent getMuleEvent()
throws MuleException
- Specified by:
getMuleEvent in interface FlowProcessingPhaseTemplate
- Returns:
- a
MuleEvent created from the original message
- Throws:
MuleException
getMessageSource
public MessageSource getMessageSource()
- Specified by:
getMessageSource in interface MessageProcessContext
- Returns:
- the
MessageSource that retrieve the message. Can not be null
getOriginalMessage
public Object getOriginalMessage()
throws MuleException
- Specified by:
getOriginalMessage in interface FlowProcessingPhaseTemplate
- Returns:
- the original message
- Throws:
MuleException
afterFailureProcessingFlow
public void afterFailureProcessingFlow(MessagingException messagingException)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Call when the processing of the message through the flow fails during message processing
- Specified by:
afterFailureProcessingFlow in interface FlowProcessingPhaseTemplate
- Throws:
MuleException
afterFailureProcessingFlow
public void afterFailureProcessingFlow(MuleException exception)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Call when the processing of the message through the flow fails in an exception strategy
- Specified by:
afterFailureProcessingFlow in interface FlowProcessingPhaseTemplate
- Throws:
MuleException
routeEvent
public MuleEvent routeEvent(MuleEvent muleEvent)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Routes the
MuleEvent through the processors chain
- Specified by:
routeEvent in interface FlowProcessingPhaseTemplate
- Parameters:
muleEvent - MuleEvent created from the raw message of this context
- Returns:
- the response
MuleEvent
- Throws:
MuleException
sendResponseMessage
protected void sendResponseMessage(MuleEvent responseMuleEvent)
throws MessagingException
- Throws:
MessagingException
afterSuccessfulProcessingFlow
public void afterSuccessfulProcessingFlow(MuleEvent response)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Call after successfully processing the message through the flow
- Specified by:
afterSuccessfulProcessingFlow in interface FlowProcessingPhaseTemplate
- Throws:
MuleException
acquireMessage
public abstract Object acquireMessage()
throws MuleException
- This method will only be called once for the
MessageProcessContext
- Returns:
- the raw message from the
MessageSource
- Throws:
MuleException
propagateRootMessageIdProperty
protected void propagateRootMessageIdProperty(MuleMessage message)
validateMessage
public boolean validateMessage()
- Description copied from interface:
ValidationPhaseTemplate
- Validates the message content.
In case that the message is not valid then
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
- Specified by:
validateMessage in interface ValidationPhaseTemplate
- Returns:
- false if the message is invalid, true otherwise
discardInvalidMessage
public void discardInvalidMessage()
throws MuleException
- Description copied from interface:
ValidationPhaseTemplate
- Discards the message because the validation failed
- Specified by:
discardInvalidMessage in interface ValidationPhaseTemplate
- Throws:
MuleException
warnIfMuleClientSendUsed
protected void warnIfMuleClientSendUsed(MuleMessage message)
createEventFromMuleMessage
protected MuleEvent createEventFromMuleMessage(MuleMessage muleMessage)
throws MuleException
- Throws:
MuleException
getOutputStream
protected OutputStream getOutputStream()
createMessageFromSource
protected MuleMessage createMessageFromSource(Object message)
throws MuleException
- Throws:
MuleException
getMessageReceiver
protected MessageReceiverType getMessageReceiver()
getInboundEndpoint
protected InboundEndpoint getInboundEndpoint()
getConnector
protected ConnectorType getConnector()
getMuleContext
protected MuleContext getMuleContext()
getFlowConstruct
public FlowConstruct getFlowConstruct()
- Specified by:
getFlowConstruct in interface MessageProcessContext
- Returns:
- the
FlowConstruct were the incoming message is going to be executed. Can not be null
supportsAsynchronousProcessing
public boolean supportsAsynchronousProcessing()
- Specified by:
supportsAsynchronousProcessing in interface MessageProcessContext
- Returns:
- true if the message can be processed in a different thread than the one it was acquired, false otherwise
beforeRouteEvent
public MuleEvent beforeRouteEvent(MuleEvent muleEvent)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Pre processing of the
MuleEvent to route
- Specified by:
beforeRouteEvent in interface FlowProcessingPhaseTemplate
- Throws:
MuleException
afterRouteEvent
public MuleEvent afterRouteEvent(MuleEvent muleEvent)
throws MuleException
- Description copied from interface:
FlowProcessingPhaseTemplate
- Post processing of the routed
MuleEvent
- Specified by:
afterRouteEvent in interface FlowProcessingPhaseTemplate
- Throws:
MuleException
getFlowExecutionWorkManager
public WorkManager getFlowExecutionWorkManager()
- Specified by:
getFlowExecutionWorkManager in interface MessageProcessContext
- Returns:
- the
WorkManager were the incoming message must be processed.
If null it will be executed in the same thread were the message was received
getTransactionConfig
public TransactionConfig getTransactionConfig()
- Specified by:
getTransactionConfig in interface MessageProcessContext
- Returns:
- the
TransactionConfig associated to the MessageSource that received the message.
If null then no transaction config will be used.
Copyright © 2003-2013 MuleSoft, Inc.. All Rights Reserved.