Home / Function/ EmbeddedChannel() — netty Function Reference

EmbeddedChannel() — netty Function Reference

Architecture documentation for the EmbeddedChannel() function in CompressorHttp2ConnectionEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ad5be4b8_f500_4d94_8f0a_49015942574d["EmbeddedChannel()"]
  8d787c1c_5f3d_4d80_1537_18462b224aaf["CompressorHttp2ConnectionEncoder"]
  ad5be4b8_f500_4d94_8f0a_49015942574d -->|defined in| 8d787c1c_5f3d_4d80_1537_18462b224aaf
  style ad5be4b8_f500_4d94_8f0a_49015942574d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/CompressorHttp2ConnectionEncoder.java lines 285–321

    protected EmbeddedChannel newContentCompressor(ChannelHandlerContext ctx, CharSequence contentEncoding)
            throws Http2Exception {
        if (GZIP.contentEqualsIgnoreCase(contentEncoding) || X_GZIP.contentEqualsIgnoreCase(contentEncoding)) {
            return newCompressionChannel(ctx, ZlibWrapper.GZIP);
        }
        if (DEFLATE.contentEqualsIgnoreCase(contentEncoding) || X_DEFLATE.contentEqualsIgnoreCase(contentEncoding)) {
            return newCompressionChannel(ctx, ZlibWrapper.ZLIB);
        }
        Channel channel = ctx.channel();
        if (Brotli.isAvailable() && brotliOptions != null && BR.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new BrotliEncoder(brotliOptions.parameters()))
                    .build();
        }
        if (zstdOptions != null && ZSTD.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new ZstdEncoder(zstdOptions.compressionLevel(),
                            zstdOptions.blockSize(), zstdOptions.maxEncodeSize()))
                    .build();
        }
        if (snappyOptions != null && SNAPPY.contentEqualsIgnoreCase(contentEncoding)) {
            return EmbeddedChannel.builder()
                    .channelId(channel.id())
                    .hasDisconnect(channel.metadata().hasDisconnect())
                    .config(channel.config())
                    .handlers(new SnappyFrameEncoder())
                    .build();
        }
        // 'identity' or unsupported
        return null;
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free