Renamed the MessageHandler interface for remote proxies to RemoteMessageHandler.
This commit is contained in:
@@ -33,7 +33,7 @@ import org.springframework.remoting.RemoteAccessException;
|
||||
*/
|
||||
public abstract class AbstractRemotingOutboundGateway extends AbstractReplyProducingMessageHandler {
|
||||
|
||||
private final MessageHandler handlerProxy;
|
||||
private final RemoteMessageHandler handlerProxy;
|
||||
|
||||
|
||||
public AbstractRemotingOutboundGateway(String url) {
|
||||
@@ -48,7 +48,7 @@ public abstract class AbstractRemotingOutboundGateway extends AbstractReplyProdu
|
||||
/**
|
||||
* Subclasses must implement this method. It will be invoked from the constructor.
|
||||
*/
|
||||
protected abstract MessageHandler createHandlerProxy(String url);
|
||||
protected abstract RemoteMessageHandler createHandlerProxy(String url);
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.integration.core.Message;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public interface MessageHandler {
|
||||
public interface RemoteMessageHandler {
|
||||
|
||||
Message<?> handle(Message<?> message);
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.springframework.integration.gateway.SimpleMessagingGateway;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
public abstract class RemotingInboundGatewaySupport extends SimpleMessagingGateway implements MessageHandler {
|
||||
public abstract class RemotingInboundGatewaySupport extends SimpleMessagingGateway implements RemoteMessageHandler {
|
||||
|
||||
private volatile boolean expectReply = true;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
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.MessagingException;
|
||||
import org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter;
|
||||
@@ -67,7 +67,7 @@ public class HttpInvokerInboundGateway extends RemotingInboundGatewaySupport imp
|
||||
public void afterPropertiesSet() {
|
||||
HttpInvokerServiceExporter exporter = new HttpInvokerServiceExporter();
|
||||
exporter.setService(this);
|
||||
exporter.setServiceInterface(MessageHandler.class);
|
||||
exporter.setServiceInterface(RemoteMessageHandler.class);
|
||||
exporter.afterPropertiesSet();
|
||||
this.exporter = exporter;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
package org.springframework.integration.httpinvoker;
|
||||
|
||||
import org.springframework.integration.adapter.AbstractRemotingOutboundGateway;
|
||||
import org.springframework.integration.adapter.MessageHandler;
|
||||
import org.springframework.integration.adapter.RemoteMessageHandler;
|
||||
import org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean;
|
||||
|
||||
/**
|
||||
@@ -33,12 +33,12 @@ public class HttpInvokerOutboundGateway extends AbstractRemotingOutboundGateway
|
||||
|
||||
|
||||
@Override
|
||||
protected MessageHandler createHandlerProxy(String url) {
|
||||
protected RemoteMessageHandler createHandlerProxy(String url) {
|
||||
HttpInvokerProxyFactoryBean proxyFactory = new HttpInvokerProxyFactoryBean();
|
||||
proxyFactory.setServiceInterface(MessageHandler.class);
|
||||
proxyFactory.setServiceInterface(RemoteMessageHandler.class);
|
||||
proxyFactory.setServiceUrl(url);
|
||||
proxyFactory.afterPropertiesSet();
|
||||
return (MessageHandler) proxyFactory.getObject();
|
||||
return (RemoteMessageHandler) proxyFactory.getObject();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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