Skip to content

Commit 321f036

Browse files
committed
Revert "GH-3509 Register TcpSenders on wrapped connection"
This reverts commit 78a0ae8.
1 parent 6eb0ff1 commit 321f036

File tree

4 files changed

+61
-98
lines changed

4 files changed

+61
-98
lines changed

spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorFactoryChain.java

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -22,8 +22,6 @@
2222

2323
/**
2424
* @author Gary Russell
25-
* @author Artem Bilan
26-
*
2725
* @since 2.0
2826
*
2927
*/
@@ -33,17 +31,11 @@ public class TcpConnectionInterceptorFactoryChain {
3331

3432
@Nullable
3533
public TcpConnectionInterceptorFactory[] getInterceptorFactories() {
36-
return this.interceptorFactories != null
37-
? Arrays.copyOf(this.interceptorFactories, this.interceptorFactories.length)
38-
: null;
34+
return this.interceptorFactories; //NOSONAR
3935
}
4036

4137
public void setInterceptors(TcpConnectionInterceptorFactory[] interceptorFactories) {
4238
this.interceptorFactories = Arrays.copyOf(interceptorFactories, interceptorFactories.length);
4339
}
4440

45-
public void setInterceptor(TcpConnectionInterceptorFactory... interceptorFactories) {
46-
setInterceptors(interceptorFactories);
47-
}
48-
4941
}

spring-integration-ip/src/main/java/org/springframework/integration/ip/tcp/connection/TcpConnectionInterceptorSupport.java

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,6 @@
1616

1717
package org.springframework.integration.ip.tcp.connection;
1818

19-
import java.util.List;
20-
2119
import javax.net.ssl.SSLSession;
2220

2321
import org.springframework.context.ApplicationEventPublisher;
@@ -31,7 +29,6 @@
3129
* to the underlying {@link TcpConnection}.
3230
*
3331
* @author Gary Russell
34-
* @author Mário Dias
3532
*
3633
* @since 2.0
3734
*/
@@ -99,11 +96,6 @@ public void registerSender(TcpSender sender) {
9996
this.theConnection.registerSender(this);
10097
}
10198

102-
@Override
103-
public void registerSenders(List<TcpSender> sendersToRegister) {
104-
this.theConnection.registerSenders(sendersToRegister);
105-
}
106-
10799
@Override
108100
public String getConnectionId() {
109101
return this.theConnection.getConnectionId();
Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2021 the original author or authors.
2+
* Copyright 2013-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,34 +16,40 @@
1616

1717
package org.springframework.integration.ip.tcp;
1818

19+
import org.springframework.context.ApplicationEvent;
1920
import org.springframework.context.ApplicationEventPublisher;
2021
import org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory;
2122
import org.springframework.integration.ip.tcp.connection.HelloWorldInterceptorFactory;
2223

2324
/**
2425
* @author Gary Russell
25-
* @author Mário Dias
26-
* @author Artem Bilan
27-
*
2826
* @since 3.0
2927
*
3028
*/
3129
public class AbstractTcpChannelAdapterTests {
3230

33-
private static final ApplicationEventPublisher NOOP_PUBLISHER = event -> { };
31+
private static final ApplicationEventPublisher NOOP_PUBLISHER = new ApplicationEventPublisher() {
3432

35-
protected HelloWorldInterceptorFactory newInterceptorFactory() {
36-
return newInterceptorFactory(NOOP_PUBLISHER);
37-
}
33+
@Override
34+
public void publishEvent(ApplicationEvent event) {
35+
}
36+
37+
@Override
38+
public void publishEvent(Object event) {
3839

39-
protected HelloWorldInterceptorFactory newInterceptorFactory(ApplicationEventPublisher applicationEventPublisher) {
40+
}
41+
42+
};
43+
44+
protected HelloWorldInterceptorFactory newInterceptorFactory() {
4045
HelloWorldInterceptorFactory factory = new HelloWorldInterceptorFactory();
41-
factory.setApplicationEventPublisher(applicationEventPublisher);
46+
factory.setApplicationEventPublisher(NOOP_PUBLISHER);
4247
return factory;
4348
}
4449

4550
protected void noopPublisher(AbstractConnectionFactory connectionFactory) {
4651
connectionFactory.setApplicationEventPublisher(NOOP_PUBLISHER);
4752
}
4853

54+
4955
}

0 commit comments

Comments
 (0)