diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java
index 092f1dc020..923797ff2a 100644
--- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java
+++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiInboundGateway.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -25,7 +25,6 @@ import org.springframework.integration.support.context.NamedComponent;
import org.springframework.lang.Nullable;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
-import org.springframework.remoting.rmi.RmiServiceExporter;
import org.springframework.remoting.support.RemoteInvocationExecutor;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
@@ -36,14 +35,18 @@ import org.springframework.util.StringUtils;
* @author Mark Fisher
* @author Artem Bilan
* @author Gary Russell
+ *
+ * @deprecated since 5.4 with no replacement.
*/
+@Deprecated
public class RmiInboundGateway extends MessagingGatewaySupport
implements RequestReplyExchanger {
public static final String SERVICE_NAME_PREFIX = "org.springframework.integration.rmiGateway.";
- private final RmiServiceExporter exporter = new RmiServiceExporter();
+ private final org.springframework.remoting.rmi.RmiServiceExporter exporter =
+ new org.springframework.remoting.rmi.RmiServiceExporter();
private String requestChannelName;
diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiOutboundGateway.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiOutboundGateway.java
index 5776160498..c3f5adf434 100644
--- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiOutboundGateway.java
+++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/RmiOutboundGateway.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -23,7 +23,6 @@ import org.springframework.integration.handler.AbstractReplyProducingMessageHand
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.MessageHandlingException;
-import org.springframework.remoting.rmi.RmiProxyFactoryBean;
/**
* An outbound Messaging Gateway for RMI-based remoting.
@@ -31,7 +30,10 @@ import org.springframework.remoting.rmi.RmiProxyFactoryBean;
* @author Mark Fisher
* @author Gary Russell
* @author Artem Bilan
+ *
+ * @deprecated since 5.4 with no replacement.
*/
+@Deprecated
public class RmiOutboundGateway extends AbstractReplyProducingMessageHandler {
private final RequestReplyExchanger proxy;
@@ -40,7 +42,7 @@ public class RmiOutboundGateway extends AbstractReplyProducingMessageHandler {
/**
* Construct an instance with a `RequestReplyExchanger` built from the
- * default {@link RmiProxyFactoryBean}.
+ * default {@link org.springframework.remoting.rmi.RmiProxyFactoryBean}.
* @param url the url.
*/
public RmiOutboundGateway(String url) {
@@ -49,7 +51,7 @@ public class RmiOutboundGateway extends AbstractReplyProducingMessageHandler {
/**
* Construct an instance with a `RequestReplyExchanger` built from the
- * default {@link RmiProxyFactoryBean} which can be modified by the
+ * default {@link org.springframework.remoting.rmi.RmiProxyFactoryBean} which can be modified by the
* configurer.
* @param url the url.
* @param configurer the {@link RmiProxyFactoryBeanConfigurer}.
@@ -86,7 +88,8 @@ public class RmiOutboundGateway extends AbstractReplyProducingMessageHandler {
}
private RequestReplyExchanger createProxy(String url) {
- RmiProxyFactoryBean proxyFactory = new RmiProxyFactoryBean();
+ org.springframework.remoting.rmi.RmiProxyFactoryBean proxyFactory =
+ new org.springframework.remoting.rmi.RmiProxyFactoryBean();
proxyFactory.setServiceInterface(RequestReplyExchanger.class);
proxyFactory.setServiceUrl(url);
proxyFactory.setLookupStubOnStartup(false);
@@ -109,7 +112,7 @@ public class RmiOutboundGateway extends AbstractReplyProducingMessageHandler {
* {@code RequestReplyExchanger} is created.
* @param factoryBean the factory bean.
*/
- void configure(RmiProxyFactoryBean factoryBean);
+ void configure(org.springframework.remoting.rmi.RmiProxyFactoryBean factoryBean);
}
diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiInboundGatewayParser.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiInboundGatewayParser.java
index 652f236c1a..bedeb9fbc4 100644
--- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiInboundGatewayParser.java
+++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiInboundGatewayParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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,14 +21,16 @@ import org.w3c.dom.Element;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.integration.config.xml.AbstractInboundGatewayParser;
import org.springframework.integration.config.xml.IntegrationNamespaceUtils;
-import org.springframework.integration.rmi.RmiInboundGateway;
/**
* Parser for the <inbound-gateway/> element of the 'rmi' namespace.
*
* @author Mark Fisher
* @author Gary Russell
+ *
+ * @deprecated since 5.4 with no replacement.
*/
+@Deprecated
public class RmiInboundGatewayParser extends AbstractInboundGatewayParser {
private static final String REMOTE_INVOCATION_EXECUTOR_ATTRIBUTE = "remote-invocation-executor";
@@ -36,7 +38,7 @@ public class RmiInboundGatewayParser extends AbstractInboundGatewayParser {
@Override
protected String getBeanClassName(Element element) {
- return RmiInboundGateway.class.getName();
+ return org.springframework.integration.rmi.RmiInboundGateway.class.getName();
}
@Override
diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiNamespaceHandler.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiNamespaceHandler.java
index 1c88487c5f..123c254274 100644
--- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiNamespaceHandler.java
+++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiNamespaceHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -22,7 +22,10 @@ import org.springframework.integration.config.xml.AbstractIntegrationNamespaceHa
* Namespace handler for Spring Integration's rmi namespace.
*
* @author Mark Fisher
+ *
+ * @deprecated since 5.4 with no replacement.
*/
+@Deprecated
public class RmiNamespaceHandler extends AbstractIntegrationNamespaceHandler {
public void init() {
diff --git a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParser.java b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParser.java
index 7590a276af..ef035b06bf 100644
--- a/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParser.java
+++ b/spring-integration-rmi/src/main/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParser.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2019 the original author or authors.
+ * Copyright 2002-2020 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.
@@ -23,20 +23,21 @@ import org.w3c.dom.Element;
import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.ParserContext;
import org.springframework.integration.config.xml.AbstractOutboundGatewayParser;
-import org.springframework.integration.rmi.RmiInboundGateway;
-import org.springframework.integration.rmi.RmiOutboundGateway;
import org.springframework.util.StringUtils;
/**
* Parser for the <outbound-gateway/> element of the 'rmi' namespace.
*
* @author Mark Fisher
+ *
+ * @deprecated since 5.4 with no replacement.
*/
+@Deprecated
public class RmiOutboundGatewayParser extends AbstractOutboundGatewayParser {
@Override
protected String getGatewayClassName(Element element) {
- return RmiOutboundGateway.class.getName();
+ return org.springframework.integration.rmi.RmiOutboundGateway.class.getName();
}
@Override
@@ -49,7 +50,8 @@ public class RmiOutboundGatewayParser extends AbstractOutboundGatewayParser {
}
String portAttribute = element.getAttribute("port");
String port = StringUtils.hasText(portAttribute) ? portAttribute : "" + Registry.REGISTRY_PORT;
- return "rmi://" + host + ":" + port + "/" + RmiInboundGateway.SERVICE_NAME_PREFIX + remoteChannel;
+ return "rmi://" + host + ":" + port + "/"
+ + org.springframework.integration.rmi.RmiInboundGateway.SERVICE_NAME_PREFIX + remoteChannel;
}
@Override
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests-context.xml b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests-context.xml
deleted file mode 100644
index cf6b8bdcdc..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests-context.xml
+++ /dev/null
@@ -1,62 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests.java
deleted file mode 100644
index d89c456b61..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/BackToBackTests.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright 2013-2020 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
- *
- * https://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.rmi;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.verify;
-
-import org.junit.jupiter.api.Test;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.support.AbstractApplicationContext;
-import org.springframework.integration.MessageDispatchingException;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageDeliveryException;
-import org.springframework.messaging.MessageHandlingException;
-import org.springframework.messaging.PollableChannel;
-import org.springframework.messaging.SubscribableChannel;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.TransactionDefinition;
-
-/**
- * @author Gary Russell
- * @author Artem Bilan
- *
- * @since 3.0
- *
- */
-@SpringJUnitConfig
-@DirtiesContext
-public class BackToBackTests {
-
- @Autowired
- private SubscribableChannel good;
-
- @Autowired
- private SubscribableChannel bad;
-
- @Autowired
- private SubscribableChannel ugly;
-
- @Autowired
- private PollableChannel reply;
-
- @Autowired
- private AbstractApplicationContext context;
-
- @Autowired
- private PlatformTransactionManager transactionManager;
-
- @Test
- public void testGood() {
- good.send(new GenericMessage<>("foo"));
- Message> reply = this.reply.receive(0);
- assertThat(reply).isNotNull();
- assertThat(reply.getPayload()).isEqualTo("reply:foo");
-
- verify(this.transactionManager).getTransaction(any(TransactionDefinition.class));
- }
-
- @Test
- public void testBad() {
- bad.send(new GenericMessage<>("foo"));
- Message> reply = this.reply.receive(0);
- assertThat(reply).isNotNull();
- assertThat(reply.getPayload()).isEqualTo("error:foo");
- }
-
- @Test
- public void testUgly() {
- context.setId("context");
- assertThatExceptionOfType(MessageHandlingException.class)
- .isThrownBy(() -> ugly.send(new GenericMessage<>("foo")))
- .withCauseInstanceOf(MessageDeliveryException.class)
- .withRootCauseInstanceOf(MessageDispatchingException.class)
- .withMessageContaining("Dispatcher has no subscribers for channel 'context.baz'.");
- }
-
-}
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/RmiOutboundGatewayTests.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/RmiOutboundGatewayTests.java
deleted file mode 100644
index 607a24b66e..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/RmiOutboundGatewayTests.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Copyright 2002-2020 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
- *
- * https://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.rmi;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
-
-import java.rmi.RemoteException;
-
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.integration.channel.QueueChannel;
-import org.springframework.integration.gateway.RequestReplyExchanger;
-import org.springframework.integration.handler.AbstractReplyProducingMessageHandler;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageHandlingException;
-import org.springframework.messaging.MessagingException;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.remoting.RemoteLookupFailureException;
-import org.springframework.remoting.rmi.RmiServiceExporter;
-import org.springframework.util.SocketUtils;
-
-/**
- * @author Mark Fisher
- * @author Gary Russell
- * @author Artem Bilan
- */
-public class RmiOutboundGatewayTests {
-
- private static final QueueChannel OUTPUT = new QueueChannel(1);
-
- private static int RMI_PORT;
-
- private static RmiServiceExporter EXPORTER;
-
- private static RmiOutboundGateway GATEWAY;
-
- @BeforeAll
- static void setup() throws RemoteException {
- RMI_PORT = SocketUtils.findAvailableTcpPort();
-
- EXPORTER = new RmiServiceExporter();
- EXPORTER.setService(new TestExchanger());
- EXPORTER.setServiceInterface(RequestReplyExchanger.class);
- EXPORTER.setServiceName("testRemoteHandler");
- EXPORTER.setRegistryPort(RMI_PORT);
- EXPORTER.afterPropertiesSet();
-
- GATEWAY = new RmiOutboundGateway("rmi://localhost:" + RMI_PORT + "/testRemoteHandler");
- GATEWAY.setOutputChannel(OUTPUT);
- }
-
- @AfterAll
- static void tearDown() throws RemoteException {
- EXPORTER.destroy();
- }
-
- @Test
- void serializablePayload() {
- GATEWAY.handleMessage(new GenericMessage<>("test"));
- Message> replyMessage = OUTPUT.receive(0);
- assertThat(replyMessage).isNotNull();
- assertThat(replyMessage.getPayload()).isEqualTo("TEST");
- }
-
- @Test
- void failedMessage() {
- GenericMessage message = new GenericMessage<>("fail");
-
- assertThatExceptionOfType(MessagingException.class)
- .isThrownBy(() -> GATEWAY.handleMessage(message))
- .satisfies((ex) -> {
- assertThat(ex.getFailedMessage()).isSameAs(message);
- assertThat(((MessagingException) ex.getCause()).getFailedMessage().getPayload()).isEqualTo("bar");
- });
- }
-
- @Test
- void serializableAttribute() {
- Message requestMessage = MessageBuilder.withPayload("test")
- .setHeader("testAttribute", "foo").build();
- GATEWAY.handleMessage(requestMessage);
- Message> replyMessage = OUTPUT.receive(0);
- assertThat(replyMessage).isNotNull();
- assertThat(replyMessage.getHeaders().get("testAttribute")).isEqualTo("foo");
- }
-
- @Test
- void nonSerializablePayload() {
- NonSerializableTestObject payload = new NonSerializableTestObject();
- Message> requestMessage = new GenericMessage<>(payload);
- assertThatExceptionOfType(MessageHandlingException.class)
- .isThrownBy(() -> GATEWAY.handleMessage(requestMessage));
- }
-
- @Test
- void nonSerializableAttribute() {
- Message requestMessage = MessageBuilder.withPayload("test")
- .setHeader("testAttribute", new NonSerializableTestObject()).build();
- GATEWAY.handleMessage(requestMessage);
- Message> reply = OUTPUT.receive(0);
- assertThat(requestMessage.getHeaders().get("testAttribute")).isNotNull();
- assertThat(reply.getHeaders().get("testAttribute")).isNotNull();
- }
-
- @Test
- void invalidServiceName() {
- RmiOutboundGateway gateway = new RmiOutboundGateway("rmi://localhost:" + RMI_PORT + "/noSuchService");
- assertThatExceptionOfType(MessageHandlingException.class)
- .isThrownBy(() -> gateway.handleMessage(new GenericMessage<>("test")))
- .withCauseInstanceOf(RemoteLookupFailureException.class);
- }
-
- @Test
- void invalidHost() {
- RmiOutboundGateway gateway = new RmiOutboundGateway("rmi://noSuchHost:1099/testRemoteHandler");
- assertThatExceptionOfType(MessageHandlingException.class)
- .isThrownBy(() -> gateway.handleMessage(new GenericMessage<>("test")))
- .withCauseInstanceOf(RemoteLookupFailureException.class);
- }
-
- @Test
- void invalidUrl() {
- RmiOutboundGateway gateway = new RmiOutboundGateway("https://sample.com/");
- assertThatExceptionOfType(MessageHandlingException.class)
- .isThrownBy(() -> gateway.handleMessage(new GenericMessage<>("test")))
- .withCauseInstanceOf(RemoteLookupFailureException.class);
- }
-
-
- private static class TestExchanger implements RequestReplyExchanger {
-
- TestExchanger() {
- super();
- }
-
- @Override
- public Message> exchange(Message> message) {
- if (message.getPayload().equals("fail")) {
- new AbstractReplyProducingMessageHandler() {
-
- @Override
- protected Object handleRequestMessage(Message> requestMessage) {
- throw new RuntimeException("foo");
- }
-
- }.handleMessage(new GenericMessage<>("bar"));
- }
- return new GenericMessage<>(message.getPayload().toString().toUpperCase(), message.getHeaders());
- }
-
- }
-
-
- private static class NonSerializableTestObject {
-
- NonSerializableTestObject() {
- super();
- }
-
- }
-
-}
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests-context.xml b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests-context.xml
deleted file mode 100644
index db42c782a9..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests-context.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests.java
deleted file mode 100644
index b67a55982a..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/DefaultConfigurationTests.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright 2002-2020 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
- *
- * https://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.rmi.config;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.junit.jupiter.api.Test;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.ApplicationContext;
-import org.springframework.integration.channel.MessagePublishingErrorHandler;
-import org.springframework.integration.channel.NullChannel;
-import org.springframework.integration.channel.PublishSubscribeChannel;
-import org.springframework.integration.context.IntegrationContextUtils;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-import org.springframework.util.ErrorHandler;
-
-/**
- * @author Mark Fisher
- * @author Artem Bilan
- * @author Gary Russell
- *
- * @since 1.0.3
- */
-@SpringJUnitConfig
-@DirtiesContext
-public class DefaultConfigurationTests {
-
- @Autowired
- private ApplicationContext context;
-
-
- @Test
- public void verifyErrorChannel() {
- Object errorChannel = context.getBean("errorChannel");
- assertThat(errorChannel).isNotNull();
- assertThat(errorChannel.getClass()).isEqualTo(PublishSubscribeChannel.class);
- }
-
- @Test
- public void verifyNullChannel() {
- Object nullChannel = context.getBean("nullChannel");
- assertThat(nullChannel).isNotNull();
- assertThat(nullChannel.getClass()).isEqualTo(NullChannel.class);
- }
-
- @Test
- public void verifyTaskScheduler() {
- Object taskScheduler = context.getBean(IntegrationContextUtils.TASK_SCHEDULER_BEAN_NAME);
- assertThat(taskScheduler.getClass()).isEqualTo(ThreadPoolTaskScheduler.class);
- ErrorHandler errorHandler = TestUtils.getPropertyValue(taskScheduler, "errorHandler", ErrorHandler.class);
- assertThat(errorHandler.getClass()).isEqualTo(MessagePublishingErrorHandler.class);
- MessageChannel defaultErrorChannel = TestUtils.getPropertyValue(errorHandler,
- "messagingTemplate.defaultDestination", MessageChannel.class);
- assertThat(defaultErrorChannel).isNull();
- errorHandler.handleError(new Throwable());
- defaultErrorChannel = TestUtils.getPropertyValue(errorHandler, "messagingTemplate.defaultDestination",
- MessageChannel.class);
- assertThat(defaultErrorChannel).isNotNull();
- assertThat(defaultErrorChannel).isEqualTo(context.getBean(IntegrationContextUtils.ERROR_CHANNEL_BEAN_NAME));
- }
-
-}
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests-context.xml b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests-context.xml
deleted file mode 100644
index 1b482a9327..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests-context.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests.java
deleted file mode 100644
index 3d7167df38..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiInboundGatewayParserTests.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2002-2020 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
- *
- * https://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.rmi.config;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-import org.junit.jupiter.api.Test;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.context.ApplicationContext;
-import org.springframework.integration.rmi.RmiInboundGateway;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-import org.springframework.util.SocketUtils;
-
-/**
- * @author Mark Fisher
- * @author Gary Russell
- * @author Artem Bilan
- */
-@SpringJUnitConfig
-@DirtiesContext
-public class RmiInboundGatewayParserTests {
-
- public static final int PORT = SocketUtils.findAvailableTcpPort();
-
- @Autowired
- @Qualifier("testChannel")
- private MessageChannel channel;
-
- @Autowired
- private ApplicationContext context;
-
- @Test
- public void gatewayWithDefaultsAndHistory() {
- RmiInboundGateway gateway = (RmiInboundGateway) this.context.getBean("gatewayWithDefaults");
-
- assertThat(gateway.getComponentName()).isEqualTo("gatewayWithDefaults");
- assertThat(gateway.getComponentType()).isEqualTo("rmi:inbound-gateway");
- assertThat(TestUtils.getPropertyValue(gateway, "expectReply", Boolean.class)).isTrue();
- assertThat(gateway.getRequestChannel()).isSameAs(this.channel);
- assertThat(TestUtils.getPropertyValue(gateway, "messagingTemplate.sendTimeout")).isEqualTo(1000L);
- assertThat(TestUtils.getPropertyValue(gateway, "messagingTemplate.receiveTimeout")).isEqualTo(1000L);
- }
-
- @Test
- public void gatewayWithCustomProperties() {
- RmiInboundGateway gateway = (RmiInboundGateway) context.getBean("gatewayWithCustomProperties");
-
- assertThat(TestUtils.getPropertyValue(gateway, "expectReply", Boolean.class)).isFalse();
- assertThat(gateway.getRequestChannel()).isSameAs(this.channel);
- assertThat(TestUtils.getPropertyValue(gateway, "messagingTemplate.sendTimeout")).isEqualTo(123L);
- assertThat(TestUtils.getPropertyValue(gateway, "messagingTemplate.receiveTimeout")).isEqualTo(456L);
- }
-
- @Test
- public void gatewayWithHost() {
- RmiInboundGateway gateway = (RmiInboundGateway) context.getBean("gatewayWithHostAndErrorChannel");
- assertThat(TestUtils.getPropertyValue(gateway, "registryHost")).isEqualTo("localhost");
- assertThat(gateway.getErrorChannel()).isSameAs(context.getBean("testErrorChannel"));
- }
-
- @Test
- public void gatewayWithPort() {
- RmiInboundGateway gateway = (RmiInboundGateway) context.getBean("gatewayWithPort");
- assertThat(TestUtils.getPropertyValue(gateway, "registryPort")).isEqualTo(PORT);
- }
-
- @Test
- public void gatewayWithRemoteInvocationExecutorReference() {
- RmiInboundGateway gateway = (RmiInboundGateway) context.getBean("gatewayWithExecutorRef");
- Object remoteInvocationExecutor = TestUtils.getPropertyValue(gateway, "remoteInvocationExecutor");
- assertThat(remoteInvocationExecutor).isNotNull();
- assertThat(remoteInvocationExecutor).isInstanceOf(StubRemoteInvocationExecutor.class);
- }
-
-}
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests-context.xml b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests-context.xml
deleted file mode 100644
index 13b991d7fa..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests-context.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests.java
deleted file mode 100644
index dd97a68d10..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/RmiOutboundGatewayParserTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2002-2020 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
- *
- * https://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.rmi.config;
-
-import static org.assertj.core.api.Assertions.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-
-import org.junit.jupiter.api.AfterAll;
-import org.junit.jupiter.api.BeforeAll;
-import org.junit.jupiter.api.Test;
-
-import org.springframework.beans.factory.BeanFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.integration.channel.QueueChannel;
-import org.springframework.integration.handler.advice.AbstractRequestHandlerAdvice;
-import org.springframework.integration.rmi.RmiInboundGateway;
-import org.springframework.integration.rmi.RmiOutboundGateway;
-import org.springframework.integration.support.MessageBuilder;
-import org.springframework.integration.test.util.TestUtils;
-import org.springframework.messaging.Message;
-import org.springframework.messaging.MessageChannel;
-import org.springframework.messaging.PollableChannel;
-import org.springframework.messaging.support.GenericMessage;
-import org.springframework.remoting.rmi.RmiProxyFactoryBean;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
-import org.springframework.util.SocketUtils;
-
-/**
- * @author Mark Fisher
- * @author Gary Russell
- * @author Artem Bilan
- */
-@SpringJUnitConfig
-@DirtiesContext
-public class RmiOutboundGatewayParserTests {
-
- public static final int port = SocketUtils.findAvailableTcpPort();
-
- private static final QueueChannel testChannel = new QueueChannel();
-
- private static final RmiInboundGateway rmiInboundGateway = new RmiInboundGateway();
-
- @Autowired
- public FooAdvice advice;
-
- @Autowired
- private MessageChannel advisedChannel;
-
- @Autowired
- private MessageChannel rmiOutboundGatewayInsideChain;
-
- @Autowired
- private MessageChannel requestReplyRmiWithChainChannel;
-
- @Autowired
- private PollableChannel replyChannel;
-
- @Autowired
- private RmiOutboundGateway.RmiProxyFactoryBeanConfigurer configurer;
-
- @Autowired
- @Qualifier("gateway.handler")
- RmiOutboundGateway gateway;
-
- @Autowired
- @Qualifier("advised.handler")
- RmiOutboundGateway advised;
-
- @BeforeAll
- public static void setupTestInboundGateway() {
- testChannel.setBeanName("testChannel");
- rmiInboundGateway.setRequestChannel(testChannel);
- rmiInboundGateway.setRegistryPort(port);
- rmiInboundGateway.setExpectReply(false);
- rmiInboundGateway.setBeanFactory(mock(BeanFactory.class));
- rmiInboundGateway.afterPropertiesSet();
- }
-
- @AfterAll
- public static void destroyInboundGateway() {
- rmiInboundGateway.destroy();
- }
-
- @Test
- public void testProperties() {
- assertThat(TestUtils.getPropertyValue(gateway, "order")).isEqualTo(23);
- assertThat(TestUtils.getPropertyValue(gateway, "requiresReply", Boolean.class)).isTrue();
- assertThat(TestUtils.getPropertyValue(this.gateway, "configurer")).isSameAs(this.configurer);
- verify(this.configurer).configure(any(RmiProxyFactoryBean.class));
- }
-
- @Test
- public void directInvocation() {
- assertThat(TestUtils.getPropertyValue(advised, "requiresReply", Boolean.class)).isFalse();
-
- advisedChannel.send(new GenericMessage<>("test"));
- Message> result = testChannel.receive(1000);
- assertThat(result).isNotNull();
- assertThat(result.getPayload()).isEqualTo("test");
- assertThat(advice.adviceCalled).isEqualTo(1);
- }
-
- @Test //INT-1029
- public void testRmiOutboundGatewayInsideChain() {
- rmiOutboundGatewayInsideChain.send(MessageBuilder.withPayload("test").build());
- Message> result = testChannel.receive(1000);
- assertThat(result).isNotNull();
- assertThat(result.getPayload()).isEqualTo("test");
- }
-
- @Test //INT-1029
- public void testRmiRequestReplyWithinChain() {
- requestReplyRmiWithChainChannel.send(MessageBuilder.withPayload("test").build());
- Message> result = replyChannel.receive(1000);
- assertThat(result).isNotNull();
- assertThat(result.getPayload()).isEqualTo("TEST");
- }
-
- public static class FooAdvice extends AbstractRequestHandlerAdvice {
-
- int adviceCalled;
-
- @Override
- protected Object doInvoke(ExecutionCallback callback, Object target, Message> message) {
- adviceCalled++;
- return callback.execute();
- }
-
- }
-
-}
diff --git a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/StubRemoteInvocationExecutor.java b/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/StubRemoteInvocationExecutor.java
deleted file mode 100644
index f9f8283494..0000000000
--- a/spring-integration-rmi/src/test/java/org/springframework/integration/rmi/config/StubRemoteInvocationExecutor.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Copyright 2002-2019 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
- *
- * https://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.rmi.config;
-
-import org.springframework.remoting.support.DefaultRemoteInvocationExecutor;
-
-/**
- * @author Mark Fisher
- */
-public class StubRemoteInvocationExecutor extends DefaultRemoteInvocationExecutor {
-
-}
diff --git a/spring-integration-rmi/src/test/resources/log4j2-test.xml b/spring-integration-rmi/src/test/resources/log4j2-test.xml
deleted file mode 100644
index 842e2da235..0000000000
--- a/spring-integration-rmi/src/test/resources/log4j2-test.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/reference/asciidoc/rmi.adoc b/src/reference/asciidoc/rmi.adoc
index 6a0f3541e4..fbb91521ca 100644
--- a/src/reference/asciidoc/rmi.adoc
+++ b/src/reference/asciidoc/rmi.adoc
@@ -1,6 +1,7 @@
[[rmi]]
== RMI Support
+IMPORTANT: this module is deprecated since 5.4 with no replacement and will be removed in 6.0.
This chapter explains how to use channel adapters that are specific to RMI (Remote Method Invocation) to distribute a system over multiple JVMs.
The first section deals with sending messages over RMI.
diff --git a/src/reference/asciidoc/whats-new.adoc b/src/reference/asciidoc/whats-new.adoc
index 5f8ab71f28..8549fc423e 100644
--- a/src/reference/asciidoc/whats-new.adoc
+++ b/src/reference/asciidoc/whats-new.adoc
@@ -38,13 +38,6 @@ See <<./redis.adoc#redis-stream-outbound,Redis Stream Outbound Channel Adapter>>
A Renewable lock registry has been introduced to allow renew lease of a distributed lock.
See <<./jdbc.adoc#jdbc-lock-registry,JDBC implementation>> for more information.
-==== TCP Changes
-
-Connection factories now support multiple sending components (`TcpSender`); they remain limited to one receiving component (`TcpListener`).
-This allows, for example, an inbound gateway and outbound channel adapter to share the same factory, supporting both request/reply and arbitrary messaging from the server to the client.
-Shared factories should not be used with outbound gateways, unless single-use connections or the `ThreadAffinityClientConnectionFactory` are being used.
-See <<./ip.adoc#ip-collaborating-adapters,Collaborating Channel Adapters>> and <<./ip.adoc#tcp-gateways, TCP Gateways>> for more information.
-
[[x5.4-general]]
=== General Changes
@@ -53,3 +46,17 @@ See <<./gateway.adoc#gateway-default-reply-channel,Setting the Default Reply Cha
The aggregator (and resequencer) can now expire orphaned groups (groups in a persistent store where no new messages arrive after an application restart).
See <<./aggregator.adoc#aggregator-expiring-groups, Aggregator Expiring Groups>> for more information.
+
+[[x5.4-tcp]]
+=== TCP Changes
+
+Connection factories now support multiple sending components (`TcpSender`); they remain limited to one receiving component (`TcpListener`).
+This allows, for example, an inbound gateway and outbound channel adapter to share the same factory, supporting both request/reply and arbitrary messaging from the server to the client.
+Shared factories should not be used with outbound gateways, unless single-use connections or the `ThreadAffinityClientConnectionFactory` are being used.
+See <<./ip.adoc#ip-collaborating-adapters,Collaborating Channel Adapters>> and <<./ip.adoc#tcp-gateways, TCP Gateways>> for more information.
+
+[[x5.4-rmi]]
+=== RMI Changes
+
+The `spring-integration-rmi` module is deprecated with no replacement and is going to be removed in the next major version.
+See <<./rmi.adoc#rmi, RMI Support>> for more information.