diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerExpectContinueHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerExpectContinueHandler.java index db4f5a185f..7988188adf 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerExpectContinueHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpServerExpectContinueHandler.java @@ -17,8 +17,8 @@ package io.netty.handler.codec.http; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.util.ReferenceCountUtil; import static io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH; @@ -44,7 +44,7 @@ import static io.netty.handler.codec.http.HttpVersion.HTTP_1_1; * * */ -public class HttpServerExpectContinueHandler implements ChannelInboundHandler { +public class HttpServerExpectContinueHandler implements ChannelHandler { private static final FullHttpResponse EXPECTATION_FAILED = new DefaultFullHttpResponse( HTTP_1_1, HttpResponseStatus.EXPECTATION_FAILED, Unpooled.EMPTY_BUFFER); diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/Utf8FrameValidator.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/Utf8FrameValidator.java index 20b1bc17c8..10744b32a4 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/Utf8FrameValidator.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/Utf8FrameValidator.java @@ -18,14 +18,14 @@ package io.netty.handler.codec.http.websocketx; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.handler.codec.CorruptedFrameException; /** * */ -public class Utf8FrameValidator implements ChannelInboundHandler { +public class Utf8FrameValidator implements ChannelHandler { private int fragmentedFramesCount; private Utf8Validator utf8Validator; diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandler.java index b3938e5225..bef4c5afb5 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandler.java @@ -16,7 +16,7 @@ package io.netty.handler.codec.http.websocketx; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.http.HttpHeaders; @@ -36,7 +36,7 @@ import static io.netty.handler.codec.http.websocketx.WebSocketClientProtocolConf * This implementation will establish the websocket connection once the connection to the remote server was complete. * * To know once a handshake was done you can intercept the - * {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} and check if the event was of type + * {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)} and check if the event was of type * {@link ClientHandshakeStateEvent#HANDSHAKE_ISSUED} or {@link ClientHandshakeStateEvent#HANDSHAKE_COMPLETE}. */ public class WebSocketClientProtocolHandler extends WebSocketProtocolHandler { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java index 70332cd9ee..e37beb58b6 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java @@ -17,8 +17,8 @@ package io.netty.handler.codec.http.websocketx; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.websocketx.WebSocketClientProtocolHandler.ClientHandshakeStateEvent; @@ -29,7 +29,7 @@ import java.util.concurrent.TimeUnit; import static io.netty.util.internal.ObjectUtil.*; -class WebSocketClientProtocolHandshakeHandler implements ChannelInboundHandler { +class WebSocketClientProtocolHandshakeHandler implements ChannelHandler { private static final long DEFAULT_HANDSHAKE_TIMEOUT_MS = 10000L; diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketCloseFrameHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketCloseFrameHandler.java index 37adc82228..a9f959bb50 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketCloseFrameHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketCloseFrameHandler.java @@ -17,8 +17,8 @@ package io.netty.handler.codec.http.websocketx; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.ChannelPromise; import io.netty.util.ReferenceCountUtil; import io.netty.util.concurrent.ScheduledFuture; @@ -30,7 +30,7 @@ import java.util.concurrent.TimeUnit; /** * Send {@link CloseWebSocketFrame} message on channel close, if close frame was not sent before. */ -final class WebSocketCloseFrameHandler extends ChannelOutboundHandlerAdapter { +final class WebSocketCloseFrameHandler implements ChannelHandler { private final WebSocketCloseStatus closeStatus; private final long forceCloseTimeoutMillis; private ChannelPromise closeSent; @@ -70,7 +70,7 @@ final class WebSocketCloseFrameHandler extends ChannelOutboundHandlerAdapter { promise = promise.unvoid(); closeSent = promise; } - super.write(ctx, msg, promise); + ctx.write(msg, promise); } private void applyCloseSentTimeout(ChannelHandlerContext ctx) { diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketFrameDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketFrameDecoder.java index 8c8142ec4e..061c50f6f8 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketFrameDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketFrameDecoder.java @@ -15,7 +15,7 @@ */ package io.netty.handler.codec.http.websocketx; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelPipeline; /** @@ -23,5 +23,5 @@ import io.netty.channel.ChannelPipeline; * * This makes it easier to access the added encoder later in the {@link ChannelPipeline}. */ -public interface WebSocketFrameDecoder extends ChannelInboundHandler { +public interface WebSocketFrameDecoder extends ChannelHandler { } diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java index 74502fbb38..f62be40d03 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java @@ -20,7 +20,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpRequest; @@ -47,7 +46,7 @@ import static io.netty.handler.codec.http.websocketx.WebSocketServerProtocolConf * to the io.netty.example.http.websocketx.server.WebSocketServer example. * * To know once a handshake was done you can intercept the - * {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} and check if the event was instance + * {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)} and check if the event was instance * of {@link HandshakeComplete}, the event will contain extra information about the handshake such as the request and * selected subprotocol. */ diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java index 61249d3fd0..fbd499f10b 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandshakeHandler.java @@ -17,8 +17,8 @@ package io.netty.handler.codec.http.websocketx; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPipeline; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.http.DefaultFullHttpResponse; @@ -42,7 +42,7 @@ import static io.netty.handler.codec.http.HttpVersion.*; /** * Handles the HTTP handshake (the HTTP Upgrade request) for {@link WebSocketServerProtocolHandler}. */ -class WebSocketServerProtocolHandshakeHandler implements ChannelInboundHandler { +class WebSocketServerProtocolHandshakeHandler implements ChannelHandler { private final WebSocketServerProtocolConfig serverConfig; private ChannelHandlerContext ctx; diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java index f52d90adb1..4604c40afc 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/http/HttpClientUpgradeHandlerTest.java @@ -15,8 +15,8 @@ */ package io.netty.handler.codec.http; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.embedded.EmbeddedChannel; import java.util.Collection; @@ -58,7 +58,7 @@ public class HttpClientUpgradeHandlerTest { } } - private static final class UserEventCatcher implements ChannelInboundHandler { + private static final class UserEventCatcher implements ChannelHandler { private Object evt; public Object getUserEvent() { diff --git a/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java b/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java index 72fc963536..e1c1a7d19a 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java @@ -18,7 +18,6 @@ package io.netty.handler.codec.http.websocketx; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPromise; import io.netty.channel.embedded.EmbeddedChannel; import io.netty.handler.codec.http.DefaultFullHttpRequest; @@ -391,7 +390,7 @@ public class WebSocketServerProtocolHandlerTest { } } - private static class CustomTextFrameHandler implements ChannelInboundHandler { + private static class CustomTextFrameHandler implements ChannelHandler { private String content; @Override diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java index 4b275eb071..f10574d288 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2FrameCodec.java @@ -17,8 +17,8 @@ package io.netty.handler.codec.http2; import io.netty.buffer.ByteBuf; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPromise; import io.netty.handler.codec.UnsupportedMessageTypeException; import io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeEvent; @@ -126,7 +126,7 @@ import static io.netty.handler.codec.http2.Http2Error.NO_ERROR; * *

Error Handling

* - * Exceptions and errors are propagated via {@link ChannelInboundHandler#exceptionCaught}. Exceptions that apply to + * Exceptions and errors are propagated via {@link ChannelHandler#exceptionCaught}. Exceptions that apply to * a specific HTTP/2 stream are wrapped in a {@link Http2FrameStreamException} and have the corresponding * {@link Http2FrameStream} object attached. * diff --git a/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttpToHttp2Adapter.java b/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttpToHttp2Adapter.java index ff3cc1cbb9..318aa97fee 100644 --- a/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttpToHttp2Adapter.java +++ b/codec-http2/src/main/java/io/netty/handler/codec/http2/InboundHttpToHttp2Adapter.java @@ -15,8 +15,8 @@ */ package io.netty.handler.codec.http2; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.handler.codec.http.FullHttpMessage; import io.netty.handler.codec.http.HttpHeaders; import io.netty.handler.codec.http.HttpScheme; @@ -26,7 +26,7 @@ import io.netty.util.internal.UnstableApi; * Translates HTTP/1.x object reads into HTTP/2 frames. */ @UnstableApi -public class InboundHttpToHttp2Adapter implements ChannelInboundHandler { +public class InboundHttpToHttp2Adapter implements ChannelHandler { private final Http2Connection connection; private final Http2FrameListener listener; diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java index dc90ae4193..fbd69db124 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2ConnectionRoundtripTest.java @@ -24,7 +24,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; @@ -520,7 +519,7 @@ public class Http2ConnectionRoundtripTest { assertTrue(requestLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS)); // Add a handler that will immediately throw an exception. - clientChannel.pipeline().addFirst(new ChannelHandlerAdapter() { + clientChannel.pipeline().addFirst(new ChannelHandler() { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { throw Http2Exception.connectionError(PROTOCOL_ERROR, "Fake Exception"); @@ -702,7 +701,7 @@ public class Http2ConnectionRoundtripTest { assertTrue(requestLatch.await(DEFAULT_AWAIT_TIMEOUT_SECONDS, SECONDS)); // Add a handler that will immediately throw an exception. - clientChannel.pipeline().addFirst(new ChannelHandlerAdapter() { + clientChannel.pipeline().addFirst(new ChannelHandler() { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { throw new RuntimeException("Fake Exception"); diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java index 67002db1e5..0631164d73 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java @@ -21,7 +21,6 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelPromise; import io.netty.channel.WriteBufferWaterMark; import io.netty.channel.embedded.EmbeddedChannel; @@ -137,7 +136,7 @@ public abstract class Http2MultiplexTest { @Test public void writeUnknownFrame() { - Http2StreamChannel childChannel = newOutboundStream(new ChannelInboundHandlerAdapter() { + Http2StreamChannel childChannel = newOutboundStream(new ChannelHandler() { @Override public void channelActive(ChannelHandlerContext ctx) { ctx.writeAndFlush(new DefaultHttp2HeadersFrame(new DefaultHttp2Headers())); @@ -185,7 +184,7 @@ public abstract class Http2MultiplexTest { // header frame and unknown frame verifyFramesMultiplexedToCorrectChannel(channel, handler, 2); - Channel childChannel = newOutboundStream(new ChannelInboundHandlerAdapter()); + Channel childChannel = newOutboundStream(new ChannelHandler() { }); assertTrue(childChannel.isActive()); } @@ -299,10 +298,10 @@ public abstract class Http2MultiplexTest { assertNotNull(headersFrame); childChannel.config().setAutoRead(false); - childChannel.pipeline().addFirst(new ChannelInboundHandlerAdapter() { + childChannel.pipeline().addFirst(new ChannelHandler() { private int count; @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + public void channelRead(ChannelHandlerContext ctx, Object msg) { ctx.fireChannelRead(msg); // Close channel after 2 reads so there is still something in the inboundBuffer when the close happens. if (++count == 2) { @@ -702,7 +701,7 @@ public abstract class Http2MultiplexTest { @Test public void writabilityOfParentIsRespected() { - Http2StreamChannel childChannel = newOutboundStream(new ChannelInboundHandlerAdapter()); + Http2StreamChannel childChannel = newOutboundStream(new ChannelHandler() { }); childChannel.config().setWriteBufferWaterMark(new WriteBufferWaterMark(2048, 4096)); parentChannel.config().setWriteBufferWaterMark(new WriteBufferWaterMark(256, 512)); assertTrue(childChannel.isWritable()); @@ -1084,11 +1083,11 @@ public abstract class Http2MultiplexTest { frameInboundWriter.writeInboundData(childChannel.stream().id(), bb("bar"), 0, false); // Add a handler which will request reads. - childChannel.pipeline().addFirst(new ChannelInboundHandlerAdapter() { + childChannel.pipeline().addFirst(new ChannelHandler() { @Override - public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { - super.channelReadComplete(ctx); + public void channelReadComplete(ChannelHandlerContext ctx) { + ctx.fireChannelReadComplete(); if (triggerOnReadComplete) { ctx.read(); ctx.read(); diff --git a/codec-http2/src/test/java/io/netty/handler/codec/http2/HttpToHttp2ConnectionHandlerTest.java b/codec-http2/src/test/java/io/netty/handler/codec/http2/HttpToHttp2ConnectionHandlerTest.java index 2ab0d97603..2578b13dea 100644 --- a/codec-http2/src/test/java/io/netty/handler/codec/http2/HttpToHttp2ConnectionHandlerTest.java +++ b/codec-http2/src/test/java/io/netty/handler/codec/http2/HttpToHttp2ConnectionHandlerTest.java @@ -22,7 +22,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.ChannelPromise; diff --git a/codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java b/codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java index 0d42f7759f..bbea4d5424 100644 --- a/codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java +++ b/codec/src/main/java/io/netty/handler/codec/MessageToMessageDecoder.java @@ -15,18 +15,16 @@ */ package io.netty.handler.codec; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPipeline; import io.netty.util.ReferenceCountUtil; import io.netty.util.ReferenceCounted; import io.netty.util.internal.TypeParameterMatcher; -import java.util.List; - /** - * {@link ChannelInboundHandler} which decodes from one message to an other message. + * {@link ChannelHandler} which decodes from one message to an other message. * * * For example here is an implementation which decodes a {@link String} to an {@link Integer} which represent @@ -49,7 +47,7 @@ import java.util.List; * {@link ReferenceCounted#release()} on decoded messages. * */ -public abstract class MessageToMessageDecoder extends ChannelHandlerAdapter implements ChannelInboundHandler { +public abstract class MessageToMessageDecoder extends ChannelHandlerAdapter { private final TypeParameterMatcher matcher; @@ -71,7 +69,7 @@ public abstract class MessageToMessageDecoder extends ChannelHandlerAdapter i /** * Returns {@code true} if the given message should be handled. If {@code false} it will be passed to the next - * {@link ChannelInboundHandler} in the {@link ChannelPipeline}. + * {@link ChannelHandler} in the {@link ChannelPipeline}. */ public boolean acceptInboundMessage(Object msg) throws Exception { return matcher.match(msg); diff --git a/codec/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java b/codec/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java index 9822d31d26..9585b8dd78 100644 --- a/codec/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java +++ b/codec/src/test/java/io/netty/handler/codec/ByteToMessageDecoderTest.java @@ -24,9 +24,7 @@ import io.netty.buffer.UnpooledByteBufAllocator; import io.netty.buffer.UnpooledHeapByteBuf; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; import io.netty.channel.embedded.EmbeddedChannel; -import org.junit.Ignore; import org.junit.Test; import java.util.concurrent.BlockingQueue; @@ -433,13 +431,13 @@ public class ByteToMessageDecoderTest { @Test public void testDoesNotOverRead() { - class ReadInterceptingHandler extends ChannelOutboundHandlerAdapter { + class ReadInterceptingHandler implements ChannelHandler { private int readsTriggered; @Override - public void read(ChannelHandlerContext ctx) throws Exception { + public void read(ChannelHandlerContext ctx) { readsTriggered++; - super.read(ctx); + ctx.read(); } } ReadInterceptingHandler interceptor = new ReadInterceptingHandler(); diff --git a/example/src/main/java/io/netty/example/echo/EchoClientHandler.java b/example/src/main/java/io/netty/example/echo/EchoClientHandler.java index 08f2d2b899..5c03413c4c 100644 --- a/example/src/main/java/io/netty/example/echo/EchoClientHandler.java +++ b/example/src/main/java/io/netty/example/echo/EchoClientHandler.java @@ -17,15 +17,15 @@ package io.netty.example.echo; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; /** * Handler implementation for the echo client. It initiates the ping-pong * traffic between the echo client and server by sending the first message to * the server. */ -public class EchoClientHandler implements ChannelInboundHandler { +public class EchoClientHandler implements ChannelHandler { private final ByteBuf firstMessage; diff --git a/example/src/main/java/io/netty/example/echo/EchoServerHandler.java b/example/src/main/java/io/netty/example/echo/EchoServerHandler.java index c169d22c87..1c6fbf6565 100644 --- a/example/src/main/java/io/netty/example/echo/EchoServerHandler.java +++ b/example/src/main/java/io/netty/example/echo/EchoServerHandler.java @@ -15,15 +15,15 @@ */ package io.netty.example.echo; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; /** * Handler implementation for the echo server. */ @Sharable -public class EchoServerHandler implements ChannelInboundHandler { +public class EchoServerHandler implements ChannelHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { diff --git a/example/src/main/java/io/netty/example/http2/helloworld/client/Http2ClientInitializer.java b/example/src/main/java/io/netty/example/http2/helloworld/client/Http2ClientInitializer.java index 9d83815e04..2c0dedbbcd 100644 --- a/example/src/main/java/io/netty/example/http2/helloworld/client/Http2ClientInitializer.java +++ b/example/src/main/java/io/netty/example/http2/helloworld/client/Http2ClientInitializer.java @@ -15,8 +15,8 @@ package io.netty.example.http2.helloworld.client; import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.socket.SocketChannel; @@ -134,7 +134,7 @@ public class Http2ClientInitializer extends ChannelInitializer { /** * A handler that triggers the cleartext upgrade to HTTP/2 by sending an initial HTTP request. */ - private final class UpgradeRequestHandler implements ChannelInboundHandler { + private final class UpgradeRequestHandler implements ChannelHandler { @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { @@ -163,7 +163,7 @@ public class Http2ClientInitializer extends ChannelInitializer { /** * Class that logs any User Events triggered on this channel. */ - private static class UserEventLogger implements ChannelInboundHandler { + private static class UserEventLogger implements ChannelHandler { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { System.out.println("User Event Triggered: " + evt); diff --git a/example/src/main/java/io/netty/example/http2/helloworld/frame/server/Http2ServerInitializer.java b/example/src/main/java/io/netty/example/http2/helloworld/frame/server/Http2ServerInitializer.java index 85685f68d9..212b21819f 100644 --- a/example/src/main/java/io/netty/example/http2/helloworld/frame/server/Http2ServerInitializer.java +++ b/example/src/main/java/io/netty/example/http2/helloworld/frame/server/Http2ServerInitializer.java @@ -16,8 +16,8 @@ package io.netty.example.http2.helloworld.frame.server; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.SimpleChannelInboundHandler; @@ -108,7 +108,7 @@ public class Http2ServerInitializer extends ChannelInitializer { /** * Class that logs any User Events triggered on this channel. */ - private static class UserEventLogger implements ChannelInboundHandler { + private static class UserEventLogger implements ChannelHandler { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { System.out.println("User Event Triggered: " + evt); diff --git a/example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/Http2ServerInitializer.java b/example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/Http2ServerInitializer.java index b5a6d4d285..08389b1ec8 100644 --- a/example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/Http2ServerInitializer.java +++ b/example/src/main/java/io/netty/example/http2/helloworld/multiplex/server/Http2ServerInitializer.java @@ -16,8 +16,8 @@ package io.netty.example.http2.helloworld.multiplex.server; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.SimpleChannelInboundHandler; @@ -110,7 +110,7 @@ public class Http2ServerInitializer extends ChannelInitializer { /** * Class that logs any User Events triggered on this channel. */ - private static class UserEventLogger implements ChannelInboundHandler { + private static class UserEventLogger implements ChannelHandler { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { System.out.println("User Event Triggered: " + evt); diff --git a/example/src/main/java/io/netty/example/http2/helloworld/server/Http2ServerInitializer.java b/example/src/main/java/io/netty/example/http2/helloworld/server/Http2ServerInitializer.java index 897554b383..826fd8f410 100644 --- a/example/src/main/java/io/netty/example/http2/helloworld/server/Http2ServerInitializer.java +++ b/example/src/main/java/io/netty/example/http2/helloworld/server/Http2ServerInitializer.java @@ -16,8 +16,8 @@ package io.netty.example.http2.helloworld.server; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.SimpleChannelInboundHandler; @@ -109,7 +109,7 @@ public class Http2ServerInitializer extends ChannelInitializer { /** * Class that logs any User Events triggered on this channel. */ - private static class UserEventLogger implements ChannelInboundHandler { + private static class UserEventLogger implements ChannelHandler { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { System.out.println("User Event Triggered: " + evt); diff --git a/example/src/main/java/io/netty/example/localecho/LocalEchoServerHandler.java b/example/src/main/java/io/netty/example/localecho/LocalEchoServerHandler.java index 4abf8b028e..5cd646785c 100644 --- a/example/src/main/java/io/netty/example/localecho/LocalEchoServerHandler.java +++ b/example/src/main/java/io/netty/example/localecho/LocalEchoServerHandler.java @@ -15,10 +15,10 @@ */ package io.netty.example.localecho; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; -public class LocalEchoServerHandler implements ChannelInboundHandler { +public class LocalEchoServerHandler implements ChannelHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { diff --git a/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java b/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java index 5505fc29a5..b7515d9917 100644 --- a/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java +++ b/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatBrokerHandler.java @@ -15,9 +15,9 @@ */ package io.netty.example.mqtt.heartBeat; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.mqtt.MqttConnAckMessage; import io.netty.handler.codec.mqtt.MqttConnAckVariableHeader; import io.netty.handler.codec.mqtt.MqttConnectReturnCode; @@ -30,7 +30,7 @@ import io.netty.handler.timeout.IdleStateEvent; import io.netty.util.ReferenceCountUtil; @Sharable -public final class MqttHeartBeatBrokerHandler extends ChannelInboundHandlerAdapter { +public final class MqttHeartBeatBrokerHandler implements ChannelHandler { public static final MqttHeartBeatBrokerHandler INSTANCE = new MqttHeartBeatBrokerHandler(); @@ -38,7 +38,7 @@ public final class MqttHeartBeatBrokerHandler extends ChannelInboundHandlerAdapt } @Override - public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { + public void channelRead(ChannelHandlerContext ctx, Object msg) { MqttMessage mqttMessage = (MqttMessage) msg; System.out.println("Received MQTT message: " + mqttMessage); switch (mqttMessage.fixedHeader().messageType()) { @@ -67,7 +67,7 @@ public final class MqttHeartBeatBrokerHandler extends ChannelInboundHandlerAdapt } @Override - public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { System.out.println("Channel heartBeat lost"); if (evt instanceof IdleStateEvent && IdleState.READER_IDLE == ((IdleStateEvent) evt).state()) { ctx.close(); @@ -75,7 +75,7 @@ public final class MqttHeartBeatBrokerHandler extends ChannelInboundHandlerAdapt } @Override - public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { cause.printStackTrace(); ctx.close(); } diff --git a/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java b/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java index d04ecf1084..2996a0a408 100644 --- a/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java +++ b/example/src/main/java/io/netty/example/mqtt/heartBeat/MqttHeartBeatClientHandler.java @@ -15,8 +15,8 @@ */ package io.netty.example.mqtt.heartBeat; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.handler.codec.mqtt.MqttConnectMessage; import io.netty.handler.codec.mqtt.MqttConnectPayload; import io.netty.handler.codec.mqtt.MqttConnectVariableHeader; @@ -27,7 +27,7 @@ import io.netty.handler.codec.mqtt.MqttQoS; import io.netty.handler.timeout.IdleStateEvent; import io.netty.util.ReferenceCountUtil; -public class MqttHeartBeatClientHandler extends ChannelInboundHandlerAdapter { +public class MqttHeartBeatClientHandler implements ChannelHandler { private static final String PROTOCOL_NAME_MQTT_3_1_1 = "MQTT"; private static final int PROTOCOL_VERSION_MQTT_3_1_1 = 4; @@ -71,7 +71,7 @@ public class MqttHeartBeatClientHandler extends ChannelInboundHandlerAdapter { ctx.writeAndFlush(pingreqMessage); System.out.println("Sent PINGREQ"); } else { - super.userEventTriggered(ctx, evt); + ctx.fireUserEventTriggered(evt); } } diff --git a/example/src/main/java/io/netty/example/objectecho/ObjectEchoClientHandler.java b/example/src/main/java/io/netty/example/objectecho/ObjectEchoClientHandler.java index 8f13b13717..4944d6a5ed 100644 --- a/example/src/main/java/io/netty/example/objectecho/ObjectEchoClientHandler.java +++ b/example/src/main/java/io/netty/example/objectecho/ObjectEchoClientHandler.java @@ -15,8 +15,8 @@ */ package io.netty.example.objectecho; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import java.util.ArrayList; import java.util.List; @@ -26,7 +26,7 @@ import java.util.List; * ping-pong traffic between the object echo client and server by sending the * first message to the server. */ -public class ObjectEchoClientHandler implements ChannelInboundHandler { +public class ObjectEchoClientHandler implements ChannelHandler { private final List firstMessage; diff --git a/example/src/main/java/io/netty/example/objectecho/ObjectEchoServerHandler.java b/example/src/main/java/io/netty/example/objectecho/ObjectEchoServerHandler.java index f78e5978f1..da0166d507 100644 --- a/example/src/main/java/io/netty/example/objectecho/ObjectEchoServerHandler.java +++ b/example/src/main/java/io/netty/example/objectecho/ObjectEchoServerHandler.java @@ -15,14 +15,14 @@ */ package io.netty.example.objectecho; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; /** * Handles both client-side and server-side handler depending on which * constructor was called. */ -public class ObjectEchoServerHandler implements ChannelInboundHandler { +public class ObjectEchoServerHandler implements ChannelHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { diff --git a/example/src/main/java/io/netty/example/ocsp/OcspClientExample.java b/example/src/main/java/io/netty/example/ocsp/OcspClientExample.java index 7ea6c3ef75..5b0bee38b5 100644 --- a/example/src/main/java/io/netty/example/ocsp/OcspClientExample.java +++ b/example/src/main/java/io/netty/example/ocsp/OcspClientExample.java @@ -22,7 +22,7 @@ import javax.net.ssl.SSLSession; import javax.security.cert.X509Certificate; import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.channel.MultithreadEventLoopGroup; import io.netty.channel.nio.NioHandler; import org.bouncycastle.asn1.ocsp.OCSPResponseStatus; @@ -153,7 +153,7 @@ public class OcspClientExample { }; } - private static class HttpClientHandler implements ChannelInboundHandler { + private static class HttpClientHandler implements ChannelHandler { private final String host; diff --git a/example/src/main/java/io/netty/example/proxy/HexDumpProxyBackendHandler.java b/example/src/main/java/io/netty/example/proxy/HexDumpProxyBackendHandler.java index 4ec3c9404b..8ad47fc188 100644 --- a/example/src/main/java/io/netty/example/proxy/HexDumpProxyBackendHandler.java +++ b/example/src/main/java/io/netty/example/proxy/HexDumpProxyBackendHandler.java @@ -17,10 +17,10 @@ package io.netty.example.proxy; import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; -public class HexDumpProxyBackendHandler implements ChannelInboundHandler { +public class HexDumpProxyBackendHandler implements ChannelHandler { private final Channel inboundChannel; diff --git a/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java b/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java index d3e031cb75..c9d73276bc 100644 --- a/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java +++ b/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java @@ -20,11 +20,11 @@ import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelOption; -public class HexDumpProxyFrontendHandler implements ChannelInboundHandler { +public class HexDumpProxyFrontendHandler implements ChannelHandler { private final String remoteHost; private final int remotePort; diff --git a/example/src/main/java/io/netty/example/sctp/SctpEchoClientHandler.java b/example/src/main/java/io/netty/example/sctp/SctpEchoClientHandler.java index c8b6ae0bfa..926d71553e 100644 --- a/example/src/main/java/io/netty/example/sctp/SctpEchoClientHandler.java +++ b/example/src/main/java/io/netty/example/sctp/SctpEchoClientHandler.java @@ -17,8 +17,8 @@ package io.netty.example.sctp; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.sctp.SctpMessage; /** @@ -26,7 +26,7 @@ import io.netty.channel.sctp.SctpMessage; * traffic between the echo client and server by sending the first message to * the server. */ -public class SctpEchoClientHandler implements ChannelInboundHandler { +public class SctpEchoClientHandler implements ChannelHandler { private final ByteBuf firstMessage; diff --git a/example/src/main/java/io/netty/example/sctp/SctpEchoServerHandler.java b/example/src/main/java/io/netty/example/sctp/SctpEchoServerHandler.java index 70ab3c122d..3e9e3fbdcc 100644 --- a/example/src/main/java/io/netty/example/sctp/SctpEchoServerHandler.java +++ b/example/src/main/java/io/netty/example/sctp/SctpEchoServerHandler.java @@ -15,15 +15,15 @@ */ package io.netty.example.sctp; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; /** * Handler implementation for the SCTP echo server. */ @Sharable -public class SctpEchoServerHandler implements ChannelInboundHandler { +public class SctpEchoServerHandler implements ChannelHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { diff --git a/example/src/main/java/io/netty/example/socksproxy/DirectClientHandler.java b/example/src/main/java/io/netty/example/socksproxy/DirectClientHandler.java index 89c52316c0..e744b9ae07 100644 --- a/example/src/main/java/io/netty/example/socksproxy/DirectClientHandler.java +++ b/example/src/main/java/io/netty/example/socksproxy/DirectClientHandler.java @@ -16,11 +16,11 @@ package io.netty.example.socksproxy; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.util.concurrent.Promise; -public final class DirectClientHandler implements ChannelInboundHandler { +public final class DirectClientHandler implements ChannelHandler { private final Promise promise; diff --git a/example/src/main/java/io/netty/example/socksproxy/RelayHandler.java b/example/src/main/java/io/netty/example/socksproxy/RelayHandler.java index 2581665053..0e1abb42e4 100644 --- a/example/src/main/java/io/netty/example/socksproxy/RelayHandler.java +++ b/example/src/main/java/io/netty/example/socksproxy/RelayHandler.java @@ -17,11 +17,11 @@ package io.netty.example.socksproxy; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.util.ReferenceCountUtil; -public final class RelayHandler implements ChannelInboundHandler { +public final class RelayHandler implements ChannelHandler { private final Channel relayChannel; diff --git a/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyServer.java b/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyServer.java index ba0660ad4d..6613ed7ed2 100644 --- a/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyServer.java +++ b/handler-proxy/src/test/java/io/netty/handler/proxy/ProxyServer.java @@ -25,7 +25,6 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.EventLoop; @@ -229,7 +228,7 @@ abstract class ProxyServer { ctx.close(); } - private final class BackendHandler implements ChannelInboundHandler { + private final class BackendHandler implements ChannelHandler { private final ChannelHandlerContext frontend; diff --git a/handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java b/handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java index f11a7a76cc..19f8afe433 100644 --- a/handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java +++ b/handler/src/main/java/io/netty/handler/ipfilter/AbstractRemoteAddressFilter.java @@ -18,8 +18,8 @@ package io.netty.handler.ipfilter; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import java.net.SocketAddress; @@ -35,7 +35,7 @@ import java.net.SocketAddress; * flexibility to respond to rejected (denied) connections. If you do not want to send a response, just have it return * null. Take a look at {@link RuleBasedIpFilter} for details. */ -public abstract class AbstractRemoteAddressFilter implements ChannelInboundHandler { +public abstract class AbstractRemoteAddressFilter implements ChannelHandler { @Override public void channelRegistered(ChannelHandlerContext ctx) throws Exception { diff --git a/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java b/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java index ac16ab5731..5b353ea62f 100644 --- a/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java +++ b/handler/src/main/java/io/netty/handler/logging/LoggingHandler.java @@ -20,7 +20,6 @@ import io.netty.buffer.ByteBufHolder; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandler; import io.netty.channel.ChannelPromise; import io.netty.util.internal.logging.InternalLogLevel; import io.netty.util.internal.logging.InternalLogger; @@ -287,7 +286,7 @@ public class LoggingHandler implements ChannelHandler { /** * Formats an event and returns the formatted message. This method is currently only used for formatting - * {@link ChannelOutboundHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. + * {@link ChannelHandler#connect(ChannelHandlerContext, SocketAddress, SocketAddress, ChannelPromise)}. * * @param eventName the name of the event * @param firstArg the first argument of the event diff --git a/handler/src/main/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandler.java b/handler/src/main/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandler.java index da9232fd3a..dd4361f7e5 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/ApplicationProtocolNegotiationHandler.java @@ -18,8 +18,8 @@ package io.netty.handler.ssl; import static java.util.Objects.requireNonNull; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.util.internal.logging.InternalLogger; @@ -60,7 +60,7 @@ import io.netty.util.internal.logging.InternalLoggerFactory; * } * */ -public abstract class ApplicationProtocolNegotiationHandler implements ChannelInboundHandler { +public abstract class ApplicationProtocolNegotiationHandler implements ChannelHandler { private static final InternalLogger logger = InternalLoggerFactory.getInstance(ApplicationProtocolNegotiationHandler.class); diff --git a/handler/src/main/java/io/netty/handler/ssl/SslMasterKeyHandler.java b/handler/src/main/java/io/netty/handler/ssl/SslMasterKeyHandler.java index b1c710c841..c86ec92563 100644 --- a/handler/src/main/java/io/netty/handler/ssl/SslMasterKeyHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/SslMasterKeyHandler.java @@ -16,8 +16,8 @@ package io.netty.handler.ssl; import io.netty.buffer.ByteBufUtil; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.util.internal.ReflectionUtil; import io.netty.util.internal.SystemPropertyUtil; import io.netty.util.internal.logging.InternalLogger; @@ -35,7 +35,7 @@ import java.lang.reflect.Field; * This can be very useful, for instance the {@link WiresharkSslMasterKeyHandler} implementation will * log the secret & identifier in a format that is consumable by Wireshark -- allowing easy decryption of pcap/tcpdumps. */ -public abstract class SslMasterKeyHandler extends ChannelInboundHandlerAdapter { +public abstract class SslMasterKeyHandler implements ChannelHandler { private static final InternalLogger logger = InternalLoggerFactory.getInstance(SslMasterKeyHandler.class); diff --git a/handler/src/main/java/io/netty/handler/ssl/ocsp/OcspClientHandler.java b/handler/src/main/java/io/netty/handler/ssl/ocsp/OcspClientHandler.java index 3ba167c9c3..eb8615a63c 100644 --- a/handler/src/main/java/io/netty/handler/ssl/ocsp/OcspClientHandler.java +++ b/handler/src/main/java/io/netty/handler/ssl/ocsp/OcspClientHandler.java @@ -17,8 +17,8 @@ package io.netty.handler.ssl.ocsp; import static java.util.Objects.requireNonNull; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.handler.ssl.ReferenceCountedOpenSslContext; import io.netty.handler.ssl.ReferenceCountedOpenSslEngine; import io.netty.handler.ssl.SslHandshakeCompletionEvent; @@ -33,7 +33,7 @@ import javax.net.ssl.SSLHandshakeException; * @see ReferenceCountedOpenSslEngine#getOcspResponse() */ @UnstableApi -public abstract class OcspClientHandler implements ChannelInboundHandler { +public abstract class OcspClientHandler implements ChannelHandler { private final ReferenceCountedOpenSslEngine engine; diff --git a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java index 6bbe238aa1..8009bbc245 100644 --- a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java @@ -18,7 +18,6 @@ package io.netty.handler.traffic; import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBufHolder; import io.netty.channel.Channel; -import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelConfig; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; diff --git a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java index be8009749b..e75b3c2354 100644 --- a/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java +++ b/handler/src/test/java/io/netty/handler/ssl/SslHandlerTest.java @@ -23,7 +23,6 @@ import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.Unpooled; import io.netty.buffer.UnpooledByteBufAllocator; import io.netty.channel.Channel; -import io.netty.channel.ChannelDuplexHandler; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; @@ -107,7 +106,7 @@ public class SslHandlerTest { writeLatch.countDown(); } }; - EmbeddedChannel ch = new EmbeddedChannel(new ChannelDuplexHandler() { + EmbeddedChannel ch = new EmbeddedChannel(new ChannelHandler() { @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { if (msg instanceof ByteBuf) { diff --git a/microbench/src/main/java/io/netty/handler/codec/http2/Http2FrameWriterDataBenchmark.java b/microbench/src/main/java/io/netty/handler/codec/http2/Http2FrameWriterDataBenchmark.java index 5d2bd436bb..fc98f6a777 100644 --- a/microbench/src/main/java/io/netty/handler/codec/http2/Http2FrameWriterDataBenchmark.java +++ b/microbench/src/main/java/io/netty/handler/codec/http2/Http2FrameWriterDataBenchmark.java @@ -21,7 +21,6 @@ import io.netty.buffer.UnpooledByteBufAllocator; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelPromise; import io.netty.microbench.channel.EmbeddedChannelWriteReleaseHandlerContext; import io.netty.microbench.util.AbstractMicrobenchmark; diff --git a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java index 952bdd24ea..34ebad5d84 100644 --- a/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java +++ b/resolver-dns/src/main/java/io/netty/resolver/dns/DnsNameResolver.java @@ -25,7 +25,6 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPromise; @@ -1177,7 +1176,7 @@ public class DnsNameResolver extends InetNameResolver { return dnsServerAddressStreamProvider.nameServerAddressStream(hostname); } - private final class DnsResponseHandler implements ChannelInboundHandler { + private final class DnsResponseHandler implements ChannelHandler { private final Promise channelActivePromise; diff --git a/resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java b/resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java index 154b8e94e3..165e229952 100644 --- a/resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java +++ b/resolver-dns/src/test/java/io/netty/resolver/dns/DnsNameResolverTest.java @@ -20,8 +20,8 @@ import io.netty.buffer.ByteBufHolder; import io.netty.channel.AddressedEnvelope; import io.netty.channel.ChannelFactory; import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.EventLoop; import io.netty.channel.EventLoopGroup; import io.netty.channel.MultithreadEventLoopGroup; @@ -2802,7 +2802,7 @@ public class DnsNameResolverTest { } resolver = builder.build(); if (truncatedBecauseOfMtu) { - resolver.ch.pipeline().addFirst(new ChannelInboundHandlerAdapter() { + resolver.ch.pipeline().addFirst(new ChannelHandler() { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) { if (msg instanceof DatagramPacket) { diff --git a/testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java b/testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java index c0409c91cc..66e4b90a55 100644 --- a/testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java +++ b/testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java @@ -19,8 +19,8 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.handler.codec.http.DefaultFullHttpResponse; import io.netty.handler.codec.http.FullHttpResponse; import io.netty.handler.codec.http.HttpHeaderNames; @@ -48,7 +48,7 @@ import static io.netty.handler.codec.http.HttpVersion.*; /** * Handles handshakes and messages */ -public class AutobahnServerHandler implements ChannelInboundHandler { +public class AutobahnServerHandler implements ChannelHandler { private static final Logger logger = Logger.getLogger(AutobahnServerHandler.class.getName()); private WebSocketServerHandshaker handshaker; diff --git a/testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java b/testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java index 4e754f118b..3195aa8841 100644 --- a/testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java +++ b/testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java @@ -18,8 +18,8 @@ package io.netty.testsuite.http2; import static io.netty.util.internal.ObjectUtil.checkPositiveOrZero; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelPipeline; import io.netty.channel.SimpleChannelInboundHandler; @@ -96,7 +96,7 @@ public class Http2ServerInitializer extends ChannelInitializer { /** * Class that logs any User Events triggered on this channel. */ - private static class UserEventLogger implements ChannelInboundHandler { + private static class UserEventLogger implements ChannelHandler { @Override public void userEventTriggered(ChannelHandlerContext ctx, Object evt) { System.out.println("User Event Triggered: " + evt); diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/AbstractSocketReuseFdTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/AbstractSocketReuseFdTest.java index 6e8ae87eef..a66afff3cb 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/AbstractSocketReuseFdTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/AbstractSocketReuseFdTest.java @@ -22,8 +22,8 @@ import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandlerAdapter; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.testsuite.transport.TestsuitePermutation; @@ -110,7 +110,7 @@ public abstract class AbstractSocketReuseFdTest extends AbstractSocketTest { } } - static class ReuseFdHandler extends ChannelInboundHandlerAdapter { + static class ReuseFdHandler implements ChannelHandler { private static final String EXPECTED_PAYLOAD = "payload"; private final Promise donePromise; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/DatagramConnectNotExistsTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/DatagramConnectNotExistsTest.java index ea9f1f6d3a..82f504dad2 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/DatagramConnectNotExistsTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/DatagramConnectNotExistsTest.java @@ -21,7 +21,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.testsuite.transport.TestsuitePermutation; import io.netty.util.CharsetUtil; import io.netty.util.NetUtil; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/ServerSocketSuspendTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/ServerSocketSuspendTest.java index df827a83f3..eab73c0cae 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/ServerSocketSuspendTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/ServerSocketSuspendTest.java @@ -19,7 +19,6 @@ import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelOption; import io.netty.util.internal.SocketUtils; import org.junit.Ignore; @@ -94,7 +93,7 @@ public class ServerSocketSuspendTest extends AbstractServerSocketTest { } @ChannelHandler.Sharable - private static final class AcceptedChannelCounter implements ChannelInboundHandler { + private static final class AcceptedChannelCounter implements ChannelHandler { final CountDownLatch latch; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java index 96ba792630..3be2d202cb 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java @@ -22,8 +22,8 @@ import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.channel.ChannelConfig; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.RecvByteBufAllocator; @@ -116,7 +116,7 @@ public class SocketAutoReadTest extends AbstractSocketTest { } } - private static final class AutoReadHandler implements ChannelInboundHandler { + private static final class AutoReadHandler implements ChannelHandler { private final AtomicInteger count = new AtomicInteger(); private final CountDownLatch latch = new CountDownLatch(1); private final CountDownLatch latch2; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketChannelNotYetConnectedTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketChannelNotYetConnectedTest.java index 731dab6f09..4d4d6ec5c4 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketChannelNotYetConnectedTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketChannelNotYetConnectedTest.java @@ -17,7 +17,6 @@ package io.netty.testsuite.transport.socket; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.socket.SocketChannel; import org.junit.Test; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java index eec3abd3e4..02d5470826 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java @@ -20,7 +20,6 @@ import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.socket.SocketChannel; import org.junit.Test; diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketExceptionHandlingTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketExceptionHandlingTest.java index ee2df69bee..ef731ea401 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketExceptionHandlingTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketExceptionHandlingTest.java @@ -19,8 +19,8 @@ import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; @@ -83,7 +83,7 @@ public class SocketExceptionHandlingTest extends AbstractSocketTest { } } - private static class BuggyChannelHandler implements ChannelInboundHandler { + private static class BuggyChannelHandler implements ChannelHandler { @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { ReferenceCountUtil.release(msg); @@ -91,7 +91,7 @@ public class SocketExceptionHandlingTest extends AbstractSocketTest { } } - private static class ExceptionHandler implements ChannelInboundHandler { + private static class ExceptionHandler implements ChannelHandler { final AtomicLong count = new AtomicLong(); /** * We expect to get 1 call to {@link #exceptionCaught(ChannelHandlerContext, Throwable)}. diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketObjectEchoTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketObjectEchoTest.java index 0536b6a8a3..dbe47aaf34 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketObjectEchoTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketObjectEchoTest.java @@ -18,8 +18,8 @@ package io.netty.testsuite.transport.socket; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.handler.codec.serialization.ClassResolvers; @@ -149,7 +149,7 @@ public class SocketObjectEchoTest extends AbstractSocketTest { } } - private static class EchoHandler implements ChannelInboundHandler { + private static class EchoHandler implements ChannelHandler { private final boolean autoRead; volatile Channel channel; final AtomicReference exception = new AtomicReference<>(); diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketReadPendingTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketReadPendingTest.java index 08a45768d0..025fab629c 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketReadPendingTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketReadPendingTest.java @@ -22,8 +22,8 @@ import io.netty.buffer.ByteBufAllocator; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.channel.ChannelConfig; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.RecvByteBufAllocator; @@ -101,7 +101,7 @@ public class SocketReadPendingTest extends AbstractSocketTest { } } - private static final class ReadPendingReadHandler implements ChannelInboundHandler { + private static final class ReadPendingReadHandler implements ChannelHandler { private final AtomicInteger count = new AtomicInteger(); private final CountDownLatch latch = new CountDownLatch(1); private final CountDownLatch latch2 = new CountDownLatch(2); diff --git a/testsuite/src/main/java/io/netty/testsuite/transport/socket/WriteBeforeRegisteredTest.java b/testsuite/src/main/java/io/netty/testsuite/transport/socket/WriteBeforeRegisteredTest.java index d9e661bf3d..b15d3a2f6a 100644 --- a/testsuite/src/main/java/io/netty/testsuite/transport/socket/WriteBeforeRegisteredTest.java +++ b/testsuite/src/main/java/io/netty/testsuite/transport/socket/WriteBeforeRegisteredTest.java @@ -17,8 +17,8 @@ package io.netty.testsuite.transport.socket; import io.netty.bootstrap.Bootstrap; import io.netty.buffer.Unpooled; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.socket.SocketChannel; import org.junit.Test; @@ -42,7 +42,7 @@ public class WriteBeforeRegisteredTest extends AbstractClientSocketTest { } } - private static class TestHandler implements ChannelInboundHandler { + private static class TestHandler implements ChannelHandler { @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { cause.printStackTrace(); diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDomainSocketFdTest.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDomainSocketFdTest.java index a1d776c3e0..085ab1d4cb 100644 --- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDomainSocketFdTest.java +++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDomainSocketFdTest.java @@ -21,7 +21,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.unix.DomainSocketReadMode; import io.netty.channel.unix.FileDescriptor; import io.netty.testsuite.transport.TestsuitePermutation; diff --git a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java index 03db137ce6..76d35b0b08 100644 --- a/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java +++ b/transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java @@ -20,9 +20,7 @@ import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.handler.logging.LogLevel; import io.netty.handler.logging.LoggingHandler; import io.netty.util.NetUtil; @@ -202,7 +200,7 @@ public class EpollReuseAddrTest { } @ChannelHandler.Sharable - private static class ServerSocketTestHandler implements ChannelInboundHandler { + private static class ServerSocketTestHandler implements ChannelHandler { private final AtomicBoolean accepted; ServerSocketTestHandler(AtomicBoolean accepted) { @@ -217,7 +215,7 @@ public class EpollReuseAddrTest { } @ChannelHandler.Sharable - private static class DatagramSocketTestHandler implements ChannelInboundHandler { + private static class DatagramSocketTestHandler implements ChannelHandler { private final AtomicBoolean received; DatagramSocketTestHandler(AtomicBoolean received) { @@ -232,5 +230,5 @@ public class EpollReuseAddrTest { } @ChannelHandler.Sharable - private static final class DummyHandler extends ChannelHandlerAdapter { } + private static final class DummyHandler implements ChannelHandler { } } diff --git a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueChannelConfigTest.java b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueChannelConfigTest.java index b0ed1c35dc..718e4c282a 100644 --- a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueChannelConfigTest.java +++ b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueChannelConfigTest.java @@ -18,7 +18,6 @@ package io.netty.channel.kqueue; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelException; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelOption; import io.netty.channel.EventLoopGroup; import io.netty.channel.MultithreadEventLoopGroup; diff --git a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueDomainSocketFdTest.java b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueDomainSocketFdTest.java index fe76c33a36..077b413741 100644 --- a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueDomainSocketFdTest.java +++ b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueDomainSocketFdTest.java @@ -21,7 +21,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.unix.DomainSocketReadMode; import io.netty.channel.unix.FileDescriptor; import io.netty.testsuite.transport.TestsuitePermutation; diff --git a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueServerSocketChannelConfigTest.java b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueServerSocketChannelConfigTest.java index dc9685e651..d8e6fbd710 100644 --- a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueServerSocketChannelConfigTest.java +++ b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueServerSocketChannelConfigTest.java @@ -17,7 +17,6 @@ package io.netty.channel.kqueue; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.EventLoopGroup; import io.netty.channel.MultithreadEventLoopGroup; import org.junit.AfterClass; diff --git a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueSocketChannelConfigTest.java b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueSocketChannelConfigTest.java index 8a447d6047..c51e8a2e18 100644 --- a/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueSocketChannelConfigTest.java +++ b/transport-native-kqueue/src/test/java/io/netty/channel/kqueue/KQueueSocketChannelConfigTest.java @@ -18,7 +18,6 @@ package io.netty.channel.kqueue; import io.netty.bootstrap.Bootstrap; import io.netty.channel.ChannelException; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.EventLoopGroup; import io.netty.channel.MultithreadEventLoopGroup; import org.junit.After; diff --git a/transport-sctp/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java b/transport-sctp/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java index 01a88ebabd..2220ca9bc8 100644 --- a/transport-sctp/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java +++ b/transport-sctp/src/main/java/io/netty/handler/codec/sctp/SctpMessageCompletionHandler.java @@ -19,7 +19,7 @@ package io.netty.handler.codec.sctp; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.channel.sctp.SctpMessage; import io.netty.handler.codec.MessageToMessageDecoder; @@ -29,7 +29,7 @@ import java.util.Map; /** * {@link MessageToMessageDecoder} which will take care of handle fragmented {@link SctpMessage}s, so * only complete {@link SctpMessage}s will be forwarded to the next - * {@link ChannelInboundHandler}. + * {@link ChannelHandler}. */ public class SctpMessageCompletionHandler extends MessageToMessageDecoder { private final Map fragments = new HashMap<>(); diff --git a/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java b/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java index 5b7bcecab1..2126248c2b 100644 --- a/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java +++ b/transport/src/main/java/io/netty/bootstrap/ServerBootstrap.java @@ -23,7 +23,6 @@ import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; import io.netty.channel.ChannelPipeline; @@ -210,7 +209,7 @@ public class ServerBootstrap extends AbstractBootstrap, Object>[] childOptions; diff --git a/transport/src/main/java/io/netty/channel/Channel.java b/transport/src/main/java/io/netty/channel/Channel.java index 970e52ca05..e1fc8879cf 100644 --- a/transport/src/main/java/io/netty/channel/Channel.java +++ b/transport/src/main/java/io/netty/channel/Channel.java @@ -272,7 +272,7 @@ public interface Channel extends AttributeMap, ChannelOutboundInvoker, Comparabl void deregister(ChannelPromise promise); /** - * Schedules a read operation that fills the inbound buffer of the first {@link ChannelInboundHandler} in the + * Schedules a read operation that fills the inbound buffer of the first {@link ChannelHandler} in the * {@link ChannelPipeline}. If there's already a pending read operation, this method does nothing. */ void beginRead(); diff --git a/transport/src/main/java/io/netty/channel/ChannelConfig.java b/transport/src/main/java/io/netty/channel/ChannelConfig.java index 9550acd01e..074ef40c5a 100644 --- a/transport/src/main/java/io/netty/channel/ChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/ChannelConfig.java @@ -125,7 +125,7 @@ public interface ChannelConfig { * {@link MaxMessagesRecvByteBufAllocator#maxMessagesPerRead()}. *

* Returns the maximum number of messages to read per read loop. - * a {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. + * a {@link ChannelHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. * If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages. */ @Deprecated diff --git a/transport/src/main/java/io/netty/channel/ChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/ChannelHandlerContext.java index a47f1bd2b7..112c36b0a9 100644 --- a/transport/src/main/java/io/netty/channel/ChannelHandlerContext.java +++ b/transport/src/main/java/io/netty/channel/ChannelHandlerContext.java @@ -82,7 +82,7 @@ import java.nio.channels.Channels; * as how many times it is added to pipelines, regardless if it is added to the * same pipeline multiple times or added to different pipelines multiple times: *

- * public class FactorialHandler implements {@link ChannelInboundHandler} {
+ * public class FactorialHandler implements {@link ChannelHandler} {
  *
  *   private final {@link AttributeKey}<{@link Integer}> counter = {@link AttributeKey}.valueOf("counter");
  *
diff --git a/transport/src/main/java/io/netty/channel/ChannelInboundInvoker.java b/transport/src/main/java/io/netty/channel/ChannelInboundInvoker.java
index 5a04ae9baa..f0123f2019 100644
--- a/transport/src/main/java/io/netty/channel/ChannelInboundInvoker.java
+++ b/transport/src/main/java/io/netty/channel/ChannelInboundInvoker.java
@@ -20,8 +20,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} was registered to its {@link EventLoop}.
      *
-     * This will result in having the  {@link ChannelInboundHandler#channelRegistered(ChannelHandlerContext)} method
-     * called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#channelRegistered(ChannelHandlerContext)} method
+     * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireChannelRegistered();
@@ -29,8 +29,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} was unregistered from its {@link EventLoop}.
      *
-     * This will result in having the  {@link ChannelInboundHandler#channelUnregistered(ChannelHandlerContext)} method
-     * called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#channelUnregistered(ChannelHandlerContext)} method
+     * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireChannelUnregistered();
@@ -38,8 +38,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} is active now, which means it is connected.
      *
-     * This will result in having the  {@link ChannelInboundHandler#channelActive(ChannelHandlerContext)} method
-     * called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#channelActive(ChannelHandlerContext)} method
+     * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireChannelActive();
@@ -47,8 +47,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} is inactive now, which means it is closed.
      *
-     * This will result in having the  {@link ChannelInboundHandler#channelInactive(ChannelHandlerContext)} method
-     * called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#channelInactive(ChannelHandlerContext)} method
+     * called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireChannelInactive();
@@ -56,8 +56,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} received an {@link Throwable} in one of its inbound operations.
      *
-     * This will result in having the  {@link ChannelInboundHandler#exceptionCaught(ChannelHandlerContext, Throwable)}
-     * method  called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#exceptionCaught(ChannelHandlerContext, Throwable)}
+     * method  called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireExceptionCaught(Throwable cause);
@@ -65,8 +65,8 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} received an user defined event.
      *
-     * This will result in having the  {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)}
-     * method  called of the next  {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the  {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)}
+     * method  called of the next  {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireUserEventTriggered(Object event);
@@ -74,21 +74,21 @@ public interface ChannelInboundInvoker {
     /**
      * A {@link Channel} received a message.
      *
-     * This will result in having the {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)}
-     * method  called of the next {@link ChannelInboundHandler} contained in the  {@link ChannelPipeline} of the
+     * This will result in having the {@link ChannelHandler#channelRead(ChannelHandlerContext, Object)}
+     * method  called of the next {@link ChannelHandler} contained in the  {@link ChannelPipeline} of the
      * {@link Channel}.
      */
     ChannelInboundInvoker fireChannelRead(Object msg);
 
     /**
-     * Triggers an {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext)}
-     * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}.
+     * Triggers an {@link ChannelHandler#channelReadComplete(ChannelHandlerContext)}
+     * event to the next {@link ChannelHandler} in the {@link ChannelPipeline}.
      */
     ChannelInboundInvoker fireChannelReadComplete();
 
     /**
-     * Triggers an {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)}
-     * event to the next {@link ChannelInboundHandler} in the {@link ChannelPipeline}.
+     * Triggers an {@link ChannelHandler#channelWritabilityChanged(ChannelHandlerContext)}
+     * event to the next {@link ChannelHandler} in the {@link ChannelPipeline}.
      */
     ChannelInboundInvoker fireChannelWritabilityChanged();
 }
diff --git a/transport/src/main/java/io/netty/channel/ChannelInitializer.java b/transport/src/main/java/io/netty/channel/ChannelInitializer.java
index 810891b233..a82e804fd5 100644
--- a/transport/src/main/java/io/netty/channel/ChannelInitializer.java
+++ b/transport/src/main/java/io/netty/channel/ChannelInitializer.java
@@ -22,7 +22,7 @@ import io.netty.util.internal.logging.InternalLogger;
 import io.netty.util.internal.logging.InternalLoggerFactory;
 
 /**
- * A special {@link ChannelInboundHandler} which offers an easy way to initialize a {@link Channel} once it was
+ * A special {@link ChannelHandler} which offers an easy way to initialize a {@link Channel} once it was
  * registered to its {@link EventLoop}.
  *
  * Implementations are most often used in the context of {@link Bootstrap#handler(ChannelHandler)} ,
@@ -47,7 +47,7 @@ import io.netty.util.internal.logging.InternalLoggerFactory;
  * @param    A sub-type of {@link Channel}
  */
 @Sharable
-public abstract class ChannelInitializer implements ChannelInboundHandler {
+public abstract class ChannelInitializer implements ChannelHandler {
 
     private static final InternalLogger logger = InternalLoggerFactory.getInstance(ChannelInitializer.class);
 
diff --git a/transport/src/main/java/io/netty/channel/ChannelOutboundInvoker.java b/transport/src/main/java/io/netty/channel/ChannelOutboundInvoker.java
index 5263cbe5df..fab719286a 100644
--- a/transport/src/main/java/io/netty/channel/ChannelOutboundInvoker.java
+++ b/transport/src/main/java/io/netty/channel/ChannelOutboundInvoker.java
@@ -179,8 +179,8 @@ public interface ChannelOutboundInvoker {
      * The given {@link ChannelPromise} will be notified.
      * 

* This will result in having the - * {@link ChannelOutboundHandler#close(ChannelHandlerContext, ChannelPromise)} - * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the + * {@link ChannelHandler#close(ChannelHandlerContext, ChannelPromise)} + * method called of the next {@link ChannelHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture close(ChannelPromise promise); @@ -193,8 +193,8 @@ public interface ChannelOutboundInvoker { * The given {@link ChannelPromise} will be notified. *

* This will result in having the - * {@link ChannelOutboundHandler#register(ChannelHandlerContext, ChannelPromise)} - * method called of the next {@link ChannelOutboundHandler} contained in the {@link ChannelPipeline} of the + * {@link ChannelHandler#register(ChannelHandlerContext, ChannelPromise)} + * method called of the next {@link ChannelHandler} contained in the {@link ChannelPipeline} of the * {@link Channel}. */ ChannelFuture register(ChannelPromise promise); diff --git a/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java b/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java index 6b9d000432..72a3130534 100644 --- a/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java +++ b/transport/src/main/java/io/netty/channel/CombinedChannelDuplexHandler.java @@ -103,7 +103,7 @@ public class CombinedChannelDuplexHandler, String>> nameCaches = new FastThreadLocal, String>>() { @Override - protected Map, String> initialValue() throws Exception { + protected Map, String> initialValue() { return new WeakHashMap<>(); } }; @@ -1011,7 +1011,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { /** * Called once a {@link Throwable} hit the end of the {@link ChannelPipeline} without been handled by the user - * in {@link ChannelInboundHandler#exceptionCaught(ChannelHandlerContext, Throwable)}. + * in {@link ChannelHandler#exceptionCaught(ChannelHandlerContext, Throwable)}. */ protected void onUnhandledInboundException(Throwable cause) { try { @@ -1025,14 +1025,14 @@ public class DefaultChannelPipeline implements ChannelPipeline { } /** - * Called once the {@link ChannelInboundHandler#channelActive(ChannelHandlerContext)}event hit + * Called once the {@link ChannelHandler#channelActive(ChannelHandlerContext)}event hit * the end of the {@link ChannelPipeline}. */ protected void onUnhandledInboundChannelActive() { } /** - * Called once the {@link ChannelInboundHandler#channelInactive(ChannelHandlerContext)} event hit + * Called once the {@link ChannelHandler#channelInactive(ChannelHandlerContext)} event hit * the end of the {@link ChannelPipeline}. */ protected void onUnhandledInboundChannelInactive() { @@ -1040,7 +1040,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { /** * Called once a message hit the end of the {@link ChannelPipeline} without been handled by the user - * in {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object)}. This method is responsible + * in {@link ChannelHandler#channelRead(ChannelHandlerContext, Object)}. This method is responsible * to call {@link ReferenceCountUtil#release(Object)} on the given msg at some point. */ protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) { @@ -1055,7 +1055,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { } /** - * Called once the {@link ChannelInboundHandler#channelReadComplete(ChannelHandlerContext)} event hit + * Called once the {@link ChannelHandler#channelReadComplete(ChannelHandlerContext)} event hit * the end of the {@link ChannelPipeline}. */ protected void onUnhandledInboundChannelReadComplete() { @@ -1063,7 +1063,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { /** * Called once an user event hit the end of the {@link ChannelPipeline} without been handled by the user - * in {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)}. This method is responsible + * in {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)}. This method is responsible * to call {@link ReferenceCountUtil#release(Object)} on the given event at some point. */ protected void onUnhandledInboundUserEventTriggered(Object evt) { @@ -1073,7 +1073,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { } /** - * Called once the {@link ChannelInboundHandler#channelWritabilityChanged(ChannelHandlerContext)} event hit + * Called once the {@link ChannelHandler#channelWritabilityChanged(ChannelHandlerContext)} event hit * the end of the {@link ChannelPipeline}. */ protected void onUnhandledChannelWritabilityChanged() { @@ -1096,7 +1096,7 @@ public class DefaultChannelPipeline implements ChannelPipeline { } // A special catch-all handler that handles both bytes and messages. - private static final class TailHandler implements ChannelInboundHandler { + private static final class TailHandler implements ChannelHandler { @Override public void channelRegistered(ChannelHandlerContext ctx) { } diff --git a/transport/src/main/java/io/netty/channel/MaxBytesRecvByteBufAllocator.java b/transport/src/main/java/io/netty/channel/MaxBytesRecvByteBufAllocator.java index 2222e2fdb4..e82f112bef 100644 --- a/transport/src/main/java/io/netty/channel/MaxBytesRecvByteBufAllocator.java +++ b/transport/src/main/java/io/netty/channel/MaxBytesRecvByteBufAllocator.java @@ -24,7 +24,7 @@ import java.util.Map.Entry; public interface MaxBytesRecvByteBufAllocator extends RecvByteBufAllocator { /** * Returns the maximum number of bytes to read per read loop. - * a {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. + * a {@link ChannelHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. * If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes. */ int maxBytesPerRead(); @@ -37,7 +37,7 @@ public interface MaxBytesRecvByteBufAllocator extends RecvByteBufAllocator { /** * Returns the maximum number of bytes to read per individual read operation. - * a {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. + * a {@link ChannelHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. * If this value is greater than 1, an event loop might attempt to read multiple times to procure bytes. */ int maxBytesPerIndividualRead(); diff --git a/transport/src/main/java/io/netty/channel/MaxMessagesRecvByteBufAllocator.java b/transport/src/main/java/io/netty/channel/MaxMessagesRecvByteBufAllocator.java index c4ed288ac5..9f2d06c52e 100644 --- a/transport/src/main/java/io/netty/channel/MaxMessagesRecvByteBufAllocator.java +++ b/transport/src/main/java/io/netty/channel/MaxMessagesRecvByteBufAllocator.java @@ -22,7 +22,7 @@ package io.netty.channel; public interface MaxMessagesRecvByteBufAllocator extends RecvByteBufAllocator { /** * Returns the maximum number of messages to read per read loop. - * a {@link ChannelInboundHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. + * a {@link ChannelHandler#channelRead(ChannelHandlerContext, Object) channelRead()} event. * If this value is greater than 1, an event loop might attempt to read multiple times to procure multiple messages. */ int maxMessagesPerRead(); diff --git a/transport/src/main/java/io/netty/channel/SimpleChannelInboundHandler.java b/transport/src/main/java/io/netty/channel/SimpleChannelInboundHandler.java index c30f360664..3a4161ccc4 100644 --- a/transport/src/main/java/io/netty/channel/SimpleChannelInboundHandler.java +++ b/transport/src/main/java/io/netty/channel/SimpleChannelInboundHandler.java @@ -19,7 +19,7 @@ import io.netty.util.ReferenceCountUtil; import io.netty.util.internal.TypeParameterMatcher; /** - * {@link ChannelInboundHandler} which allows to explicit only handle a specific type of messages. + * {@link ChannelHandler} which allows to explicit only handle a specific type of messages. * * For example here is an implementation which only handle {@link String} messages. * @@ -39,7 +39,7 @@ import io.netty.util.internal.TypeParameterMatcher; * {@link ReferenceCountUtil#release(Object)}. In this case you may need to use * {@link ReferenceCountUtil#retain(Object)} if you pass the object to the next handler in the {@link ChannelPipeline}. */ -public abstract class SimpleChannelInboundHandler implements ChannelInboundHandler { +public abstract class SimpleChannelInboundHandler implements ChannelHandler { private final TypeParameterMatcher matcher; private final boolean autoRelease; @@ -83,7 +83,7 @@ public abstract class SimpleChannelInboundHandler implements ChannelInboundHa /** * Returns {@code true} if the given message should be handled. If {@code false} it will be passed to the next - * {@link ChannelInboundHandler} in the {@link ChannelPipeline}. + * {@link ChannelHandler} in the {@link ChannelPipeline}. */ public boolean acceptInboundMessage(Object msg) throws Exception { return matcher.match(msg); diff --git a/transport/src/main/java/io/netty/channel/SimpleUserEventChannelHandler.java b/transport/src/main/java/io/netty/channel/SimpleUserEventChannelHandler.java index c26fb807ad..e08031ebf5 100644 --- a/transport/src/main/java/io/netty/channel/SimpleUserEventChannelHandler.java +++ b/transport/src/main/java/io/netty/channel/SimpleUserEventChannelHandler.java @@ -19,7 +19,7 @@ import io.netty.util.ReferenceCountUtil; import io.netty.util.internal.TypeParameterMatcher; /** - * {@link ChannelInboundHandler} which allows to conveniently only handle a specific type of user events. + * {@link ChannelHandler} which allows to conveniently only handle a specific type of user events. * * For example, here is an implementation which only handle {@link String} user events. * @@ -39,7 +39,7 @@ import io.netty.util.internal.TypeParameterMatcher; * {@link ReferenceCountUtil#release(Object)}. In this case you may need to use * {@link ReferenceCountUtil#retain(Object)} if you pass the object to the next handler in the {@link ChannelPipeline}. */ -public abstract class SimpleUserEventChannelHandler implements ChannelInboundHandler { +public abstract class SimpleUserEventChannelHandler implements ChannelHandler { private final TypeParameterMatcher matcher; private final boolean autoRelease; @@ -83,7 +83,7 @@ public abstract class SimpleUserEventChannelHandler implements ChannelInbound /** * Returns {@code true} if the given user event should be handled. If {@code false} it will be passed to the next - * {@link ChannelInboundHandler} in the {@link ChannelPipeline}. + * {@link ChannelHandler} in the {@link ChannelPipeline}. */ protected boolean acceptEvent(Object evt) throws Exception { return matcher.match(evt); diff --git a/transport/src/main/java/io/netty/channel/group/ChannelGroup.java b/transport/src/main/java/io/netty/channel/group/ChannelGroup.java index 1fd7f93b5a..96a23d1dc1 100644 --- a/transport/src/main/java/io/netty/channel/group/ChannelGroup.java +++ b/transport/src/main/java/io/netty/channel/group/ChannelGroup.java @@ -21,8 +21,8 @@ import io.netty.buffer.ByteBufHolder; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelId; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.EventLoop; import io.netty.channel.ServerChannel; import io.netty.util.CharsetUtil; @@ -82,7 +82,7 @@ import java.util.Set; * allChannels.close().awaitUninterruptibly(); * } * - * public class MyHandler implements {@link ChannelInboundHandler} { + * public class MyHandler implements {@link ChannelHandler} { * {@code @Override} * public void channelActive({@link ChannelHandlerContext} ctx) { * // closed on shutdown. diff --git a/transport/src/main/java/io/netty/channel/socket/ChannelInputShutdownEvent.java b/transport/src/main/java/io/netty/channel/socket/ChannelInputShutdownEvent.java index c63090976e..935223cc9b 100644 --- a/transport/src/main/java/io/netty/channel/socket/ChannelInputShutdownEvent.java +++ b/transport/src/main/java/io/netty/channel/socket/ChannelInputShutdownEvent.java @@ -16,11 +16,11 @@ package io.netty.channel.socket; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; /** * Special event which will be fired and passed to the - * {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} methods once the input of + * {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)} methods once the input of * a {@link SocketChannel} was shutdown and the {@link SocketChannelConfig#isAllowHalfClosure()} method returns * {@code true}. */ diff --git a/transport/src/main/java/io/netty/channel/socket/ChannelOutputShutdownEvent.java b/transport/src/main/java/io/netty/channel/socket/ChannelOutputShutdownEvent.java index 49d882f92e..02329b1ba8 100644 --- a/transport/src/main/java/io/netty/channel/socket/ChannelOutputShutdownEvent.java +++ b/transport/src/main/java/io/netty/channel/socket/ChannelOutputShutdownEvent.java @@ -16,12 +16,12 @@ package io.netty.channel.socket; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.util.internal.UnstableApi; /** * Special event which will be fired and passed to the - * {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} methods once the output of + * {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)} methods once the output of * a {@link SocketChannel} was shutdown. */ @UnstableApi diff --git a/transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java b/transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java index ecea2d8214..d33f16bee2 100644 --- a/transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/socket/SocketChannelConfig.java @@ -18,7 +18,7 @@ package io.netty.channel.socket; import io.netty.buffer.ByteBufAllocator; import io.netty.channel.ChannelConfig; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelOption; import io.netty.channel.MessageSizeEstimator; import io.netty.channel.RecvByteBufAllocator; @@ -152,7 +152,7 @@ public interface SocketChannelConfig extends ChannelConfig { * Sets whether the channel should not close itself when its remote peer shuts down output to * make the connection half-closed. If {@code true} the connection is not closed when the * remote peer shuts down output. Instead, - * {@link ChannelInboundHandler#userEventTriggered(ChannelHandlerContext, Object)} + * {@link ChannelHandler#userEventTriggered(ChannelHandlerContext, Object)} * is invoked with a {@link ChannelInputShutdownEvent} object. If {@code false}, the connection * is closed automatically. */ diff --git a/transport/src/test/java/io/netty/bootstrap/ServerBootstrapTest.java b/transport/src/test/java/io/netty/bootstrap/ServerBootstrapTest.java index cfc6c53f68..a353061ae4 100644 --- a/transport/src/test/java/io/netty/bootstrap/ServerBootstrapTest.java +++ b/transport/src/test/java/io/netty/bootstrap/ServerBootstrapTest.java @@ -17,7 +17,6 @@ package io.netty.bootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInitializer; import io.netty.channel.MultithreadEventLoopGroup; @@ -47,7 +46,7 @@ public class ServerBootstrapTest { sb.channel(LocalServerChannel.class) .group(group) .childHandler(new ChannelHandler() { }) - .handler(new ChannelHandlerAdapter() { + .handler(new ChannelHandler() { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { try { diff --git a/transport/src/test/java/io/netty/channel/ChannelInitializerTest.java b/transport/src/test/java/io/netty/channel/ChannelInitializerTest.java index 65b9e9c7f7..4f82e2d1dd 100644 --- a/transport/src/test/java/io/netty/channel/ChannelInitializerTest.java +++ b/transport/src/test/java/io/netty/channel/ChannelInitializerTest.java @@ -251,7 +251,7 @@ public class ChannelInitializerTest { } } - private static final class InspectableHandler extends ChannelDuplexHandler { + private static final class InspectableHandler implements ChannelHandler { final AtomicInteger channelRegisteredCount = new AtomicInteger(0); @Override diff --git a/transport/src/test/java/io/netty/channel/CombinedChannelDuplexHandlerTest.java b/transport/src/test/java/io/netty/channel/CombinedChannelDuplexHandlerTest.java index 0cf5b9c458..32f3b23959 100644 --- a/transport/src/test/java/io/netty/channel/CombinedChannelDuplexHandlerTest.java +++ b/transport/src/test/java/io/netty/channel/CombinedChannelDuplexHandlerTest.java @@ -191,7 +191,7 @@ public class CombinedChannelDuplexHandlerTest { CombinedChannelDuplexHandler handler = new CombinedChannelDuplexHandler<>( - inboundHandler, new ChannelOutboundHandler() { }); + inboundHandler, new ChannelHandler() { }); EmbeddedChannel channel = new EmbeddedChannel(handler); channel.pipeline().fireChannelWritabilityChanged(); @@ -359,9 +359,9 @@ public class CombinedChannelDuplexHandlerTest { } }; EmbeddedChannel ch = new EmbeddedChannel(outboundHandler, - new CombinedChannelDuplexHandler( - new ChannelInboundHandler() { - }, new ChannelOutboundHandler() { })); + new CombinedChannelDuplexHandler( + new ChannelHandler() { + }, new ChannelHandler() { })); ChannelPipeline pipeline = ch.pipeline(); ChannelPromise promise = ch.newPromise(); @@ -392,7 +392,7 @@ public class CombinedChannelDuplexHandlerTest { @Test(expected = IllegalStateException.class) public void testNotSharable() { - new CombinedChannelDuplexHandler() { + new CombinedChannelDuplexHandler() { @Override public boolean isSharable() { return true; diff --git a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java index 0a09e7b50b..6125296e00 100644 --- a/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java +++ b/transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java @@ -146,7 +146,7 @@ public class DefaultChannelPipelineTest { assertTrue(handler.called); } - private static final class StringInboundHandler implements ChannelInboundHandler { + private static final class StringInboundHandler implements ChannelHandler { boolean called; @Override @@ -946,7 +946,7 @@ public class DefaultChannelPipelineTest { EmbeddedChannel channel = new EmbeddedChannel(true); ChannelPipeline pipeline = channel.pipeline(); - final class SkipHandler implements ChannelInboundHandler, ChannelOutboundHandler { + final class SkipHandler implements ChannelHandler { private int state = 2; private Error errorRef; @@ -1100,7 +1100,7 @@ public class DefaultChannelPipelineTest { } } - final class OutboundCalledHandler implements ChannelOutboundHandler { + final class OutboundCalledHandler implements ChannelHandler { private static final int MASK_BIND = 1; private static final int MASK_CONNECT = 1 << 1; private static final int MASK_DISCONNECT = 1 << 2; @@ -1197,7 +1197,7 @@ public class DefaultChannelPipelineTest { } } - final class InboundCalledHandler implements ChannelInboundHandler { + final class InboundCalledHandler implements ChannelHandler { private static final int MASK_CHANNEL_REGISTER = 1; private static final int MASK_CHANNEL_UNREGISTER = 1 << 1; @@ -1463,7 +1463,7 @@ public class DefaultChannelPipelineTest { } } - private static final class CheckExceptionHandler implements ChannelInboundHandler { + private static final class CheckExceptionHandler implements ChannelHandler { private final Throwable expected; private final Promise promise; @@ -1492,7 +1492,7 @@ public class DefaultChannelPipelineTest { fail("handler was not one of the expected handlers"); } - private static final class CheckOrderHandler implements ChannelInboundHandler { + private static final class CheckOrderHandler implements ChannelHandler { private final Queue addedQueue; private final Queue removedQueue; private final AtomicReference error = new AtomicReference<>(); diff --git a/transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java b/transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java index 182d1f7de8..8d63c59e7b 100644 --- a/transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java +++ b/transport/src/test/java/io/netty/channel/PendingWriteQueueTest.java @@ -193,7 +193,7 @@ public class PendingWriteQueueTest { private static EmbeddedChannel newChannel() { // Add a handler so we can access a ChannelHandlerContext via the ChannelPipeline. - return new EmbeddedChannel(new ChannelHandlerAdapter() { }); + return new EmbeddedChannel(new ChannelHandler() { }); } @Test diff --git a/transport/src/test/java/io/netty/channel/SimpleUserEventChannelHandlerTest.java b/transport/src/test/java/io/netty/channel/SimpleUserEventChannelHandlerTest.java index 0023a632c2..dcd05fbe1c 100644 --- a/transport/src/test/java/io/netty/channel/SimpleUserEventChannelHandlerTest.java +++ b/transport/src/test/java/io/netty/channel/SimpleUserEventChannelHandlerTest.java @@ -85,7 +85,7 @@ public class SimpleUserEventChannelHandlerTest { } } - static final class AllEventCatcher implements ChannelInboundHandler { + static final class AllEventCatcher implements ChannelHandler { public List caughtEvents; diff --git a/transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java b/transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java index 39b0fb05fe..c18c2487e5 100644 --- a/transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java +++ b/transport/src/test/java/io/netty/channel/embedded/EmbeddedChannelTest.java @@ -40,7 +40,6 @@ import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelFutureListener; import io.netty.channel.ChannelHandler; -import io.netty.channel.ChannelHandlerAdapter; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelId; import io.netty.channel.ChannelInitializer; @@ -148,7 +147,7 @@ public class EmbeddedChannelTest { public void testHandlerAddedExecutedInEventLoop() throws Throwable { final CountDownLatch latch = new CountDownLatch(1); final AtomicReference error = new AtomicReference<>(); - final ChannelHandler handler = new ChannelHandlerAdapter() { + final ChannelHandler handler = new ChannelHandler() { @Override public void handlerAdded(ChannelHandlerContext ctx) throws Exception { try { diff --git a/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest2.java b/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest2.java index 08e375f2b2..79cbf99dd3 100644 --- a/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest2.java +++ b/transport/src/test/java/io/netty/channel/local/LocalTransportThreadModelTest2.java @@ -19,9 +19,9 @@ import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandler.Sharable; import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelInboundHandler; import io.netty.channel.MultithreadEventLoopGroup; import io.netty.util.ReferenceCountUtil; import org.junit.Test; @@ -90,7 +90,7 @@ public class LocalTransportThreadModelTest2 { } @Sharable - static class LocalHandler implements ChannelInboundHandler { + static class LocalHandler implements ChannelHandler { private final String name; public volatile ChannelFuture lastWriteFuture;