org.springframework.integration.router
Class RouterMessageHandler

java.lang.Object
  extended by org.springframework.integration.handler.AbstractMessageHandler
      extended by org.springframework.integration.router.RouterMessageHandler
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler

public class RouterMessageHandler
extends AbstractMessageHandler

MessageHandler adapter for methods annotated with @Router.

Author:
Mark Fisher

Field Summary
private  MessageChannel defaultChannel
           
 
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
RouterMessageHandler()
           
RouterMessageHandler(java.lang.Object object, java.lang.reflect.Method method)
           
RouterMessageHandler(java.lang.Object object, java.lang.String methodName)
           
 
Method Summary
protected  Message<?> createReplyMessage(java.lang.Object result, Message<?> requestMessage)
          Subclasses must implement this method to generate the reply Message when the return value is not a Message instance.
protected  Message<?> postProcessReplyMessage(Message<?> replyMessage, Message<?> requestMessage)
          Subclasses must implement this method to process a return value that is already a Message instance.
 void setDefaultChannel(MessageChannel defaultChannel)
           
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
afterPropertiesSet, getOrder, handle, setMethod, setMethodName, setObject, setOrder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultChannel

private volatile MessageChannel defaultChannel
Constructor Detail

RouterMessageHandler

public RouterMessageHandler(java.lang.Object object,
                            java.lang.reflect.Method method)

RouterMessageHandler

public RouterMessageHandler(java.lang.Object object,
                            java.lang.String methodName)

RouterMessageHandler

public RouterMessageHandler()
Method Detail

setDefaultChannel

public void setDefaultChannel(MessageChannel defaultChannel)

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 adapter
requestMessage - 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 method
requestMessage - the original request Message
Returns:
the Message to be sent to the reply MessageTarget