GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge ChannelInboundConsumingHandler into SimpleChannelInboundHandler · netty/netty@a969613

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • codec-http/src
    • main/java/io/netty/handler/codec/http/websocketx
      • WebSocketClientProtocolHandshakeHandler.java
      • WebSocketServerProtocolHandler.java
    • test/java/io/netty/handler/codec/http/websocketx
      • WebSocketServerProtocolHandlerTest.java
  • example/src/main/java/io/netty/example
    • applet
      • AppletDiscardServer.java
    • factorial
      • FactorialClientHandler.java
    • filetransfer
      • FileServer.java
    • http
      • file
        • HttpStaticFileServerHandler.java
      • helloworld
        • HttpHelloWorldServerHandler.java
      • snoop
        • HttpSnoopClientHandler.java
      • upload
        • HttpUploadClientHandler.java
        • HttpUploadServerHandler.java
      • websocketx
        • client
          • WebSocketClientHandler.java
        • html5
          • CustomTextFrameHandler.java
        • server
          • WebSocketServerHandler.java
        • sslserver
          • WebSocketSslServerHandler.java
    • localecho
      • LocalEchoClientHandler.java
    • qotm
      • QuoteOfTheMomentClientHandler.java
      • QuoteOfTheMomentServerHandler.java
    • rxtx
      • RxtxClientHandler.java
    • securechat
      • SecureChatClientHandler.java
      • SecureChatServerHandler.java
    • telnet
      • TelnetClientHandler.java
      • TelnetServerHandler.java
  • testsuite/src/test/java/io/netty/testsuite/transport
    • sctp
      • SctpEchoTest.java
    • socket
      • DatagramMulticastTest.java
      • DatagramUnicastTest.java
      • SocketEchoTest.java
      • SocketFileRegionTest.java
      • SocketFixedLengthEchoTest.java
      • SocketGatheringWriteTest.java
      • SocketShutdownOutputByPeerTest.java
      • SocketShutdownOutputBySelfTest.java
      • SocketSpdyEchoTest.java
      • SocketSslEchoTest.java
      • SocketStartTlsTest.java
      • SocketStringEchoTest.java
    • udt
      • UDTClientServerConnectionTest.java
  • transport/src
    • main/java/io/netty
      • bootstrap
        • ServerBootstrap.java
      • channel
        • ChannelInboundConsumingHandler.java
        • ChannelInboundHandlerAdapter.java
        • SimpleChannelInboundHandler.java
    • test/java/io/netty/channel/local
      • LocalChannelTest.java

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketClientProtocolHandshakeHandler.java
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ public void operationComplete(ChannelFuture future) throws Exception {
4848
protected void messageReceived(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception {
4949
if (!handshaker.isHandshakeComplete()) {
5050
handshaker.finishHandshake(ctx.channel(), msg);
51-
msg.release();
5251
ctx.fireUserEventTriggered(
5352
WebSocketClientProtocolHandler.ClientHandshakeStateEvent.HANDSHAKE_COMPLETE);
5453
ctx.pipeline().remove(this);
Collapse file

‎codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java‎

Copy file name to clipboardExpand all lines: codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandler.java
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import io.netty.channel.ChannelHandler;
2121
import io.netty.channel.ChannelHandlerContext;
2222
import io.netty.channel.ChannelInboundHandler;
23-
import io.netty.channel.ChannelInboundHandlerAdapter;
2423
import io.netty.channel.ChannelPipeline;
2524
import io.netty.channel.MessageList;
2625
import io.netty.channel.SimpleChannelInboundHandler;
@@ -125,7 +124,6 @@ static ChannelHandler forbiddenHttpRequestResponder() {
125124
return new SimpleChannelInboundHandler<FullHttpRequest>() {
126125
@Override
127126
protected void messageReceived(ChannelHandlerContext ctx, FullHttpRequest msg) throws Exception {
128-
msg.release();
129127
FullHttpResponse response =
130128
new DefaultFullHttpResponse(HTTP_1_1, HttpResponseStatus.FORBIDDEN);
131129
ctx.channel().write(response);
Collapse file

‎codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java‎

Copy file name to clipboardExpand all lines: codec-http/src/test/java/io/netty/handler/codec/http/websocketx/WebSocketServerProtocolHandlerTest.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717

1818
import io.netty.channel.ChannelHandler;
1919
import io.netty.channel.ChannelHandlerContext;
20-
import io.netty.channel.ChannelInboundConsumingHandler;
2120
import io.netty.channel.ChannelOutboundHandlerAdapter;
2221
import io.netty.channel.ChannelPromise;
2322
import io.netty.channel.MessageList;
23+
import io.netty.channel.SimpleChannelInboundHandler;
2424
import io.netty.channel.embedded.EmbeddedChannel;
2525
import io.netty.handler.codec.http.DefaultFullHttpRequest;
2626
import io.netty.handler.codec.http.FullHttpRequest;
@@ -156,11 +156,11 @@ public void write(ChannelHandlerContext ctx, MessageList<Object> msgs, ChannelPr
156156
}
157157
}
158158

159-
private static class CustomTextFrameHandler extends ChannelInboundConsumingHandler<TextWebSocketFrame> {
159+
private static class CustomTextFrameHandler extends SimpleChannelInboundHandler<TextWebSocketFrame> {
160160
private String content;
161161

162162
@Override
163-
public void consume(ChannelHandlerContext ctx, TextWebSocketFrame msg) throws Exception {
163+
public void messageReceived(ChannelHandlerContext ctx, TextWebSocketFrame msg) throws Exception {
164164
assertNull(content);
165165
content = "processed: " + msg.text();
166166
}
Collapse file

‎example/src/main/java/io/netty/example/applet/AppletDiscardServer.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/applet/AppletDiscardServer.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import io.netty.buffer.ByteBuf;
2020
import io.netty.channel.ChannelFuture;
2121
import io.netty.channel.ChannelHandlerContext;
22-
import io.netty.channel.ChannelInboundConsumingHandler;
2322
import io.netty.channel.ChannelInitializer;
2423
import io.netty.channel.EventLoopGroup;
24+
import io.netty.channel.SimpleChannelInboundHandler;
2525
import io.netty.channel.nio.NioEventLoopGroup;
2626
import io.netty.channel.socket.SocketChannel;
2727
import io.netty.channel.socket.nio.NioServerSocketChannel;
@@ -72,10 +72,10 @@ public void destroy() {
7272
}
7373
}
7474

75-
private static final class DiscardServerHandler extends ChannelInboundConsumingHandler<ByteBuf> {
75+
private static final class DiscardServerHandler extends SimpleChannelInboundHandler<ByteBuf> {
7676

7777
@Override
78-
public void consume(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
78+
public void messageReceived(ChannelHandlerContext ctx, ByteBuf msg) throws Exception {
7979
System.out.println("Received: " + msg.toString(CharsetUtil.UTF_8));
8080
}
8181

Collapse file

‎example/src/main/java/io/netty/example/factorial/FactorialClientHandler.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/factorial/FactorialClientHandler.java
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ public void channelActive(ChannelHandlerContext ctx) {
7171
}
7272

7373
@Override
74-
public void messageReceived(
75-
ChannelHandlerContext ctx, final BigInteger msg) {
74+
public void messageReceived(ChannelHandlerContext ctx, final BigInteger msg) {
7675
receivedMessages ++;
7776
if (receivedMessages == count) {
7877
// Offer the answer after closing the connection.
Collapse file

‎example/src/main/java/io/netty/example/filetransfer/FileServer.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/filetransfer/FileServer.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
import io.netty.bootstrap.ServerBootstrap;
1919
import io.netty.channel.ChannelFuture;
2020
import io.netty.channel.ChannelHandlerContext;
21-
import io.netty.channel.ChannelInboundConsumingHandler;
2221
import io.netty.channel.ChannelInitializer;
2322
import io.netty.channel.ChannelOption;
2423
import io.netty.channel.DefaultFileRegion;
2524
import io.netty.channel.EventLoopGroup;
2625
import io.netty.channel.FileRegion;
2726
import io.netty.channel.MessageList;
27+
import io.netty.channel.SimpleChannelInboundHandler;
2828
import io.netty.channel.nio.NioEventLoopGroup;
2929
import io.netty.channel.socket.SocketChannel;
3030
import io.netty.channel.socket.nio.NioServerSocketChannel;
@@ -92,9 +92,9 @@ public static void main(String[] args) throws Exception {
9292
new FileServer(port).run();
9393
}
9494

95-
private static final class FileHandler extends ChannelInboundConsumingHandler<String> {
95+
private static final class FileHandler extends SimpleChannelInboundHandler<String> {
9696
@Override
97-
public void consume(ChannelHandlerContext ctx, String msg) throws Exception {
97+
public void messageReceived(ChannelHandlerContext ctx, String msg) throws Exception {
9898
File file = new File(msg);
9999
if (file.exists()) {
100100
if (!file.isFile()) {
Collapse file

‎example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/http/file/HttpStaticFileServerHandler.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import io.netty.channel.ChannelFuture;
2020
import io.netty.channel.ChannelFutureListener;
2121
import io.netty.channel.ChannelHandlerContext;
22-
import io.netty.channel.ChannelInboundConsumingHandler;
2322
import io.netty.channel.MessageList;
23+
import io.netty.channel.SimpleChannelInboundHandler;
2424
import io.netty.handler.codec.http.DefaultFullHttpResponse;
2525
import io.netty.handler.codec.http.DefaultHttpResponse;
2626
import io.netty.handler.codec.http.FullHttpRequest;
@@ -98,14 +98,14 @@
9898
*
9999
* </pre>
100100
*/
101-
public class HttpStaticFileServerHandler extends ChannelInboundConsumingHandler<FullHttpRequest> {
101+
public class HttpStaticFileServerHandler extends SimpleChannelInboundHandler<FullHttpRequest> {
102102

103103
public static final String HTTP_DATE_FORMAT = "EEE, dd MMM yyyy HH:mm:ss zzz";
104104
public static final String HTTP_DATE_GMT_TIMEZONE = "GMT";
105105
public static final int HTTP_CACHE_SECONDS = 60;
106106

107107
@Override
108-
public void consume(
108+
public void messageReceived(
109109
ChannelHandlerContext ctx, FullHttpRequest request) throws Exception {
110110
if (!request.getDecoderResult().isSuccess()) {
111111
sendError(ctx, BAD_REQUEST);
Collapse file

‎example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServerHandler.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/http/helloworld/HttpHelloWorldServerHandler.java
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
import io.netty.buffer.Unpooled;
2020
import io.netty.channel.ChannelFutureListener;
2121
import io.netty.channel.ChannelHandlerContext;
22-
import io.netty.channel.ChannelInboundConsumingHandler;
2322
import io.netty.channel.MessageList;
23+
import io.netty.channel.SimpleChannelInboundHandler;
2424
import io.netty.handler.codec.http.DefaultFullHttpResponse;
2525
import io.netty.handler.codec.http.FullHttpResponse;
2626
import io.netty.handler.codec.http.HttpRequest;
@@ -31,24 +31,24 @@
3131
import static io.netty.handler.codec.http.HttpResponseStatus.*;
3232
import static io.netty.handler.codec.http.HttpVersion.*;
3333

34-
public class HttpHelloWorldServerHandler extends ChannelInboundConsumingHandler<Object> {
34+
public class HttpHelloWorldServerHandler extends SimpleChannelInboundHandler<Object> {
3535
private static final ByteBuf CONTENT =
3636
Unpooled.unreleasableBuffer(Unpooled.copiedBuffer("Hello World", CharsetUtil.US_ASCII));
3737

3838
private MessageList<Object> out;
3939
@Override
40-
protected void beginConsume(ChannelHandlerContext ctx) {
40+
protected void beginMessageReceived(ChannelHandlerContext ctx) {
4141
out = MessageList.newInstance();
4242
}
4343

4444
@Override
45-
protected void endConsume(ChannelHandlerContext ctx) {
45+
protected void endMessageReceived(ChannelHandlerContext ctx) {
4646
ctx.write(out);
4747
out = null;
4848
}
4949

5050
@Override
51-
public void consume(ChannelHandlerContext ctx, Object msg) throws Exception {
51+
public void messageReceived(ChannelHandlerContext ctx, Object msg) throws Exception {
5252
if (msg instanceof HttpRequest) {
5353
HttpRequest req = (HttpRequest) msg;
5454

Collapse file

‎example/src/main/java/io/netty/example/http/snoop/HttpSnoopClientHandler.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/http/snoop/HttpSnoopClientHandler.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
package io.netty.example.http.snoop;
1717

1818
import io.netty.channel.ChannelHandlerContext;
19-
import io.netty.channel.ChannelInboundConsumingHandler;
19+
import io.netty.channel.SimpleChannelInboundHandler;
2020
import io.netty.handler.codec.http.HttpContent;
2121
import io.netty.handler.codec.http.HttpHeaders;
2222
import io.netty.handler.codec.http.HttpObject;
2323
import io.netty.handler.codec.http.HttpResponse;
2424
import io.netty.handler.codec.http.LastHttpContent;
2525
import io.netty.util.CharsetUtil;
2626

27-
public class HttpSnoopClientHandler extends ChannelInboundConsumingHandler<HttpObject> {
27+
public class HttpSnoopClientHandler extends SimpleChannelInboundHandler<HttpObject> {
2828

2929
@Override
30-
public void consume(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
30+
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
3131
if (msg instanceof HttpResponse) {
3232
HttpResponse response = (HttpResponse) msg;
3333

Collapse file

‎example/src/main/java/io/netty/example/http/upload/HttpUploadClientHandler.java‎

Copy file name to clipboardExpand all lines: example/src/main/java/io/netty/example/http/upload/HttpUploadClientHandler.java
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package io.netty.example.http.upload;
1717

1818
import io.netty.channel.ChannelHandlerContext;
19-
import io.netty.channel.ChannelInboundConsumingHandler;
19+
import io.netty.channel.SimpleChannelInboundHandler;
2020
import io.netty.handler.codec.http.HttpContent;
2121
import io.netty.handler.codec.http.HttpHeaders;
2222
import io.netty.handler.codec.http.HttpObject;
@@ -29,14 +29,14 @@
2929
/**
3030
* Handler that just dumps the contents of the response from the server
3131
*/
32-
public class HttpUploadClientHandler extends ChannelInboundConsumingHandler<HttpObject> {
32+
public class HttpUploadClientHandler extends SimpleChannelInboundHandler<HttpObject> {
3333

3434
private static final Logger logger = Logger.getLogger(HttpUploadClientHandler.class.getName());
3535

3636
private boolean readingChunks;
3737

3838
@Override
39-
public void consume(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
39+
public void messageReceived(ChannelHandlerContext ctx, HttpObject msg) throws Exception {
4040
if (msg instanceof HttpResponse) {
4141
HttpResponse response = (HttpResponse) msg;
4242

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.