org.springframework.integration.handler
Class DefaultMessageHandler
java.lang.Object
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.DefaultMessageHandler
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler
public class DefaultMessageHandler
- extends AbstractMessageHandler
The default MessageHandler implementation. Creates a Message for the reply payload.
The request Message's headers are copied and the request Message's ID is set as this
reply Message's correlationId.
- Author:
- Mark Fisher
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultMessageHandler
public DefaultMessageHandler()
createReplyMessage
protected Message<?> createReplyMessage(java.lang.Object result,
Message<?> requestMessage)
- Description copied from class:
AbstractMessageHandler
- Subclasses must implement this method to generate the reply Message when
the return value is not a Message instance.
- Specified by:
createReplyMessage
in class AbstractMessageHandler
- Parameters:
result
- the return value from an adapter method, or the Message payload if not acting as an adapterrequestMessage
- the original request Message
- Returns:
- the Message to be sent to the reply MessageTarget
postProcessReplyMessage
protected Message<?> postProcessReplyMessage(Message<?> replyMessage,
Message<?> requestMessage)
- Description copied from class:
AbstractMessageHandler
- Subclasses must implement this method to process a return value that
is already a Message instance.
- Specified by:
postProcessReplyMessage
in class AbstractMessageHandler
- Parameters:
replyMessage
- the Message returned from an adapter methodrequestMessage
- the original request Message
- Returns:
- the Message to be sent to the reply MessageTarget
prepareReplyMessage
private Message<?> prepareReplyMessage(MessageBuilder<?> builder,
MessageHeaders requestHeaders)