Rename SimpleChannelInboundHandler.channelRead0() to messageReceived() (#8819)

Motivation

Per javadoc in 4.1.x SimpleChannelInboundHandler:

"Please keep in mind that channelRead0(ChannelHandlerContext, I) will be
renamed to messageReceived(ChannelHandlerContext, I) in 5.0."

Modifications

Rename aforementioned method and all references/overrides.

Result

Method is renamed.
This commit is contained in:
Nick Hill 2019-10-31 23:23:07 -07:00 committed by Norman Maurer
parent e77b9104d7
commit 7df012884f
83 changed files with 116 additions and 124 deletions

View File

@ -427,7 +427,7 @@ public abstract class WebSocketClientHandshaker {
p.addAfter(ctx.name(), aggregatorName, new HttpObjectAggregator(8192));
p.addAfter(aggregatorName, "handshaker", new SimpleChannelInboundHandler<FullHttpResponse>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
// Remove ourself and do the actual handshake
ctx.pipeline().remove(this);
try {

View File

@ -291,7 +291,7 @@ public abstract class WebSocketServerHandshaker {
p.addAfter(ctx.name(), aggregatorName, new HttpObjectAggregator(8192));
p.addAfter(aggregatorName, "handshaker", new SimpleChannelInboundHandler<FullHttpRequest>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest msg) throws Exception {
// Remove ourself and do the actual handshake
ctx.pipeline().remove(this);
handshake(channel, msg, responseHeaders, promise);

View File

@ -136,7 +136,7 @@ public class HttpClientCodecTest {
ch.pipeline().addLast(new HttpObjectAggregator(4096));
ch.pipeline().addLast(new SimpleChannelInboundHandler<FullHttpRequest>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest msg) {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest msg) {
// This is just a simple demo...don't block in IO
assertTrue(ctx.channel() instanceof SocketChannel);
final SocketChannel sChannel = (SocketChannel) ctx.channel();
@ -174,7 +174,7 @@ public class HttpClientCodecTest {
ch.pipeline().addLast(new HttpObjectAggregator(4096));
ch.pipeline().addLast(new SimpleChannelInboundHandler<FullHttpResponse>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpResponse msg) {
responseReceivedLatch.countDown();
}
});

View File

@ -542,7 +542,7 @@ public class CorsHandlerTest {
private static class EchoHandler extends SimpleChannelInboundHandler<Object> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
ctx.writeAndFlush(new DefaultFullHttpResponse(HTTP_1_1, OK, true, true));
}
}

View File

@ -294,7 +294,7 @@ public abstract class WebSocketClientHandshakerTest {
EmbeddedChannel ch = new EmbeddedChannel(new HttpObjectAggregator(Integer.MAX_VALUE),
new SimpleChannelInboundHandler<FullHttpResponse>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
handshaker.finishHandshake(ctx.channel(), msg);
ctx.pipeline().remove(this);
}

View File

@ -88,7 +88,7 @@ public class WebSocketHandshakeHandOverTest {
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
}
});
@ -100,7 +100,7 @@ public class WebSocketHandshakeHandOverTest {
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof TextWebSocketFrame) {
clientReceivedMessage = true;
}
@ -136,7 +136,7 @@ public class WebSocketHandshakeHandOverTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
}
});
@ -151,7 +151,7 @@ public class WebSocketHandshakeHandOverTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof TextWebSocketFrame) {
clientReceivedMessage = true;
}
@ -193,7 +193,7 @@ public class WebSocketHandshakeHandOverTest {
new CloseNoOpServerProtocolHandler("/test"),
new SimpleChannelInboundHandler<Object>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
}
});
@ -211,7 +211,7 @@ public class WebSocketHandshakeHandOverTest {
}
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
}
});

View File

@ -793,7 +793,7 @@ public class InboundHttp2ToHttpAdapterTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
listener.messageReceived(msg);
latch.countDown();
latch2.countDown();
@ -811,7 +811,7 @@ public class InboundHttp2ToHttpAdapterTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Http2Settings settings) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Http2Settings settings) throws Exception {
listener.messageReceived(settings);
latch.countDown();
}

