Home / Function/ configureClearText() — netty Function Reference

configureClearText() — netty Function Reference

Architecture documentation for the configureClearText() function in Http2ServerInitializer.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ff5434ae_5e83_dcce_c429_4ca26fd0e5ff["configureClearText()"]
  63df27d4_bc92_57a6_45eb_a37a451ae596["Http2ServerInitializer"]
  ff5434ae_5e83_dcce_c429_4ca26fd0e5ff -->|defined in| 63df27d4_bc92_57a6_45eb_a37a451ae596
  10bc5522_88f6_71e4_54f2_a0853d202000["initChannel()"]
  10bc5522_88f6_71e4_54f2_a0853d202000 -->|calls| ff5434ae_5e83_dcce_c429_4ca26fd0e5ff
  style ff5434ae_5e83_dcce_c429_4ca26fd0e5ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java lines 75–98

    private void configureClearText(SocketChannel ch) {
        final ChannelPipeline p = ch.pipeline();
        final HttpServerCodec sourceCodec = new HttpServerCodec();
        final HttpServerUpgradeHandler upgradeHandler = new HttpServerUpgradeHandler(sourceCodec, upgradeCodecFactory);
        final CleartextHttp2ServerUpgradeHandler cleartextHttp2ServerUpgradeHandler =
                new CleartextHttp2ServerUpgradeHandler(sourceCodec, upgradeHandler,
                                                       new HelloWorldHttp2HandlerBuilder().build());

        p.addLast(cleartextHttp2ServerUpgradeHandler);
        p.addLast(new SimpleChannelInboundHandler<HttpMessage>() {
            @Override
            protected void channelRead0(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();
                ChannelHandlerContext thisCtx = pipeline.context(this);
                pipeline.addAfter(thisCtx.name(), null, new HelloWorldHttp1Handler("Direct. No Upgrade Attempted."));
                pipeline.replace(this, null, new HttpObjectAggregator(maxHttpContentLength));
                ctx.fireChannelRead(ReferenceCountUtil.retain(msg));
            }
        });

        p.addLast(new UserEventLogger());
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does configureClearText() do?
configureClearText() is a function in the netty codebase, defined in testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java.
Where is configureClearText() defined?
configureClearText() is defined in testsuite-http2/src/main/java/io/netty/testsuite/http2/Http2ServerInitializer.java at line 75.
What calls configureClearText()?
configureClearText() is called by 1 function(s): initChannel.

Analyze Your Own Codebase

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

Try Supermodel Free