Home / Function/ upgradeTo() — netty Function Reference

upgradeTo() — netty Function Reference

Architecture documentation for the upgradeTo() function in Http2ServerUpgradeCodec.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  59d2ef2e_aa4e_5acf_1d4f_f8f8f720e695["upgradeTo()"]
  c35ffca0_c07b_0afb_4806_c07fa100b346["Http2ServerUpgradeCodec"]
  59d2ef2e_aa4e_5acf_1d4f_f8f8f720e695 -->|defined in| c35ffca0_c07b_0afb_4806_c07fa100b346
  style 59d2ef2e_aa4e_5acf_1d4f_f8f8f720e695 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java lines 142–161

    @Override
    public void upgradeTo(final ChannelHandlerContext ctx, FullHttpRequest upgradeRequest) {
        try {
            // Add the HTTP/2 connection handler to the pipeline immediately following the current handler.
            ctx.pipeline().addAfter(ctx.name(), handlerName, connectionHandler);

            // Add also all extra handlers as these may handle events / messages produced by the connectionHandler.
            // See https://github.com/netty/netty/issues/9314
            if (handlers != null) {
                final String name = ctx.pipeline().context(connectionHandler).name();
                for (int i = handlers.length - 1; i >= 0; i--) {
                    ctx.pipeline().addAfter(name, null, handlers[i]);
                }
            }
            connectionHandler.onHttpServerUpgrade(settings);
        } catch (Http2Exception e) {
            ctx.fireExceptionCaught(e);
            ctx.close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does upgradeTo() do?
upgradeTo() is a function in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java.
Where is upgradeTo() defined?
upgradeTo() is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ServerUpgradeCodec.java at line 142.

Analyze Your Own Codebase

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

Try Supermodel Free