org.springframework.integration.router
Class AbstractChannelNameResolvingMessageRouter

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.AbstractChannelNameResolvingMessageRouter
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, MessageHandler, ComponentMetadataProvider
Direct Known Subclasses:
AbstractSingleChannelNameRouter, AbstractXPathRouter, ExpressionEvaluatingRouter, HeaderValueRouter, MethodInvokingRouter

public abstract class AbstractChannelNameResolvingMessageRouter
extends AbstractMessageRouter

A base class for router implementations that return only the channel name(s) rather than MessageChannel instances.

Author:
Mark Fisher, Jonas Partner

Field Summary
 
Fields inherited from class org.springframework.integration.handler.AbstractMessageHandler
logger
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
AbstractChannelNameResolvingMessageRouter()
           
 
Method Summary
protected  void addChannelFromString(java.util.Collection<MessageChannel> channels, java.lang.String channelName, Message<?> message)
           
protected  void addToCollection(java.util.Collection<MessageChannel> channels, java.util.Collection<?> channelIndicators, Message<?> message)
           
protected  java.util.Collection<MessageChannel> determineTargetChannels(Message<?> message)
          Subclasses must implement this method to return the target channels for a given Message.
protected abstract  java.util.List<java.lang.Object> getChannelIndicatorList(Message<?> message)
          Subclasses must implement this method to return the channel indicators.
 void onInit()
          Subclasses may implement this for initialization logic.
protected  MessageChannel resolveChannelForName(java.lang.String channelName, Message<?> message)
           
 void setChannelResolver(ChannelResolver channelResolver)
           
 void setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures)
           
 void setPrefix(java.lang.String prefix)
           
 void setSuffix(java.lang.String suffix)
           
 
Methods inherited from class org.springframework.integration.router.AbstractMessageRouter
handleMessageInternal, populateComponentMetadata, setApplySequence, setDefaultOutputChannel, setIgnoreSendFailures, setResolutionRequired, setTimeout
 
Methods inherited from class org.springframework.integration.handler.AbstractMessageHandler
getOrder, handleMessage, resolveReplyChannel, setOrder
 
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport
afterPropertiesSet, getBeanFactory, getBeanName, getChannelResolver, getComponentMetadata, getConversionService, getTaskScheduler, setBeanFactory, setBeanName, setConversionService, setTaskScheduler, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractChannelNameResolvingMessageRouter

public AbstractChannelNameResolvingMessageRouter()
Method Detail

setChannelResolver

public void setChannelResolver(ChannelResolver channelResolver)
Overrides:
setChannelResolver in class IntegrationObjectSupport

setPrefix

public void setPrefix(java.lang.String prefix)

setSuffix

public void setSuffix(java.lang.String suffix)

setIgnoreChannelNameResolutionFailures

public void setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures)

onInit

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

Overrides:
onInit in class IntegrationObjectSupport

resolveChannelForName

protected MessageChannel resolveChannelForName(java.lang.String channelName,
                                               Message<?> message)

determineTargetChannels

protected java.util.Collection<MessageChannel> determineTargetChannels(Message<?> message)
Description copied from class: AbstractMessageRouter
Subclasses must implement this method to return the target channels for a given Message.

Specified by:
determineTargetChannels in class AbstractMessageRouter

addToCollection

protected void addToCollection(java.util.Collection<MessageChannel> channels,
                               java.util.Collection<?> channelIndicators,
                               Message<?> message)

addChannelFromString

protected void addChannelFromString(java.util.Collection<MessageChannel> channels,
                                    java.lang.String channelName,
                                    Message<?> message)

getChannelIndicatorList

protected abstract java.util.List<java.lang.Object> getChannelIndicatorList(Message<?> message)
Subclasses must implement this method to return the channel indicators.