Renamed the MessageHandler interface for remote proxies to RemoteMessageHandler.
This commit is contained in:
@@ -20,7 +20,7 @@ import java.rmi.RemoteException;
|
||||
import java.rmi.registry.Registry;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.integration.adapter.MessageHandler;
|
||||
import org.springframework.integration.adapter.RemoteMessageHandler;
|
||||
import org.springframework.integration.adapter.RemotingInboundGatewaySupport;
|
||||
import org.springframework.integration.core.MessageChannel;
|
||||
import org.springframework.remoting.rmi.RmiServiceExporter;
|
||||
@@ -82,7 +82,7 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements
|
||||
exporter.setRemoteInvocationExecutor(this.remoteInvocationExecutor);
|
||||
}
|
||||
exporter.setService(this);
|
||||
exporter.setServiceInterface(MessageHandler.class);
|
||||
exporter.setServiceInterface(RemoteMessageHandler.class);
|
||||
exporter.setServiceName(SERVICE_NAME_PREFIX + this.requestChannelName);
|
||||
exporter.afterPropertiesSet();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.rmi;
|
||||
|
||||
import org.springframework.integration.adapter.AbstractRemotingOutboundGateway;
|
||||
import org.springframework.integration.adapter.MessageHandler;
|
||||
import org.springframework.integration.adapter.RemoteMessageHandler;
|
||||
import org.springframework.remoting.rmi.RmiProxyFactoryBean;
|
||||
|
||||
/**
|
||||
@@ -33,14 +33,14 @@ public class RmiOutboundGateway extends AbstractRemotingOutboundGateway {
|
||||
|
||||
|
||||
@Override
|
||||
public MessageHandler createHandlerProxy(String url) {
|
||||
public RemoteMessageHandler createHandlerProxy(String url) {
|
||||
RmiProxyFactoryBean proxyFactory = new RmiProxyFactoryBean();
|
||||
proxyFactory.setServiceInterface(MessageHandler.class);
|
||||
proxyFactory.setServiceInterface(RemoteMessageHandler.class);
|
||||
proxyFactory.setServiceUrl(url);
|
||||
proxyFactory.setLookupStubOnStartup(false);
|
||||
proxyFactory.setRefreshStubOnConnectFailure(true);
|
||||
proxyFactory.afterPropertiesSet();
|
||||
return (MessageHandler) proxyFactory.getObject();
|
||||
return (RemoteMessageHandler) proxyFactory.getObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.rmi.RemoteException;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.integration.adapter.MessageHandler;
|
||||
import org.springframework.integration.adapter.RemoteMessageHandler;
|
||||
import org.springframework.integration.channel.QueueChannel;
|
||||
import org.springframework.integration.core.Message;
|
||||
import org.springframework.integration.message.GenericMessage;
|
||||
@@ -55,7 +55,7 @@ public class RmiOutboundGatewayTests {
|
||||
public void createExporter() throws RemoteException {
|
||||
RmiServiceExporter exporter = new RmiServiceExporter();
|
||||
exporter.setService(new TestHandler());
|
||||
exporter.setServiceInterface(MessageHandler.class);
|
||||
exporter.setServiceInterface(RemoteMessageHandler.class);
|
||||
exporter.setServiceName("testRemoteHandler");
|
||||
exporter.afterPropertiesSet();
|
||||
}
|
||||
@@ -139,7 +139,7 @@ public class RmiOutboundGatewayTests {
|
||||
}
|
||||
|
||||
|
||||
private static class TestHandler implements MessageHandler {
|
||||
private static class TestHandler implements RemoteMessageHandler {
|
||||
|
||||
public Message<?> handle(Message<?> message) {
|
||||
return new GenericMessage<String>(message.getPayload().toString().toUpperCase(), message.getHeaders());
|
||||
|
||||
Reference in New Issue
Block a user