org.springframework.integration.handler
Class MethodInvokingTarget
java.lang.Object
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.handler.MethodInvokingTarget
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler, MessageTarget
public class MethodInvokingTarget
- extends AbstractMessageHandler
- implements MessageTarget
A messaging target that invokes the specified method on the provided object.
- 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 |
MethodInvokingTarget
public MethodInvokingTarget()
send
public boolean send(Message<?> message)
- Description copied from interface:
MessageTarget
- Send a
Message
to this target. May throw a RuntimeException for non-recoverable
errors. Otherwise, if the Message cannot be sent for a non-fatal reason such as timeout,
then this method will return 'false', and if the Message is sent successfully, it will
return 'true'.
- Specified by:
send
in interface MessageTarget
- Parameters:
message
- the Message to send
- Returns:
- whether the Message has been sent successfully
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
failIfNotNull
private void failIfNotNull(java.lang.Object result,
Message<?> requestMessage)