fixed 'apply-sequence' for DefaultRouterParser and now comma-delimited strings are converted to arrays

This commit is contained in:
Mark Fisher
2010-03-12 02:59:45 +00:00
parent 6a92fd680d
commit 2b3bdd9e8c
4 changed files with 48 additions and 2 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,6 +54,8 @@ public class DefaultRouterParser extends AbstractDelegatingConsumerEndpointParse
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "timeout");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "resolution-required");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-channel-name-resolution-failures");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "apply-sequence");
IntegrationNamespaceUtils.setValueIfAttributeDefined(builder, element, "ignore-send-failures");
}
}

View File

@@ -29,6 +29,7 @@ import org.springframework.integration.core.Message;
import org.springframework.integration.core.MessageChannel;
import org.springframework.integration.core.MessagingException;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
/**
* A base class for router implementations that return only the channel name(s)
@@ -135,6 +136,12 @@ public abstract class AbstractChannelNameResolvingMessageRouter extends Abstract
}
protected void addChannelFromString(Collection<MessageChannel> channels, String channelName, Message<?> message) {
if (channelName.indexOf(',') != -1) {
for (String name : StringUtils.commaDelimitedListToStringArray(channelName)) {
addChannelFromString(channels, name, message);
}
return;
}
if (this.prefix != null) {
channelName = this.prefix + channelName;
}