The router hierarchy abstract method names are now 'determineTargetChannel', 'determineTargetChannelNames', etc (instead of "resolve..."). This clarifies the distinction between the target channel decision and the resolution of a channel *name* to a channel instance. The latter is now the responsibility of a ChannelResolver strategy, and all subclasses of AbstractChannelNameResolvingMessageRouter now delegate to a ChannelResolver after 'determineTargetChannelNames' has returned the channel name(s). In most cases, it will be a BeanFactoryChannelResolver.
This commit is contained in:
@@ -77,7 +77,7 @@ public class XPathMultiChannelRouter extends AbstractXPathRouter {
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public String[] resolveChannelNames(Message<?> message) {
|
||||
public String[] determineTargetChannelNames(Message<?> message) {
|
||||
Node node = getConverter().convertToNode(message.getPayload());
|
||||
List channelNamesList = getXPathExpression().evaluate(node, this.nodeMapper);
|
||||
return (String[]) channelNamesList.toArray(new String[channelNamesList.size()]);
|
||||
|
||||
@@ -73,7 +73,7 @@ public class XPathSingleChannelRouter extends AbstractXPathRouter {
|
||||
* @throws MessagingException if the {@link XPathExpression} evaluates to
|
||||
* an empty string
|
||||
*/
|
||||
public String[] resolveChannelNames(Message<?> message) {
|
||||
public String[] determineTargetChannelNames(Message<?> message) {
|
||||
Node node = getConverter().convertToNode(message.getPayload());
|
||||
String result = getXPathExpression().evaluateAsString(node);
|
||||
if ("".equals(result)) {
|
||||
|
||||
Reference in New Issue
Block a user