Home / Function/ mask0() — netty Function Reference

mask0() — netty Function Reference

Architecture documentation for the mask0() function in ChannelHandlerMask.java from the netty codebase.

Function java Buffer Search calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  415dced0_768d_3ef9_f5b5_dd95ec9f9f3d["mask0()"]
  9765d8d3_2fc6_fd23_4e23_eee14183479c["ChannelHandlerMask"]
  415dced0_768d_3ef9_f5b5_dd95ec9f9f3d -->|defined in| 9765d8d3_2fc6_fd23_4e23_eee14183479c
  5ab977f0_bc02_5db9_4f8e_9d790c9251f9["mask()"]
  5ab977f0_bc02_5db9_4f8e_9d790c9251f9 -->|calls| 415dced0_768d_3ef9_f5b5_dd95ec9f9f3d
  556154cc_4114_03bb_0590_52da3f0b5cc0["isSkippable()"]
  415dced0_768d_3ef9_f5b5_dd95ec9f9f3d -->|calls| 556154cc_4114_03bb_0590_52da3f0b5cc0
  style 415dced0_768d_3ef9_f5b5_dd95ec9f9f3d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/ChannelHandlerMask.java lines 91–164

    private static int mask0(Class<? extends ChannelHandler> handlerType) {
        int mask = MASK_EXCEPTION_CAUGHT;
        try {
            if (ChannelInboundHandler.class.isAssignableFrom(handlerType)) {
                mask |= MASK_ALL_INBOUND;

                if (isSkippable(handlerType, "channelRegistered", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_REGISTERED;
                }
                if (isSkippable(handlerType, "channelUnregistered", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_UNREGISTERED;
                }
                if (isSkippable(handlerType, "channelActive", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_ACTIVE;
                }
                if (isSkippable(handlerType, "channelInactive", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_INACTIVE;
                }
                if (isSkippable(handlerType, "channelRead", ChannelHandlerContext.class, Object.class)) {
                    mask &= ~MASK_CHANNEL_READ;
                }
                if (isSkippable(handlerType, "channelReadComplete", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_READ_COMPLETE;
                }
                if (isSkippable(handlerType, "channelWritabilityChanged", ChannelHandlerContext.class)) {
                    mask &= ~MASK_CHANNEL_WRITABILITY_CHANGED;
                }
                if (isSkippable(handlerType, "userEventTriggered", ChannelHandlerContext.class, Object.class)) {
                    mask &= ~MASK_USER_EVENT_TRIGGERED;
                }
            }

            if (ChannelOutboundHandler.class.isAssignableFrom(handlerType)) {
                mask |= MASK_ALL_OUTBOUND;

                if (isSkippable(handlerType, "bind", ChannelHandlerContext.class,
                        SocketAddress.class, ChannelPromise.class)) {
                    mask &= ~MASK_BIND;
                }
                if (isSkippable(handlerType, "connect", ChannelHandlerContext.class, SocketAddress.class,
                        SocketAddress.class, ChannelPromise.class)) {
                    mask &= ~MASK_CONNECT;
                }
                if (isSkippable(handlerType, "disconnect", ChannelHandlerContext.class, ChannelPromise.class)) {
                    mask &= ~MASK_DISCONNECT;
                }
                if (isSkippable(handlerType, "close", ChannelHandlerContext.class, ChannelPromise.class)) {
                    mask &= ~MASK_CLOSE;
                }
                if (isSkippable(handlerType, "deregister", ChannelHandlerContext.class, ChannelPromise.class)) {
                    mask &= ~MASK_DEREGISTER;
                }
                if (isSkippable(handlerType, "read", ChannelHandlerContext.class)) {
                    mask &= ~MASK_READ;
                }
                if (isSkippable(handlerType, "write", ChannelHandlerContext.class,
                        Object.class, ChannelPromise.class)) {
                    mask &= ~MASK_WRITE;
                }
                if (isSkippable(handlerType, "flush", ChannelHandlerContext.class)) {
                    mask &= ~MASK_FLUSH;
                }
            }

            if (isSkippable(handlerType, "exceptionCaught", ChannelHandlerContext.class, Throwable.class)) {
                mask &= ~MASK_EXCEPTION_CAUGHT;
            }
        } catch (Exception e) {
            // Should never reach here.
            PlatformDependent.throwException(e);
        }

        return mask;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does mask0() do?
mask0() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/ChannelHandlerMask.java.
Where is mask0() defined?
mask0() is defined in transport/src/main/java/io/netty/channel/ChannelHandlerMask.java at line 91.
What does mask0() call?
mask0() calls 1 function(s): isSkippable.
What calls mask0()?
mask0() is called by 1 function(s): mask.

Analyze Your Own Codebase

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

Try Supermodel Free