From 31fd66b617dd6ea5a851e80338263f2866cb4c3d Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Wed, 21 Nov 2018 15:15:01 +0100 Subject: [PATCH] Mark OIO based transports as deprecated as preparation for removal in Netty 5. (#8579) Motivation: We plan to remove the OIO based transports in Netty 5 so we should mark these as deprecated already. Modifications: Mark all OIO based transports as deprecated. Result: Give the user a heads-up for removal. --- .../main/java/io/netty/channel/sctp/oio/OioSctpChannel.java | 3 +++ .../java/io/netty/channel/sctp/oio/OioSctpServerChannel.java | 3 +++ .../src/main/java/io/netty/channel/sctp/oio/package-info.java | 3 +++ .../main/java/io/netty/channel/ThreadPerChannelEventLoop.java | 2 ++ .../java/io/netty/channel/ThreadPerChannelEventLoopGroup.java | 3 +++ .../java/io/netty/channel/oio/AbstractOioByteChannel.java | 2 ++ .../main/java/io/netty/channel/oio/AbstractOioChannel.java | 3 +++ .../java/io/netty/channel/oio/AbstractOioMessageChannel.java | 3 +++ .../main/java/io/netty/channel/oio/OioByteStreamChannel.java | 3 +++ .../src/main/java/io/netty/channel/oio/OioEventLoopGroup.java | 3 +++ .../src/main/java/io/netty/channel/oio/package-info.java | 3 +++ .../socket/oio/DefaultOioServerSocketChannelConfig.java | 3 +++ .../channel/socket/oio/DefaultOioSocketChannelConfig.java | 3 +++ .../java/io/netty/channel/socket/oio/OioDatagramChannel.java | 2 ++ .../io/netty/channel/socket/oio/OioDatagramChannelConfig.java | 4 ++++ .../io/netty/channel/socket/oio/OioServerSocketChannel.java | 3 +++ .../channel/socket/oio/OioServerSocketChannelConfig.java | 3 +++ .../java/io/netty/channel/socket/oio/OioSocketChannel.java | 3 +++ .../io/netty/channel/socket/oio/OioSocketChannelConfig.java | 3 +++ .../main/java/io/netty/channel/socket/oio/package-info.java | 3 +++ 20 files changed, 58 insertions(+) diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpChannel.java index 658e0978c6e2..51a7c70f9251 100755 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpChannel.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpChannel.java @@ -58,7 +58,10 @@ * * Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system, * to understand what you need to do to use it. Also this feature is only supported on Java 7+. + * + * @deprecated use {@link io.netty.channel.sctp.nio.NioSctpChannel}. */ +@Deprecated public class OioSctpChannel extends AbstractOioMessageChannel implements io.netty.channel.sctp.SctpChannel { diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpServerChannel.java b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpServerChannel.java index 416fc9faa716..3c7372871de5 100755 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpServerChannel.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/OioSctpServerChannel.java @@ -46,7 +46,10 @@ * * Be aware that not all operations systems support SCTP. Please refer to the documentation of your operation system, * to understand what you need to do to use it. Also this feature is only supported on Java 7+. + * + * @deprecated use {@link io.netty.channel.sctp.nio.NioSctpServerChannel}. */ +@Deprecated public class OioSctpServerChannel extends AbstractOioMessageChannel implements io.netty.channel.sctp.SctpServerChannel { diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/package-info.java b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/package-info.java index a5e4de0d47f2..990faadc22a5 100644 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/oio/package-info.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/oio/package-info.java @@ -17,5 +17,8 @@ /** * Old blocking I/O based SCTP channel API implementation - recommended for * a small number of connections (< 1000). + * + * @deprecated use NIO based SCTP implementation. */ +@Deprecated package io.netty.channel.sctp.oio; diff --git a/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoop.java b/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoop.java index b10d79de7eb1..1d4b95817c0b 100644 --- a/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoop.java +++ b/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoop.java @@ -19,7 +19,9 @@ * {@link SingleThreadEventLoop} which is used to handle OIO {@link Channel}'s. So in general there will be * one {@link ThreadPerChannelEventLoop} per {@link Channel}. * + * @deprecated this will be remove in the next-major release. */ +@Deprecated public class ThreadPerChannelEventLoop extends SingleThreadEventLoop { private final ThreadPerChannelEventLoopGroup parent; diff --git a/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoopGroup.java b/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoopGroup.java index f254b8de92e1..7ee89d0211d5 100644 --- a/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoopGroup.java +++ b/transport/src/main/java/io/netty/channel/ThreadPerChannelEventLoopGroup.java @@ -42,7 +42,10 @@ /** * An {@link EventLoopGroup} that creates one {@link EventLoop} per {@link Channel}. + * + * @deprecated this will be remove in the next-major release. */ +@Deprecated public class ThreadPerChannelEventLoopGroup extends AbstractEventExecutorGroup implements EventLoopGroup { private final Object[] childArgs; diff --git a/transport/src/main/java/io/netty/channel/oio/AbstractOioByteChannel.java b/transport/src/main/java/io/netty/channel/oio/AbstractOioByteChannel.java index 6eda848f82ef..54ea0deadd8b 100644 --- a/transport/src/main/java/io/netty/channel/oio/AbstractOioByteChannel.java +++ b/transport/src/main/java/io/netty/channel/oio/AbstractOioByteChannel.java @@ -34,6 +34,8 @@ /** * Abstract base class for OIO which reads and writes bytes from/to a Socket + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ public abstract class AbstractOioByteChannel extends AbstractOioChannel { diff --git a/transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java b/transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java index 7aa312d8e90b..b046d00a1c02 100644 --- a/transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java +++ b/transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java @@ -25,7 +25,10 @@ /** * Abstract base class for {@link Channel} implementations that use Old-Blocking-IO + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public abstract class AbstractOioChannel extends AbstractChannel { protected static final int SO_TIMEOUT = 1000; diff --git a/transport/src/main/java/io/netty/channel/oio/AbstractOioMessageChannel.java b/transport/src/main/java/io/netty/channel/oio/AbstractOioMessageChannel.java index 0543b83c13ad..721631159ca2 100644 --- a/transport/src/main/java/io/netty/channel/oio/AbstractOioMessageChannel.java +++ b/transport/src/main/java/io/netty/channel/oio/AbstractOioMessageChannel.java @@ -26,7 +26,10 @@ /** * Abstract base class for OIO which reads and writes objects from/to a Socket + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public abstract class AbstractOioMessageChannel extends AbstractOioChannel { private final List readBuf = new ArrayList(); diff --git a/transport/src/main/java/io/netty/channel/oio/OioByteStreamChannel.java b/transport/src/main/java/io/netty/channel/oio/OioByteStreamChannel.java index 6d8863b9d356..d352823fdab9 100644 --- a/transport/src/main/java/io/netty/channel/oio/OioByteStreamChannel.java +++ b/transport/src/main/java/io/netty/channel/oio/OioByteStreamChannel.java @@ -31,7 +31,10 @@ /** * Abstract base class for OIO Channels that are based on streams. + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public abstract class OioByteStreamChannel extends AbstractOioByteChannel { private static final InputStream CLOSED_IN = new InputStream() { diff --git a/transport/src/main/java/io/netty/channel/oio/OioEventLoopGroup.java b/transport/src/main/java/io/netty/channel/oio/OioEventLoopGroup.java index 684af4098396..91a2c4b3ffbf 100644 --- a/transport/src/main/java/io/netty/channel/oio/OioEventLoopGroup.java +++ b/transport/src/main/java/io/netty/channel/oio/OioEventLoopGroup.java @@ -30,7 +30,10 @@ /** * {@link EventLoopGroup} which is used to handle OIO {@link Channel}'s. Each {@link Channel} will be handled by its * own {@link EventLoop} to not block others. + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class OioEventLoopGroup extends ThreadPerChannelEventLoopGroup { /** diff --git a/transport/src/main/java/io/netty/channel/oio/package-info.java b/transport/src/main/java/io/netty/channel/oio/package-info.java index 948e8492ad76..acbb62a5ba5b 100644 --- a/transport/src/main/java/io/netty/channel/oio/package-info.java +++ b/transport/src/main/java/io/netty/channel/oio/package-info.java @@ -17,5 +17,8 @@ /** * Old blocking I/O based channel API implementation - recommended for * a small number of connections (< 1000). + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated package io.netty.channel.oio; diff --git a/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioServerSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioServerSocketChannelConfig.java index 05d9bb30a457..9bb9056f50a6 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioServerSocketChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioServerSocketChannelConfig.java @@ -33,7 +33,10 @@ /** * Default {@link OioServerSocketChannelConfig} implementation + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class DefaultOioServerSocketChannelConfig extends DefaultServerSocketChannelConfig implements OioServerSocketChannelConfig { diff --git a/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioSocketChannelConfig.java index 3aa72fb48321..5261ebb82a52 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioSocketChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/DefaultOioSocketChannelConfig.java @@ -33,7 +33,10 @@ /** * Default {@link OioSocketChannelConfig} implementation + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class DefaultOioSocketChannelConfig extends DefaultSocketChannelConfig implements OioSocketChannelConfig { @Deprecated public DefaultOioSocketChannelConfig(SocketChannel channel, Socket javaSocket) { diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java index a283db74232c..17aa18f75417 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannel.java @@ -54,7 +54,9 @@ * * @see AddressedEnvelope * @see DatagramPacket + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class OioDatagramChannel extends AbstractOioMessageChannel implements DatagramChannel { diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelConfig.java index 0ebea3dbfb82..5da805e819ba 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioDatagramChannelConfig.java @@ -24,6 +24,10 @@ import java.net.InetAddress; import java.net.NetworkInterface; +/** + * @deprecated use NIO / EPOLL / KQUEUE transport. + */ +@Deprecated public interface OioDatagramChannelConfig extends DatagramChannelConfig { /** * Sets the maximal time a operation on the underlying socket may block. diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java index 336fcf1a6e73..bf91829b2574 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannel.java @@ -38,7 +38,10 @@ * {@link ServerSocketChannel} which accepts new connections and create the {@link OioSocketChannel}'s for them. * * This implementation use Old-Blocking-IO. + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class OioServerSocketChannel extends AbstractOioMessageChannel implements ServerSocketChannel { diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelConfig.java index 51bf6e01293b..caf3a5ebabb1 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioServerSocketChannelConfig.java @@ -39,7 +39,10 @@ * {@link ChannelOption#SO_TIMEOUT}{@link #setSoTimeout(int)} * * + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public interface OioServerSocketChannelConfig extends ServerSocketChannelConfig { /** diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java b/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java index 0c5580e93c29..935c316a88a8 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannel.java @@ -39,7 +39,10 @@ /** * A {@link SocketChannel} which is using Old-Blocking-IO + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public class OioSocketChannel extends OioByteStreamChannel implements SocketChannel { private static final InternalLogger logger = InternalLoggerFactory.getInstance(OioSocketChannel.class); diff --git a/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannelConfig.java index 5b56bf179b4b..6b4574519030 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/OioSocketChannelConfig.java @@ -39,7 +39,10 @@ * {@link ChannelOption#SO_TIMEOUT}{@link #setSoTimeout(int)} * * + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated public interface OioSocketChannelConfig extends SocketChannelConfig { /** diff --git a/transport/src/main/java/io/netty/channel/socket/oio/package-info.java b/transport/src/main/java/io/netty/channel/socket/oio/package-info.java index e73c4affb601..caf497fe331f 100644 --- a/transport/src/main/java/io/netty/channel/socket/oio/package-info.java +++ b/transport/src/main/java/io/netty/channel/socket/oio/package-info.java @@ -17,5 +17,8 @@ /** * Old blocking I/O based socket channel API implementation - recommended for * a small number of connections (< 1000). + * + * @deprecated use NIO / EPOLL / KQUEUE transport. */ +@Deprecated package io.netty.channel.socket.oio;