Spring Integration

org.springframework.integration.router
Class MethodInvokingRouter

java.lang.Object
  extended by org.springframework.integration.context.IntegrationObjectSupport
      extended by org.springframework.integration.handler.AbstractMessageHandler
          extended by org.springframework.integration.router.AbstractMessageRouter
              extended by org.springframework.integration.router.AbstractMappingMessageRouter
                  extended by org.springframework.integration.router.MethodInvokingRouter
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, NamedComponent, Orderable, MessageHandler, TrackableComponent, MappingMessageRouterManagement

public class MethodInvokingRouter
extends AbstractMappingMessageRouter

A Message Router that invokes the specified method on the given object. The method's return value may be a single MessageChannel instance, a single String to be interpreted as a channel name, or a Collection (or Array) of either type. If the method returns channel names, then a ChannelResolver is required.

Author:
Mark Fisher

Field Summary
 
Fields inherited from class org.springframework.integration.context.IntegrationObjectSupport
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
MethodInvokingRouter(java.lang.Object object)
           
MethodInvokingRouter(java.lang.Object object, java.lang.reflect.Method method)
           
MethodInvokingRouter(java.lang.Object object, java.lang.String methodName)
           
 
Method Summary
protected  java.util.List<java.lang.Object> getChannelKeys(Message<?> message)
          Subclasses must implement this method to return the channel keys.
 void onInit()
          Subclasses may implement this for initialization logic.
 
Methods inherited from class org.springframework.integration.router.AbstractMappingMessageRouter
determineTargetChannels, getChannelMappings, removeChannelMapping, setChannelMapping, setChannelMappings, setChannelResolver, setPrefix, setResolutionRequired, setSuffix
 
Methods inherited from class org.springframework.integration.router.AbstractMessageRouter
getComponentType, getMessagingTemplate, getRequiredConversionService, handleMessageInternal, setApplySequence, setDefaultOutputChannel, setIgnoreSendFailures, setTimeout
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
getOrder, handleMessage, setOrder, setShouldTrack
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.context.NamedComponent
getComponentName
 

Constructor Detail

MethodInvokingRouter

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

MethodInvokingRouter

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

MethodInvokingRouter

public MethodInvokingRouter(java.lang.Object object)
Method Detail

onInit

public final void onInit()
Description copied from class: IntegrationObjectSupport
Subclasses may implement this for initialization logic.

Overrides:
onInit in class AbstractMappingMessageRouter

getChannelKeys

protected java.util.List<java.lang.Object> getChannelKeys(Message<?> message)
Description copied from class: AbstractMappingMessageRouter
Subclasses must implement this method to return the channel keys. A "key" might be present in this router's "channelMappings", or it could be the channel's name or even the Message Channel instance itself.

Specified by:
getChannelKeys in class AbstractMappingMessageRouter

Spring Integration