View File

@ -46,7 +46,7 @@ public class DiscardClientHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// Server is supposed to send nothing, but if it sends something, discard it.
}

View File

@ -24,7 +24,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
public class DiscardServerHandler extends SimpleChannelInboundHandler<Object> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// discard
}

View File

@ -62,7 +62,7 @@ public class FactorialClientHandler extends SimpleChannelInboundHandler<BigInteg
}
@Override
public void channelRead0(ChannelHandlerContext ctx, final BigInteger msg) {
public void messageReceived(ChannelHandlerContext ctx, final BigInteger msg) {
receivedMessages ++;
if (receivedMessages == FactorialClient.COUNT) {
// Offer the answer after closing the connection.

View File

@ -33,7 +33,7 @@ public class FactorialServerHandler extends SimpleChannelInboundHandler<BigInteg
private BigInteger factorial = new BigInteger("1");
@Override
public void channelRead0(ChannelHandlerContext ctx, BigInteger msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, BigInteger msg) throws Exception {
// Calculate the cumulative factorial and send it to the client.
lastMultiplier = msg;
factorial = factorial.multiply(msg);

View File

@ -33,7 +33,7 @@ public class FileServerHandler extends SimpleChannelInboundHandler<String> {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
RandomAccessFile raf = null;
long length = -1;
try {

View File

@ -30,7 +30,7 @@ import io.netty.handler.codec.http.HttpVersion;
*/
public class OkResponseHandler extends SimpleChannelInboundHandler<Object> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) {
public void messageReceived(ChannelHandlerContext ctx, Object msg) {
final FullHttpResponse response = new DefaultFullHttpResponse(
HttpVersion.HTTP_1_1, HttpResponseStatus.OK, Unpooled.EMPTY_BUFFER);
response.headers().set("custom-response-header", "Some value");

View File

@ -113,7 +113,7 @@ public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<Ful
private FullHttpRequest request;
@Override
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
this.request = request;
if (!request.decoderResult().isSuccess()) {
sendError(ctx, BAD_REQUEST);

View File

@ -43,7 +43,7 @@ public class HttpHelloWorldServerHandler extends SimpleChannelInboundHandler<Htt
}
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) {
if (msg instanceof HttpRequest) {
HttpRequest req = (HttpRequest) msg;

View File

@ -27,7 +27,7 @@ import io.netty.util.CharsetUtil;
public class HttpSnoopClientHandler extends SimpleChannelInboundHandler<HttpObject> {
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) {
if (msg instanceof HttpResponse) {
HttpResponse response = (HttpResponse) msg;

View File

@ -57,7 +57,7 @@ public class HttpSnoopServerHandler extends SimpleChannelInboundHandler<Object>
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof HttpRequest) {
HttpRequest request = this.request = (HttpRequest) msg;

View File

@ -32,7 +32,7 @@ public class HttpUploadClientHandler extends SimpleChannelInboundHandler<HttpObj
private boolean readingChunks;
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) {
if (msg instanceof HttpResponse) {
HttpResponse response = (HttpResponse) msg;

View File

@ -96,7 +96,7 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
}
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
if (msg instanceof HttpRequest) {
HttpRequest request = this.request = (HttpRequest) msg;
URI uri = new URI(request.uri());

View File

@ -56,7 +56,7 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
private WebSocketServerHandshaker handshaker;
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) {
public void messageReceived(ChannelHandlerContext ctx, Object msg) {
if (msg instanceof FullHttpRequest) {
handleHttpRequest(ctx, (FullHttpRequest) msg);
} else if (msg instanceof WebSocketFrame) {

View File

@ -80,7 +80,7 @@ public class WebSocketClientHandler extends SimpleChannelInboundHandler<Object>
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
Channel ch = ctx.channel();
if (!handshaker.isHandshakeComplete()) {
try {

View File

@ -28,7 +28,7 @@ import io.netty.handler.codec.http.websocketx.WebSocketFrame;
public class WebSocketFrameHandler extends SimpleChannelInboundHandler<WebSocketFrame> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, WebSocketFrame frame) throws Exception {
// ping and pong frames already handled
if (frame instanceof TextWebSocketFrame) {

View File

@ -54,7 +54,7 @@ public class WebSocketIndexPageHandler extends SimpleChannelInboundHandler<FullH
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
// Handle a bad request.
if (!req.decoderResult().isSuccess()) {
sendHttpResponse(ctx, req, new DefaultFullHttpResponse(HTTP_1_1, BAD_REQUEST, Unpooled.EMPTY_BUFFER));

View File

@ -54,7 +54,7 @@ public class Http2SettingsHandler extends SimpleChannelInboundHandler<Http2Setti
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Http2Settings msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Http2Settings msg) throws Exception {
promise.setSuccess();
// Only care about the first settings message

View File

@ -87,7 +87,7 @@ public class HttpResponseHandler extends SimpleChannelInboundHandler<FullHttpRes
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
Integer streamId = msg.headers().getInt(HttpConversionUtil.ExtensionHeaderNames.STREAM_ID.text());
if (streamId == null) {
System.err.println("HttpResponseHandler unexpected message received: " + msg);

View File

@ -92,7 +92,7 @@ public class Http2ServerInitializer extends ChannelInitializer<SocketChannel> {
p.addLast(new HttpServerUpgradeHandler(sourceCodec, upgradeCodecFactory));
p.addLast(new SimpleChannelInboundHandler<HttpMessage>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
// If this handler is hit then no upgrade has been attempted and the client is just talking HTTP.
System.err.println("Directly talking: " + msg.protocolVersion() + " (no upgrade was attempted)");
ChannelPipeline pipeline = ctx.pipeline();

View File

@ -94,7 +94,7 @@ public class Http2ServerInitializer extends ChannelInitializer<SocketChannel> {
p.addLast(new HttpServerUpgradeHandler(sourceCodec, upgradeCodecFactory));
p.addLast(new SimpleChannelInboundHandler<HttpMessage>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
// If this handler is hit then no upgrade has been attempted and the client is just talking HTTP.
System.err.println("Directly talking: " + msg.protocolVersion() + " (no upgrade was attempted)");
ChannelPipeline pipeline = ctx.pipeline();

View File

@ -48,7 +48,7 @@ public class HelloWorldHttp1Handler extends SimpleChannelInboundHandler<FullHttp
}
@Override
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
if (HttpUtil.is100ContinueExpected(req)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE, Unpooled.EMPTY_BUFFER));
}

View File

@ -93,7 +93,7 @@ public class Http2ServerInitializer extends ChannelInitializer<SocketChannel> {
p.addLast(cleartextHttp2ServerUpgradeHandler);
p.addLast(new SimpleChannelInboundHandler<HttpMessage>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
// If this handler is hit then no upgrade has been attempted and the client is just talking HTTP.
System.err.println("Directly talking: " + msg.protocolVersion() + " (no upgrade was attempted)");
ChannelPipeline pipeline = ctx.pipeline();

View File

@ -46,7 +46,7 @@ public final class FallbackRequestHandler extends SimpleChannelInboundHandler<Ht
+ ")</h2></body></html>", UTF_8)).asReadOnly();
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpRequest req) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpRequest req) throws Exception {
if (HttpUtil.is100ContinueExpected(req)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE, EMPTY_BUFFER));
}

View File

@ -40,11 +40,11 @@ import java.util.concurrent.TimeUnit;
public final class Http1RequestHandler extends Http2RequestHandler {
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
if (HttpUtil.is100ContinueExpected(request)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE, Unpooled.EMPTY_BUFFER));
}
super.channelRead0(ctx, request);
super.messageReceived(ctx, request);
}
@Override

View File

@ -52,7 +52,7 @@ public class Http2RequestHandler extends SimpleChannelInboundHandler<FullHttpReq
private static final String IMAGE_COORDINATE_X = "x";
@Override
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
QueryStringDecoder queryString = new QueryStringDecoder(request.uri());
String streamId = streamId(request);
int latency = toInt(firstValue(queryString, LATENCY_FIELD_NAME), 0);

View File

@ -21,7 +21,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
public class LocalEchoClientHandler extends SimpleChannelInboundHandler<Object> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// Print as received
System.out.println(msg);
}

View File

@ -23,7 +23,7 @@ import io.netty.util.CharsetUtil;
public class QuoteOfTheMomentClientHandler extends SimpleChannelInboundHandler<DatagramPacket> {
@Override
public void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
String response = msg.content().toString(CharsetUtil.UTF_8);
if (response.startsWith("QOTM: ")) {
System.out.println("Quote of the Moment: " + response.substring(6));

View File

@ -44,7 +44,7 @@ public class QuoteOfTheMomentServerHandler extends SimpleChannelInboundHandler<D
}
@Override
public void channelRead0(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception {
System.err.println(packet);
if ("QOTM?".equals(packet.content().toString(CharsetUtil.UTF_8))) {
ctx.write(new DatagramPacket(

View File

@ -24,7 +24,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
public class SecureChatClientHandler extends SimpleChannelInboundHandler<String> {
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
System.err.println(msg);
}

View File

@ -52,7 +52,7 @@ public class SecureChatServerHandler extends SimpleChannelInboundHandler<String>
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
// Send the received message to all channels but the current one.
for (Channel c: channels) {
if (c != ctx.channel()) {

View File

@ -41,7 +41,7 @@ public final class SocksServerConnectHandler extends SimpleChannelInboundHandler
private final Bootstrap b = new Bootstrap();
@Override
public void channelRead0(final ChannelHandlerContext ctx, final SocksMessage message) throws Exception {
public void messageReceived(final ChannelHandlerContext ctx, final SocksMessage message) throws Exception {
if (message instanceof Socks4CommandRequest) {
final Socks4CommandRequest request = (Socks4CommandRequest) message;
Promise<Channel> promise = ctx.executor().newPromise();

View File

@ -39,7 +39,7 @@ public final class SocksServerHandler extends SimpleChannelInboundHandler<SocksM
private SocksServerHandler() { }
@Override
public void channelRead0(ChannelHandlerContext ctx, SocksMessage socksRequest) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, SocksMessage socksRequest) throws Exception {
switch (socksRequest.version()) {
case SOCKS4a:
Socks4CommandRequest socksV4CmdRequest = (Socks4CommandRequest) socksRequest;

View File

@ -48,7 +48,7 @@ public class StompClientHandler extends SimpleChannelInboundHandler<StompFrame>
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, StompFrame frame) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, StompFrame frame) throws Exception {
String subscrReceiptId = "001";
String disconReceiptId = "002";
switch (frame.command()) {

View File

@ -26,7 +26,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
public class TelnetClientHandler extends SimpleChannelInboundHandler<String> {
@Override
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
System.err.println(msg);
}

View File

@ -39,7 +39,7 @@ public class TelnetServerHandler extends SimpleChannelInboundHandler<String> {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String request) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String request) throws Exception {
// Generate and write a response.
String response;
boolean close = false;

View File

@ -41,7 +41,7 @@ public class UptimeClientHandler extends SimpleChannelInboundHandler<Object> {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// Discard received data
}

View File

@ -22,7 +22,7 @@ import io.netty.channel.SimpleChannelInboundHandler;
@Sharable
public class UptimeServerHandler extends SimpleChannelInboundHandler<Object> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// discard
}

View File

@ -94,7 +94,7 @@ public class WorldClockClientHandler extends SimpleChannelInboundHandler<LocalTi
}
@Override
public void channelRead0(ChannelHandlerContext ctx, LocalTimes times) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, LocalTimes times) throws Exception {
answer.add(times);
}

View File

@ -32,7 +32,7 @@ import static java.util.Calendar.*;
public class WorldClockServerHandler extends SimpleChannelInboundHandler<Locations> {
@Override
public void channelRead0(ChannelHandlerContext ctx, Locations locations) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Locations locations) throws Exception {
long currentTime = System.currentTimeMillis();
LocalTimes.Builder builder = LocalTimes.newBuilder();

View File

@ -489,7 +489,7 @@ public class ProxyHandlerTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
String str = ((ByteBuf) msg).toString(CharsetUtil.US_ASCII);
received.add(str);
if ("2".equals(str)) {
@ -543,7 +543,7 @@ public class ProxyHandlerTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
fail("Unexpected message: " + msg);
}

View File

@ -158,7 +158,7 @@ abstract class ProxyServer {
private Channel backend;
@Override
protected final void channelRead0(final ChannelHandlerContext ctx, Object msg) throws Exception {
protected final void messageReceived(final ChannelHandlerContext ctx, Object msg) throws Exception {
if (finished) {
received.add(ReferenceCountUtil.retain(msg));
flush();
@ -265,7 +265,7 @@ abstract class ProxyServer {
private boolean finished;
@Override
protected final void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected final void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
if (finished) {
String str = ((ByteBuf) msg).toString(CharsetUtil.US_ASCII);
if ("A\n".equals(str)) {

View File

@ -28,7 +28,7 @@ final class UnresponsiveHandler extends SimpleChannelInboundHandler<Object> {
private UnresponsiveHandler() { }
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// Ignore
}
}

View File

@ -174,7 +174,7 @@ public class CipherSuiteCanaryTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
if (serverPromise.trySuccess(null)) {
ctx.writeAndFlush(Unpooled.wrappedBuffer(new byte[] {'P', 'O', 'N', 'G'}));
}
@ -210,7 +210,7 @@ public class CipherSuiteCanaryTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
clientPromise.trySuccess(null);
ctx.close();
}

View File

@ -240,7 +240,7 @@ public class OpenSslPrivateKeyMethodTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) {
public void messageReceived(ChannelHandlerContext ctx, Object msg) {
if (serverPromise.trySuccess(null)) {
ctx.writeAndFlush(Unpooled.wrappedBuffer(new byte[] {'P', 'O', 'N', 'G'}));
}
@ -276,7 +276,7 @@ public class OpenSslPrivateKeyMethodTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) {
public void messageReceived(ChannelHandlerContext ctx, Object msg) {
clientPromise.trySuccess(null);
ctx.close();
}

View File

@ -238,7 +238,7 @@ public abstract class SSLEngineTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
receiver.messageReceived(msg);
latch.countDown();
}

View File

@ -630,7 +630,8 @@ public class SslHandlerTest {
ch.pipeline().addLast(new SimpleChannelInboundHandler<ByteBuf>() {
private int readBytes;
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx,
ByteBuf msg) throws Exception {
readBytes += msg.readableBytes();
if (readBytes >= expectedBytes) {
serverReceiveLatch.countDown();

View File

@ -45,7 +45,7 @@ public class HelloWorldHttp1Handler extends SimpleChannelInboundHandler<FullHttp
}
@Override
public void channelRead0(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, FullHttpRequest req) throws Exception {
if (HttpUtil.is100ContinueExpected(req)) {
ctx.write(new DefaultFullHttpResponse(HTTP_1_1, CONTINUE, ctx.alloc().buffer(0)));
}

View File

@ -79,7 +79,7 @@ public class Http2ServerInitializer extends ChannelInitializer<SocketChannel> {
p.addLast(cleartextHttp2ServerUpgradeHandler);
p.addLast(new SimpleChannelInboundHandler<HttpMessage>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, HttpMessage msg) throws Exception {
// If this handler is hit then no upgrade has been attempted and the client is just talking HTTP.
System.err.println("Directly talking: " + msg.protocolVersion() + " (no upgrade was attempted)");
ChannelPipeline pipeline = ctx.pipeline();

View File

@ -41,7 +41,7 @@ public class HttpNativeServerHandler extends SimpleChannelInboundHandler<HttpObj
}
@Override
public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) {
if (msg instanceof HttpRequest) {
HttpRequest req = (HttpRequest) msg;

View File

@ -159,7 +159,7 @@ public class SctpEchoTest extends AbstractSctpTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);

View File

@ -148,7 +148,7 @@ public abstract class AbstractSocketShutdownOutputByPeerTest<Socket> extends Abs
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
queue.offer(msg.readByte());
}

View File

@ -57,7 +57,7 @@ public class DatagramMulticastTest extends AbstractDatagramTest {
sb.handler(new SimpleChannelInboundHandler<Object>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// Nothing will be sent.
}
});
@ -131,7 +131,7 @@ public class DatagramMulticastTest extends AbstractDatagramTest {
private volatile boolean fail;
@Override
protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
if (done) {
fail = true;
}

View File

@ -159,7 +159,7 @@ public class DatagramUnicastTest extends AbstractDatagramTest {
try {
cb.handler(new SimpleChannelInboundHandler<Object>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msgs) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msgs) throws Exception {
// Nothing will be sent.
}
});
@ -236,7 +236,7 @@ public class DatagramUnicastTest extends AbstractDatagramTest {
final AtomicReference<Throwable> clientErrorRef = new AtomicReference<Throwable>();
cb.handler(new SimpleChannelInboundHandler<DatagramPacket>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
try {
ByteBuf buf = msg.content();
assertEquals(bytes.length, buf.readableBytes());
@ -345,7 +345,7 @@ public class DatagramUnicastTest extends AbstractDatagramTest {
protected void initChannel(Channel ch) throws Exception {
ch.pipeline().addLast(new SimpleChannelInboundHandler<DatagramPacket>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
try {
if (sender == null) {
assertNotNull(msg.sender());

View File

@ -94,7 +94,7 @@ public class SocketBufReleaseTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// discard
}

View File

@ -106,7 +106,7 @@ public class SocketCancelWriteTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
counter += in.readableBytes();
received.writeBytes(in);
}

View File

@ -71,7 +71,7 @@ public class SocketDataReadInitialStateTest extends AbstractSocketTest {
serverConnectedChannelRef.set(ch);
ch.pipeline().addLast(new SimpleChannelInboundHandler<ByteBuf>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) {
ctx.writeAndFlush(msg.retainedDuplicate());
serverReadLatch.countDown();
}
@ -85,7 +85,7 @@ public class SocketDataReadInitialStateTest extends AbstractSocketTest {
protected void initChannel(Channel ch) {
ch.pipeline().addLast(new SimpleChannelInboundHandler<Object>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) {
clientReadLatch.countDown();
}
});
@ -147,7 +147,7 @@ public class SocketDataReadInitialStateTest extends AbstractSocketTest {
protected void initChannel(Channel ch) {
ch.pipeline().addLast(new SimpleChannelInboundHandler<ByteBuf>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) {
ctx.writeAndFlush(msg.retainedDuplicate());
serverReadLatch.countDown();
}
@ -160,7 +160,7 @@ public class SocketDataReadInitialStateTest extends AbstractSocketTest {
protected void initChannel(Channel ch) {
ch.pipeline().addLast(new SimpleChannelInboundHandler<Object>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) {
clientReadLatch.countDown();
}
});

View File

@ -177,7 +177,7 @@ public class SocketEchoTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);

View File

@ -109,7 +109,7 @@ public class SocketFileRegionTest extends AbstractSocketTest {
sb.childHandler(new SimpleChannelInboundHandler<ByteBuf>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) {
// Just drop the message.
}
});
@ -158,7 +158,7 @@ public class SocketFileRegionTest extends AbstractSocketTest {
ChannelHandler ch = new SimpleChannelInboundHandler<Object>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
}
@Override
@ -252,7 +252,7 @@ public class SocketFileRegionTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);

View File

@ -157,7 +157,7 @@ public class SocketFixedLengthEchoTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
assertEquals(1024, msg.readableBytes());
byte[] actual = new byte[msg.readableBytes()];

View File

@ -184,7 +184,7 @@ public class SocketGatheringWriteTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
received.writeBytes(in);
if (received.readableBytes() >= expectedBytes) {
doneReadingPromise.setSuccess(null);
@ -223,7 +223,7 @@ public class SocketGatheringWriteTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
}
@Override

View File

@ -311,7 +311,7 @@ public class SocketHalfClosedTest extends AbstractSocketTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
bytesRead += msg.readableBytes();
if (bytesRead >= expectedBytes) {
// We write a reply and immediately close our end of the socket.
@ -373,7 +373,7 @@ public class SocketHalfClosedTest extends AbstractSocketTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
bytesRead += msg.readableBytes();
if (bytesRead >= expectedBytes) {
if (!seenOutputShutdown) {

View File

@ -260,7 +260,7 @@ public class SocketShutdownOutputBySelfTest extends AbstractClientSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
queue.offer(msg.readByte());
}

View File

@ -267,6 +267,6 @@ public class SocketSslClientRenegotiateTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception { }
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception { }
}
}

View File

@ -504,7 +504,7 @@ public class SocketSslEchoTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);
@ -533,7 +533,7 @@ public class SocketSslEchoTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);

View File

@ -190,7 +190,7 @@ public class SocketSslGreetingTest extends AbstractSocketTest {
final CountDownLatch latch = new CountDownLatch(1);
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf buf) throws Exception {
assertEquals('a', buf.readByte());
assertFalse(buf.isReadable());
latch.countDown();
@ -214,7 +214,7 @@ public class SocketSslGreetingTest extends AbstractSocketTest {
final AtomicReference<Throwable> exception = new AtomicReference<>();
@Override
protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
// discard
}

View File

@ -183,7 +183,7 @@ public class SocketSslSessionReuseTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);
ctx.close();

View File

@ -230,7 +230,7 @@ public class SocketStartTlsTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
if ("StartTlsResponse".equals(msg)) {
ctx.pipeline().addAfter("logger", "ssl", sslHandler);
handshakeFuture = sslHandler.handshakeFuture();
@ -284,7 +284,7 @@ public class SocketStartTlsTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
if ("StartTlsRequest".equals(msg)) {
ctx.pipeline().addAfter("logger", "ssl", sslHandler);
ctx.writeAndFlush("StartTlsResponse\n");

View File

@ -147,7 +147,7 @@ public class SocketStringEchoTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
if (!data[dataIndex].equals(msg)) {
donePromise.tryFailure(new IllegalStateException("index: " + dataIndex + " didn't match!"));
ctx.close();

View File

@ -406,7 +406,7 @@ public class TrafficShapingHandlerTest extends AbstractSocketTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
long lastTimestamp = 0;
loggerClient.debug("Step: " + step + " Read: " + in.readableBytes() / 8 + " blocks");
while (in.isReadable()) {
@ -469,7 +469,7 @@ public class TrafficShapingHandlerTest extends AbstractSocketTest {
}
@Override
public void channelRead0(final ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(final ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
int nb = actual.length / messageSize;
loggerServer.info("Step: " + step + " Read: " + nb + " blocks");

View File

@ -98,7 +98,7 @@ public class EpollDatagramScatteringReadTest extends AbstractDatagramTest {
try {
cb.handler(new SimpleChannelInboundHandler<Object>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, Object msgs) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, Object msgs) throws Exception {
// Nothing will be sent.
}
});
@ -120,7 +120,7 @@ public class EpollDatagramScatteringReadTest extends AbstractDatagramTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) {
protected void messageReceived(ChannelHandlerContext ctx, DatagramPacket msg) {
assertEquals(ccAddress, msg.sender());
assertEquals(bytes.length, msg.content().readableBytes());

View File

@ -247,7 +247,7 @@ public class EpollSpliceTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf in) throws Exception {
byte[] actual = new byte[in.readableBytes()];
in.readBytes(actual);

View File

@ -190,7 +190,7 @@ public abstract class DetectPeerCloseWithoutReadTest {
}
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) {
bytesRead.addAndGet(msg.readableBytes());
if (extraReadRequested) {

View File

@ -55,7 +55,7 @@ import java.net.SocketAddress;
* <b>private boolean loggedIn;</b>
*
* {@code @Override}
* public void channelRead0({@link ChannelHandlerContext} ctx, Message message) {
* public void messageReceived({@link ChannelHandlerContext} ctx, Message message) {
* if (message instanceof LoginMessage) {
* authenticate((LoginMessage) message);
* <b>loggedIn = true;</b>

View File

@ -28,7 +28,7 @@ import io.netty.util.internal.TypeParameterMatcher;
* {@link SimpleChannelInboundHandler}&lt;{@link String}&gt; {
*
* {@code @Override}
* protected void channelRead0({@link ChannelHandlerContext} ctx, {@link String} message)
* protected void messageReceived({@link ChannelHandlerContext} ctx, {@link String} message)
* throws {@link Exception} {
* System.out.println(message);
* }
@ -38,12 +38,6 @@ import io.netty.util.internal.TypeParameterMatcher;
* Be aware that depending of the constructor parameters it will release all handled messages by passing them to
* {@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}.
*
* <h3>Forward compatibility notice</h3>
* <p>
* Please keep in mind that {@link #channelRead0(ChannelHandlerContext, I)} will be renamed to
* {@code messageReceived(ChannelHandlerContext, I)} in 5.0.
* </p>
*/
public abstract class SimpleChannelInboundHandler<I> implements ChannelInboundHandler {
@ -102,7 +96,7 @@ public abstract class SimpleChannelInboundHandler<I> implements ChannelInboundHa
if (acceptInboundMessage(msg)) {
@SuppressWarnings("unchecked")
I imsg = (I) msg;
channelRead0(ctx, imsg);
messageReceived(ctx, imsg);
} else {
release = false;
ctx.fireChannelRead(msg);
@ -115,9 +109,6 @@ public abstract class SimpleChannelInboundHandler<I> implements ChannelInboundHa
}
/**
* <strong>Please keep in mind that this method will be renamed to
* {@code messageReceived(ChannelHandlerContext, I)} in 5.0.</strong>
*
* Is called for each message of type {@link I}.
*
* @param ctx the {@link ChannelHandlerContext} which this {@link SimpleChannelInboundHandler}
@ -125,5 +116,5 @@ public abstract class SimpleChannelInboundHandler<I> implements ChannelInboundHa
* @param msg the message to handle
* @throws Exception is thrown if an error occurred
*/
protected abstract void channelRead0(ChannelHandlerContext ctx, I msg) throws Exception;
protected abstract void messageReceived(ChannelHandlerContext ctx, I msg) throws Exception;
}

View File

@ -198,7 +198,7 @@ public class LocalChannelTest {
.channel(LocalServerChannel.class)
.childHandler(new SimpleChannelInboundHandler<Object>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
ctx.close();
latch.countDown();
}
@ -213,7 +213,7 @@ public class LocalChannelTest {
.channel(LocalChannel.class)
.handler(new SimpleChannelInboundHandler<Object>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, Object msg) throws Exception {
protected void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
// discard
}
});
@ -867,7 +867,7 @@ public class LocalChannelTest {
}
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
// Just drop the buffer
}
});
@ -880,7 +880,7 @@ public class LocalChannelTest {
ch.pipeline().addLast(new SimpleChannelInboundHandler<ByteBuf>() {
@Override
public void channelRead0(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
public void messageReceived(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
while (buffer.isReadable()) {
// Fill the ChannelOutboundBuffer with multiple buffers
ctx.write(buffer.readRetainedSlice(1));

View File

@ -179,7 +179,7 @@ public class NioSocketChannelTest extends AbstractNioChannelTest<NioSocketChanne
ChannelPipeline pipeline = ch.pipeline();
pipeline.addLast(new SimpleChannelInboundHandler<ByteBuf>() {
@Override
protected void channelRead0(ChannelHandlerContext ctx, ByteBuf byteBuf) {
protected void messageReceived(ChannelHandlerContext ctx, ByteBuf byteBuf) {
// We was able to read something from the Channel after reregister.
latch.countDown();
}