From ffe193459b9294b2cb6a46afd71920616c1f2615 Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Wed, 10 Nov 2010 13:54:28 -0500 Subject: [PATCH] polishing --- .../router/AbstractMessageRouter.java | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java index bf084f1749..1a2c42e7d4 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/router/AbstractMessageRouter.java @@ -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 * false 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); } }