Skip to content

Commit

Permalink
Revert "GH-3509 Register TcpSenders on wrapped connection"
Browse files Browse the repository at this point in the history
This reverts commit 1e67a94.

See #3514 for more info
  • Loading branch information
artembilan committed Mar 17, 2021
1 parent 1e67a94 commit 3d6015b
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 98 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* 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.
Expand All @@ -22,8 +22,6 @@

/**
* @author Gary Russell
* @author Artem Bilan
*
* @since 2.0
*
*/
Expand All @@ -33,17 +31,11 @@ public class TcpConnectionInterceptorFactoryChain {

@Nullable
public TcpConnectionInterceptorFactory[] getInterceptorFactories() {
return this.interceptorFactories != null
? Arrays.copyOf(this.interceptorFactories, this.interceptorFactories.length)
: null;
return this.interceptorFactories; //NOSONAR
}

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

public void setInterceptor(TcpConnectionInterceptorFactory... interceptorFactories) {
setInterceptors(interceptorFactories);
}

}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2021 the original author or authors.
* 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.
Expand All @@ -16,8 +16,6 @@

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

import java.util.List;

import javax.net.ssl.SSLSession;

import org.springframework.context.ApplicationEventPublisher;
Expand All @@ -31,7 +29,6 @@
* to the underlying {@link TcpConnection}.
*
* @author Gary Russell
* @author Mário Dias
*
* @since 2.0
*/
Expand Down Expand Up @@ -99,11 +96,6 @@ public void registerSender(TcpSender sender) {
this.theConnection.registerSender(this);
}

@Override
public void registerSenders(List<TcpSender> sendersToRegister) {
this.theConnection.registerSenders(sendersToRegister);
}

@Override
public String getConnectionId() {
return this.theConnection.getConnectionId();
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2021 the original author or authors.
* Copyright 2013-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.
Expand All @@ -16,34 +16,40 @@

package org.springframework.integration.ip.tcp;

import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.integration.ip.tcp.connection.AbstractConnectionFactory;
import org.springframework.integration.ip.tcp.connection.HelloWorldInterceptorFactory;

/**
* @author Gary Russell
* @author Mário Dias
* @author Artem Bilan
*
* @since 3.0
*
*/
public class AbstractTcpChannelAdapterTests {

private static final ApplicationEventPublisher NOOP_PUBLISHER = event -> { };
private static final ApplicationEventPublisher NOOP_PUBLISHER = new ApplicationEventPublisher() {

protected HelloWorldInterceptorFactory newInterceptorFactory() {
return newInterceptorFactory(NOOP_PUBLISHER);
}
@Override
public void publishEvent(ApplicationEvent event) {
}

@Override
public void publishEvent(Object event) {

protected HelloWorldInterceptorFactory newInterceptorFactory(ApplicationEventPublisher applicationEventPublisher) {
}

};

protected HelloWorldInterceptorFactory newInterceptorFactory() {
HelloWorldInterceptorFactory factory = new HelloWorldInterceptorFactory();
factory.setApplicationEventPublisher(applicationEventPublisher);
factory.setApplicationEventPublisher(NOOP_PUBLISHER);
return factory;
}

protected void noopPublisher(AbstractConnectionFactory connectionFactory) {
connectionFactory.setApplicationEventPublisher(NOOP_PUBLISHER);
}


}

0 comments on commit 3d6015b

Please sign in to comment.