Home / Class/ SpdyEchoTestServerHandler Class — netty Architecture

SpdyEchoTestServerHandler Class — netty Architecture

Architecture documentation for the SpdyEchoTestServerHandler class in SocketSpdyEchoTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de["SpdyEchoTestServerHandler"]
  9d0e1508_0ea8_c1d9_8c6d_ac1e2e7350e6["SocketSpdyEchoTest.java"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|defined in| 9d0e1508_0ea8_c1d9_8c6d_ac1e2e7350e6
  2bec8de1_5425_3daa_7620_93e46bb1238e["SpdyEchoTestServerHandler()"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|method| 2bec8de1_5425_3daa_7620_93e46bb1238e
  c8e5a7f9_3ebf_9c1e_06b5_070c4c42bdd6["channelActive()"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|method| c8e5a7f9_3ebf_9c1e_06b5_070c4c42bdd6
  be2be1a5_cbd0_3796_280a_ddf223331bcb["channelRead()"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|method| be2be1a5_cbd0_3796_280a_ddf223331bcb
  6dc6b187_e05f_ceac_4069_9a9f3feff750["channelReadComplete()"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|method| 6dc6b187_e05f_ceac_4069_9a9f3feff750
  34210bcc_6ca0_7798_55bc_dcc668becd2f["exceptionCaught()"]
  5ec40c34_8d5c_78f5_faae_88d1b1b5c3de -->|method| 34210bcc_6ca0_7798_55bc_dcc668becd2f

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSpdyEchoTest.java lines 240–277

    private static class SpdyEchoTestServerHandler extends ChannelInboundHandlerAdapter {
        private final boolean autoRead;
        final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();

        SpdyEchoTestServerHandler(boolean autoRead) {
            this.autoRead = autoRead;
        }

        @Override
        public void channelActive(ChannelHandlerContext ctx) throws Exception {
            if (!autoRead) {
                ctx.read();
            }
        }

        @Override
        public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
            ctx.write(msg);
        }

        @Override
        public void channelReadComplete(ChannelHandlerContext ctx) throws Exception {
            try {
                ctx.flush();
            } finally {
                if (!autoRead) {
                    ctx.read();
                }
            }
        }

        @Override
        public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
            if (exception.compareAndSet(null, cause)) {
                ctx.close();
            }
        }
    }

Frequently Asked Questions

What is the SpdyEchoTestServerHandler class?
SpdyEchoTestServerHandler is a class in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSpdyEchoTest.java.
Where is SpdyEchoTestServerHandler defined?
SpdyEchoTestServerHandler is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketSpdyEchoTest.java at line 240.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free