From da7b3b5260472c82249e1bf6bb08225156b54f0a Mon Sep 17 00:00:00 2001 From: Mark Fisher Date: Sun, 25 Apr 2010 23:46:41 +0000 Subject: [PATCH] INT-1094 RmiInboundGateway now calling getName() against AbstractMessageChannel rather than the interface method. --- .../springframework/integration/rmi/RmiInboundGateway.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.springframework.integration.rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java b/org.springframework.integration.rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java index 599e978d06..b275b237f1 100644 --- a/org.springframework.integration.rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java +++ b/org.springframework.integration.rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java @@ -21,6 +21,7 @@ import java.rmi.registry.Registry; import org.springframework.beans.factory.InitializingBean; import org.springframework.integration.adapter.RemoteMessageHandler; import org.springframework.integration.adapter.RemotingInboundGatewaySupport; +import org.springframework.integration.channel.AbstractMessageChannel; import org.springframework.integration.core.MessageChannel; import org.springframework.remoting.rmi.RmiServiceExporter; import org.springframework.remoting.support.RemoteInvocationExecutor; @@ -57,8 +58,10 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements @Override public void setRequestChannel(MessageChannel requestChannel) { Assert.notNull(requestChannel, "requestChannel must not be null"); - Assert.isTrue(StringUtils.hasText(requestChannel.getName()), "RmiGateway's request channel must have a name."); - this.requestChannelName = requestChannel.getName(); + Assert.isTrue(requestChannel instanceof AbstractMessageChannel && + StringUtils.hasText(((AbstractMessageChannel) requestChannel).getName()), + "RmiGateway's request channel must have a name."); + this.requestChannelName = ((AbstractMessageChannel) requestChannel).getName(); super.setRequestChannel(requestChannel); }