Spring Integration

org.springframework.integration.xml.router
Class XPathSingleChannelRouter

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
                  extended by org.springframework.integration.xml.router.AbstractXPathRouter
                      extended by org.springframework.integration.xml.router.XPathSingleChannelRouter
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, MessageHandler, TrackableComponent

public class XPathSingleChannelRouter
extends AbstractXPathRouter

Router that evaluates the payload using XPathExpression.evaluateAsString(Node) to extract a channel name. The payload is extracted as a node using the provided XmlPayloadConverter with DefaultXmlPayloadConverter being the default.

The provided XPathExpression must evaluate to a non-empty String.

Author:
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
XPathSingleChannelRouter(String expression)
           
XPathSingleChannelRouter(String expression, Map<String,String> namespaces)
           
XPathSingleChannelRouter(String expression, String prefix, String namespace)
           
XPathSingleChannelRouter(org.springframework.xml.xpath.XPathExpression expression)
           
 
Method Summary
protected  List<Object> getChannelIndicatorList(Message<?> message)
          Evaluates the payload using XPathExpression.evaluateAsString(Node)
 
Methods inherited from class org.springframework.integration.xml.router.AbstractXPathRouter
getConverter, getXPathExpression, setConverter
 
Methods inherited from class org.springframework.integration.router.AbstractChannelNameResolvingMessageRouter
determineTargetChannels, onInit, setChannelResolver, setIgnoreChannelNameResolutionFailures, setPrefix, setSuffix
 
Methods inherited from class org.springframework.integration.router.AbstractMessageRouter
getComponentType, getMessagingTemplate, handleMessageInternal, setApplySequence, setDefaultOutputChannel, setIgnoreSendFailures, setResolutionRequired, 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, getRequiredMetadataPersister, 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

XPathSingleChannelRouter

public XPathSingleChannelRouter(String expression,
                                Map<String,String> namespaces)
See Also:
AbstractXPathRouter.AbstractXPathRouter(String, Map)

XPathSingleChannelRouter

public XPathSingleChannelRouter(String expression,
                                String prefix,
                                String namespace)
See Also:
AbstractXPathRouter.AbstractXPathRouter(String, String, String)

XPathSingleChannelRouter

public XPathSingleChannelRouter(String expression)
See Also:
AbstractXPathRouter.AbstractXPathRouter(String)

XPathSingleChannelRouter

public XPathSingleChannelRouter(org.springframework.xml.xpath.XPathExpression expression)
See Also:
AbstractXPathRouter.AbstractXPathRouter(XPathExpression)
Method Detail

getChannelIndicatorList

protected List<Object> getChannelIndicatorList(Message<?> message)
Evaluates the payload using XPathExpression.evaluateAsString(Node)

Specified by:
getChannelIndicatorList in class AbstractChannelNameResolvingMessageRouter
Throws:
MessagingException - if the XPathExpression evaluates to an empty string

Spring Integration

Copyright © 2010. All Rights Reserved.