removed deprecated RemotingInboundGatewaySupport
This commit is contained in:
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
* 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.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.integration.gateway;
|
||||
|
||||
import org.springframework.integration.Message;
|
||||
|
||||
/**
|
||||
* Support class for inbound Messaging Gateways.
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*
|
||||
* @deprecated as of 2.0. Will be removed in 2.1.
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class RemotingInboundGatewaySupport extends MessagingGatewaySupport implements RequestReplyExchanger {
|
||||
|
||||
private volatile boolean expectReply = true;
|
||||
|
||||
|
||||
/**
|
||||
* Specify whether the gateway should be expected to return a reply.
|
||||
* The default is '<code>true</code>'.
|
||||
*/
|
||||
public void setExpectReply(boolean expectReply) {
|
||||
this.expectReply = expectReply;
|
||||
}
|
||||
|
||||
public Message<?> exchange(Message<?> message) {
|
||||
if (this.expectReply) {
|
||||
return this.sendAndReceiveMessage(message);
|
||||
}
|
||||
this.send(message);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2011 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.
|
||||
@@ -19,9 +19,10 @@ package org.springframework.integration.rmi;
|
||||
import java.rmi.registry.Registry;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.MessageChannel;
|
||||
import org.springframework.integration.context.NamedComponent;
|
||||
import org.springframework.integration.gateway.RemotingInboundGatewaySupport;
|
||||
import org.springframework.integration.gateway.MessagingGatewaySupport;
|
||||
import org.springframework.integration.gateway.RequestReplyExchanger;
|
||||
import org.springframework.remoting.rmi.RmiServiceExporter;
|
||||
import org.springframework.remoting.support.RemoteInvocationExecutor;
|
||||
@@ -33,8 +34,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Mark Fisher
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
public class RmiInboundGateway extends RemotingInboundGatewaySupport implements InitializingBean {
|
||||
public class RmiInboundGateway extends MessagingGatewaySupport implements RequestReplyExchanger, InitializingBean {
|
||||
|
||||
public static final String SERVICE_NAME_PREFIX = "org.springframework.integration.rmiGateway.";
|
||||
|
||||
@@ -45,6 +45,8 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements
|
||||
|
||||
private volatile int registryPort = Registry.REGISTRY_PORT;
|
||||
|
||||
private volatile boolean expectReply = true;
|
||||
|
||||
private volatile RemoteInvocationExecutor remoteInvocationExecutor;
|
||||
|
||||
private volatile RmiServiceExporter exporter;
|
||||
@@ -66,6 +68,13 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements
|
||||
super.setRequestChannel(requestChannel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify whether the gateway should be expected to return a reply.
|
||||
* The default is '<code>true</code>'.
|
||||
*/
|
||||
public void setExpectReply(boolean expectReply) {
|
||||
this.expectReply = expectReply;
|
||||
}
|
||||
|
||||
public void setRegistryHost(String registryHost) {
|
||||
this.registryHost = registryHost;
|
||||
@@ -105,4 +114,12 @@ public class RmiInboundGateway extends RemotingInboundGatewaySupport implements
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
public Message<?> exchange(Message<?> message) {
|
||||
if (this.expectReply) {
|
||||
return this.sendAndReceiveMessage(message);
|
||||
}
|
||||
this.send(message);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user