org.springframework.integration.router
Class PayloadTypeRouter

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.PayloadTypeRouter
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, NamedComponent, Orderable, MessageHandler, TrackableComponent

public class PayloadTypeRouter
extends AbstractMappingMessageRouter

A Message Router that resolves the MessageChannel based on the Message's payload type.


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
PayloadTypeRouter()
           
 
Method Summary
protected  java.util.List<java.lang.Object> getChannelKeys(Message<?> message)
          Selects the most appropriate channel name matching channel identifiers which are the fully qualified class names encountered while traversing the payload type hierarchy.
 
Methods inherited from class org.springframework.integration.router.AbstractMappingMessageRouter
determineTargetChannels, getChannelMappings, onInit, 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

PayloadTypeRouter

public PayloadTypeRouter()
Method Detail

getChannelKeys

protected java.util.List<java.lang.Object> getChannelKeys(Message<?> message)
Selects the most appropriate channel name matching channel identifiers which are the fully qualified class names encountered while traversing the payload type hierarchy. To resolve ties and conflicts (e.g., Serializable and String) it will match: 1. Type name to channel identifier else... 2. Name of the subclass of the type to channel identifier else... 3. Name of the Interface of the type to channel identifier while also preferring direct interface over indirect subclass

Specified by:
getChannelKeys in class AbstractMappingMessageRouter