org.springframework.integration.handler
Class DefaultMessageHandlerAdapter<T>
java.lang.Object
org.springframework.integration.handler.AbstractMessageHandlerAdapter<T>
org.springframework.integration.handler.DefaultMessageHandlerAdapter<T>
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler
public class DefaultMessageHandlerAdapter<T>
- extends AbstractMessageHandlerAdapter<T>
- implements org.springframework.core.Ordered
An implementation of MessageHandler
that invokes the specified method
on the provided target object. If shouldUseMapperOnInvocation
is set
to true
(the default), it will use the provided
MessageMapper
strategy to
convert the inbound Message
to an object that will be passed as the
method parameter. If the method has a non-null return value, a reply message
will be generated by the mapper.
- Author:
- Mark Fisher
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandlerAdapter |
afterPropertiesSet, getMapper, getMethodName, getObject, getOrder, handle, isInitialized, setMapper, setMethodName, setObject, setOrder, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.core.Ordered |
getOrder |
DefaultMessageHandlerAdapter
public DefaultMessageHandlerAdapter()
setShouldUseMapperOnInvocation
public void setShouldUseMapperOnInvocation(boolean shouldUseMapperOnInvocation)
- Specify whether the handler method should use the
MessageMapper
when
invoking the target method. Default is true
. To force
passing the Message
directly, set this to false
.
doHandle
public java.lang.Object doHandle(Message message,
SimpleMethodInvoker invoker)
- Description copied from class:
AbstractMessageHandlerAdapter
- Subclasses must implement this method. The invoker has been created for
the provided target object and method. May return an object of type
Message
, else rely on the message mapper to convert.
- Specified by:
doHandle
in class AbstractMessageHandlerAdapter<T>