Home / Type/ ChannelHandlerContext Type — netty Architecture

ChannelHandlerContext Type — netty Architecture

Architecture documentation for the ChannelHandlerContext type/interface in ChannelHandlerContext.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  3d444eba_c7d1_6f00_398f_cc14f6abe439["ChannelHandlerContext"]
  d419db64_69bf_8d1a_11cf_2ff61c3018b0["ChannelHandlerContext.java"]
  3d444eba_c7d1_6f00_398f_cc14f6abe439 -->|defined in| d419db64_69bf_8d1a_11cf_2ff61c3018b0
  style 3d444eba_c7d1_6f00_398f_cc14f6abe439 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelHandlerContext.java lines 87–174

public interface ChannelHandlerContext extends AttributeMap, ChannelInboundInvoker, ChannelOutboundInvoker {

    /**
     * Return the {@link Channel} which is bound to the {@link ChannelHandlerContext}.
     */
    Channel channel();

    /**
     * Returns the {@link EventExecutor} which is used to execute an arbitrary task.
     */
    EventExecutor executor();

    /**
     * The unique name of the {@link ChannelHandlerContext}.The name was used when then {@link ChannelHandler}
     * was added to the {@link ChannelPipeline}. This name can also be used to access the registered
     * {@link ChannelHandler} from the {@link ChannelPipeline}.
     */
    String name();

    /**
     * The {@link ChannelHandler} that is bound this {@link ChannelHandlerContext}.
     */
    ChannelHandler handler();

    /**
     * Return {@code true} if the {@link ChannelHandler} which belongs to this context was removed
     * from the {@link ChannelPipeline}. Note that this method is only meant to be called from with in the
     * {@link EventLoop}.
     */
    boolean isRemoved();

    @Override
    ChannelHandlerContext fireChannelRegistered();

    @Override
    ChannelHandlerContext fireChannelUnregistered();

    @Override
    ChannelHandlerContext fireChannelActive();

    @Override
    ChannelHandlerContext fireChannelInactive();

    @Override
    ChannelHandlerContext fireExceptionCaught(Throwable cause);

    @Override
    ChannelHandlerContext fireUserEventTriggered(Object evt);

    @Override
    ChannelHandlerContext fireChannelRead(Object msg);

    @Override
    ChannelHandlerContext fireChannelReadComplete();

    @Override
    ChannelHandlerContext fireChannelWritabilityChanged();

    @Override
    ChannelHandlerContext read();

    @Override
    ChannelHandlerContext flush();

    /**
     * Return the assigned {@link ChannelPipeline}
     */
    ChannelPipeline pipeline();

    /**
     * Return the assigned {@link ByteBufAllocator} which will be used to allocate {@link ByteBuf}s.
     */
    ByteBufAllocator alloc();

    /**
     * @deprecated Use {@link Channel#attr(AttributeKey)}
     */
    @Deprecated
    @Override
    <T> Attribute<T> attr(AttributeKey<T> key);

Frequently Asked Questions

What is the ChannelHandlerContext type?
ChannelHandlerContext is a type/interface in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelHandlerContext.java.
Where is ChannelHandlerContext defined?
ChannelHandlerContext is defined in transport/src/main/java/io/netty/channel/ChannelHandlerContext.java at line 87.

Analyze Your Own Codebase

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

Try Supermodel Free