renamed getChannelIndicatorList method to getChannelIdentifiers on AbstractMessageRouter

This commit is contained in:
Mark Fisher
2010-11-10 08:50:21 -05:00
parent 0a82438e2e
commit 38aa676cb9
13 changed files with 47 additions and 48 deletions

View File

@@ -54,7 +54,7 @@ class AbstractMessageProcessingRouter extends AbstractMessageRouter {
}
@Override
protected List<Object> getChannelIndicatorList(Message<?> message) {
protected List<Object> getChannelIdentifiers(Message<?> message) {
Object result = this.messageProcessor.processMessage(message);
List<Object> asList = new ArrayList<Object>();
asList.add(result);

View File

@@ -190,7 +190,7 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
private Collection<MessageChannel> determineTargetChannels(Message<?> message) {
this.afterPropertiesSet();
Collection<MessageChannel> channels = new ArrayList<MessageChannel>();
Collection<Object> channelsReturned = this.getChannelIndicatorList(message);
Collection<Object> channelsReturned = this.getChannelIdentifiers(message);
addToCollection(channels, channelsReturned, message);
return channels;
}
@@ -205,7 +205,7 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
/**
* Subclasses must implement this method to return the channel identifiers.
*/
protected abstract List<Object> getChannelIndicatorList(Message<?> message);
protected abstract List<Object> getChannelIdentifiers(Message<?> message);
@Override

View File

@@ -30,7 +30,7 @@ import org.springframework.integration.Message;
public abstract class AbstractSingleChannelNameRouter extends AbstractMessageRouter {
@Override
protected final List<Object> getChannelIndicatorList(Message<?> message) {
protected final List<Object> getChannelIdentifiers(Message<?> message) {
List<Object> channelList = new ArrayList<Object>();
String channelName = determineTargetChannelName(message);
if(channelName != null){

View File

@@ -33,21 +33,20 @@ import org.springframework.integration.MessageChannel;
public class ErrorMessageExceptionTypeRouter extends AbstractMessageRouter {
@Override
protected List<Object> getChannelIndicatorList(Message<?> message) {
String channelName = null;
protected List<Object> getChannelIdentifiers(Message<?> message) {
String channelIdentifier = null;
Object payload = message.getPayload();
if (payload != null && (payload instanceof Throwable)) {
if (payload != null && (payload instanceof Throwable) && this.channelIdentifierMap != null) {
Throwable mostSpecificCause = (Throwable) payload;
while (mostSpecificCause != null) {
channelIdentifier = mostSpecificCause.getClass().getName();
if (channelIdentifierMap != null){
String tempChannelName = channelIdentifierMap.get(channelIdentifier);
channelName = tempChannelName == null ? channelName : tempChannelName;
String mappedChannelIdentifier = this.channelIdentifierMap.get(mostSpecificCause.getClass().getName());
if (mappedChannelIdentifier != null) {
channelIdentifier = mappedChannelIdentifier;
}
mostSpecificCause = mostSpecificCause.getCause();
}
}
return Collections.singletonList((Object)channelName);
return Collections.singletonList((Object) channelIdentifier);
}
}

View File

@@ -43,7 +43,7 @@ public class HeaderValueRouter extends AbstractMessageRouter {
}
@Override
protected List<Object> getChannelIndicatorList(Message<?> message) {
protected List<Object> getChannelIdentifiers(Message<?> message) {
Object value = message.getHeaders().get(this.headerName);
if (value instanceof String && ((String) value).indexOf(',') != -1) {
value = StringUtils.tokenizeToStringArray((String) value, ",", true, true);

View File

@@ -44,7 +44,7 @@ public class PayloadTypeRouter extends AbstractMessageRouter {
* preferring direct interface over indirect subclass
*/
@Override
protected List<Object> getChannelIndicatorList(Message<?> message) {
protected List<Object> getChannelIdentifiers(Message<?> message) {
Class<?> firstInterfaceMatch = null;
Class<?> type = message.getPayload().getClass();
while (type != null && !CollectionUtils.isEmpty(this.channelIdentifierMap)) {

View File

@@ -91,7 +91,7 @@ public class RecipientListRouter extends AbstractMessageRouter implements Initia
}
@Override
protected List<Object> getChannelIndicatorList(Message<?> message) {
protected List<Object> getChannelIdentifiers(Message<?> message) {
List<Object> channels = new ArrayList<Object>();
List<Recipient> recipientList = this.recipients;
for (Recipient recipient : recipientList) {