Spring Integration

org.springframework.integration.handler
Class MethodInvokingMessageHandler

java.lang.Object
  extended by org.springframework.integration.util.AbstractExpressionEvaluator
      extended by org.springframework.integration.handler.AbstractMessageProcessor<T>
          extended by org.springframework.integration.handler.MethodInvokingMessageProcessor<Object>
              extended by org.springframework.integration.handler.MethodInvokingMessageHandler
All Implemented Interfaces:
BeanFactoryAware, Ordered, MessageHandler, MessageProcessor<Object>

public class MethodInvokingMessageHandler
extends MethodInvokingMessageProcessor<Object>
implements MessageHandler, Ordered

A MessageHandler that invokes the specified method on the provided object.

Author:
Mark Fisher

Field Summary
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
MethodInvokingMessageHandler(Object object, Method method)
           
MethodInvokingMessageHandler(Object object, String methodName)
           
 
Method Summary
 int getOrder()
           
 void handleMessage(Message<?> message)
          Handles the message if possible.
 void setOrder(int order)
           
 
Methods inherited from class org.springframework.integration.handler.MethodInvokingMessageProcessor
processMessage, setBeanFactory, setConversionService
 
Methods inherited from class org.springframework.integration.util.AbstractExpressionEvaluator
evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, evaluateExpression, getEvaluationContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodInvokingMessageHandler

public MethodInvokingMessageHandler(Object object,
                                    Method method)

MethodInvokingMessageHandler

public MethodInvokingMessageHandler(Object object,
                                    String methodName)
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Specified by:
getOrder in interface Ordered

handleMessage

public void handleMessage(Message<?> message)
Description copied from interface: MessageHandler
Handles the message if possible. If the handler cannot deal with the message this will result in a MessageRejectedException e.g. in case of a Selective Consumer. When a consumer tries to handle a message, but fails to do so, a MessageHandlingException is thrown. In the last case it is recommended to treat the message as tainted and go into an error scenario.

When the handling results in a failure of another message being sent (e.g. a "reply" message), that failure will trigger a MessageDeliveryException.

Specified by:
handleMessage in interface MessageHandler
Parameters:
message - the message to be handled

Spring Integration

Copyright © 2010. All Rights Reserved.