spring-integration icon indicating copy to clipboard operation
spring-integration copied to clipboard

Refactor NIO specific code out of AbstractConnectionFactory [INT-2520]

Open spring-operator opened this issue 13 years ago • 1 comments

Dondi Imperial opened INT-2520 and commented

o.s.i.ip.tcp.connection.AbstractConnectionFactory contains code that is specific to NIO sub-classes (possibly also to Socket sub-classes). This makes methods like processNioSelections available to all subclasses even when they are not relevant there.


Affects: 2.1.1

spring-operator avatar Apr 17 '12 22:04 spring-operator

Gary Russell commented

I'll have to think about this - Java doesn't have multiple inheritance; we have abstract client and server classes and NET and NIO implementations for each. Therefore the only common place in the class hierarchy for common NIO code is the superclass.

I agree it's a little ugly, but moving the code to a helper class just to get OO purity could be equally so, or worse.

spring-operator avatar Apr 18 '12 05:04 spring-operator

The NIO is just part of Java SDK anyway, and extra imports for those gives a little impact. Moving the NIO part into a helper class would bring much more complexity to the support and might impact extensibility of the AbstractConnectionFactory in case of some custom NIO connnection factory implementations.

So, closing as Won't Fix

artembilan avatar Oct 02 '25 16:10 artembilan