Home / Function/ ChannelHandlerContext() — netty Function Reference

ChannelHandlerContext() — netty Function Reference

Architecture documentation for the ChannelHandlerContext() function in AbstractChannelHandlerContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7["ChannelHandlerContext()"]
  219fdd98_e8e7_d4f7_fea0_eba60352e3de["AbstractChannelHandlerContext"]
  9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7 -->|defined in| 219fdd98_e8e7_d4f7_fea0_eba60352e3de
  a25e13ec_7335_7e25_fe83_5b41ffe22020["invokeHandler()"]
  9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7 -->|calls| a25e13ec_7335_7e25_fe83_5b41ffe22020
  30046b18_f2a1_3cc6_01ab_3f4741be5605["invokeExceptionCaught()"]
  9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7 -->|calls| 30046b18_f2a1_3cc6_01ab_3f4741be5605
  bca24481_45c3_570f_6222_6dfa6c8db7ea["safeExecute()"]
  9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7 -->|calls| bca24481_45c3_570f_6222_6dfa6c8db7ea
  style 9c9ad831_2d8b_b01e_bd08_eb0bcb8e44d7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java lines 147–175

    @Override
    public ChannelHandlerContext fireChannelRegistered() {
        AbstractChannelHandlerContext next = findContextInbound(MASK_CHANNEL_REGISTERED);
        if (next.executor().inEventLoop()) {
            if (next.invokeHandler()) {
                try {
                    // DON'T CHANGE
                    // Duplex handlers implements both out/in interfaces causing a scalability issue
                    // see https://bugs.openjdk.org/browse/JDK-8180450
                    final ChannelHandler handler = next.handler();
                    final DefaultChannelPipeline.HeadContext headContext = pipeline.head;
                    if (handler == headContext) {
                        headContext.channelRegistered(next);
                    } else if (handler instanceof ChannelInboundHandlerAdapter) {
                        ((ChannelInboundHandlerAdapter) handler).channelRegistered(next);
                    } else {
                        ((ChannelInboundHandler) handler).channelRegistered(next);
                    }
                } catch (Throwable t) {
                    next.invokeExceptionCaught(t);
                }
            } else {
                next.fireChannelRegistered();
            }
        } else {
            next.executor().execute(this::fireChannelRegistered);
        }
        return this;
    }

Domain

Subdomains

Frequently Asked Questions

What does ChannelHandlerContext() do?
ChannelHandlerContext() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java.
Where is ChannelHandlerContext() defined?
ChannelHandlerContext() is defined in transport/src/main/java/io/netty/channel/AbstractChannelHandlerContext.java at line 147.
What does ChannelHandlerContext() call?
ChannelHandlerContext() calls 3 function(s): invokeExceptionCaught, invokeHandler, safeExecute.

Analyze Your Own Codebase

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

Try Supermodel Free