polishing

This commit is contained in:
Mark Fisher
2010-11-10 13:54:28 -05:00
parent 12b9fb5d91
commit ffe193459b

View File

@@ -92,14 +92,6 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
this.suffix = suffix;
}
/**
* Specify whether this router should ignore any failure to resolve a channel name to
* an actual MessageChannel instance when delegating to the ChannelResolver strategy.
*/
public void setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures) {
this.ignoreChannelNameResolutionFailures = ignoreChannelNameResolutionFailures;
}
/**
* Allows you to set the map which will map channel identifiers to channel names.
* Channel names will be resolve via {@link ChannelResolver}
@@ -148,6 +140,14 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
this.resolutionRequired = resolutionRequired;
}
/**
* Specify whether this router should ignore any failure to resolve a channel name to
* an actual MessageChannel instance when delegating to the ChannelResolver strategy.
*/
public void setIgnoreChannelNameResolutionFailures(boolean ignoreChannelNameResolutionFailures) {
this.ignoreChannelNameResolutionFailures = ignoreChannelNameResolutionFailures;
}
/**
* Specify whether send failures for one or more of the recipients should be ignored. By default this is
* <code>false</code> meaning that an Exception will be thrown whenever a send fails. To override this and suppress
@@ -245,6 +245,9 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
}
private MessageChannel resolveChannelForName(String channelName, Message<?> message) {
if (this.channelResolver == null) {
this.onInit();
}
Assert.state(this.channelResolver != null,
"unable to resolve channel names, no ChannelResolver available");
MessageChannel channel = null;
@@ -284,14 +287,9 @@ public abstract class AbstractMessageRouter extends AbstractMessageHandler {
if (this.suffix != null) {
channelName = channelName + suffix;
}
if (this.channelResolver == null) {
this.onInit();
}
if (this.channelResolver != null) {
MessageChannel channel = resolveChannelForName(channelName, message);
if (channel != null) {
channels.add(channel);
}
MessageChannel channel = resolveChannelForName(channelName, message);
if (channel != null) {
channels.add(channel);
}
}