added NamedComponent interface, continuing simplification of MessageHistory

This commit is contained in:
Mark Fisher
2010-04-30 20:11:18 +00:00
parent 6ef9eece71
commit 43dd81ff45
20 changed files with 131 additions and 76 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 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.
@@ -21,7 +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.context.NamedComponent;
import org.springframework.integration.core.MessageChannel;
import org.springframework.remoting.rmi.RmiServiceExporter;
import org.springframework.remoting.support.RemoteInvocationExecutor;
@@ -58,10 +58,10 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements
@Override
public void setRequestChannel(MessageChannel requestChannel) {
Assert.notNull(requestChannel, "requestChannel must not be null");
Assert.isTrue(requestChannel instanceof AbstractMessageChannel &&
StringUtils.hasText(((AbstractMessageChannel) requestChannel).getName()),
Assert.isTrue(requestChannel instanceof NamedComponent &&
StringUtils.hasText(((NamedComponent) requestChannel).getComponentName()),
"RmiGateway's request channel must have a name.");
this.requestChannelName = ((AbstractMessageChannel) requestChannel).getName();
this.requestChannelName = ((NamedComponent) requestChannel).getComponentName();
super.setRequestChannel(requestChannel);
}