Home / Class/ OutboundCalledHandler Class — netty Architecture

OutboundCalledHandler Class — netty Architecture

Architecture documentation for the OutboundCalledHandler class in DefaultChannelPipelineTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2295daae_3259_4418_81d2_db2b9b8e93a7["OutboundCalledHandler"]
  ded22145_bbcf_15a1_69b7_30cac8d4be02["DefaultChannelPipelineTest.java"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|defined in| ded22145_bbcf_15a1_69b7_30cac8d4be02
  83a4e715_d75d_2f81_91d1_4d87826b7266["handlerAdded()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 83a4e715_d75d_2f81_91d1_4d87826b7266
  c6e9bc92_2cf1_18a0_0891_d00d0ba7d85e["handlerRemoved()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| c6e9bc92_2cf1_18a0_0891_d00d0ba7d85e
  c5b1de85_d95d_3c1e_9030_4dd9d2b98ecf["bind()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| c5b1de85_d95d_3c1e_9030_4dd9d2b98ecf
  9f770434_3932_8df1_2654_cf441ae70b32["connect()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 9f770434_3932_8df1_2654_cf441ae70b32
  65a8d695_94c6_e275_0d34_a046833cb923["disconnect()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 65a8d695_94c6_e275_0d34_a046833cb923
  0734e696_bf2a_45af_707c_9731756d1f7d["close()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 0734e696_bf2a_45af_707c_9731756d1f7d
  2a755a4a_592b_4884_97d8_3106d317dca2["deregister()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 2a755a4a_592b_4884_97d8_3106d317dca2
  d911e642_9ff1_e072_cd6f_2a1aff16b9c3["read()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| d911e642_9ff1_e072_cd6f_2a1aff16b9c3
  f313e85c_6c9f_50a8_2cca_e64e9585a7ce["write()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| f313e85c_6c9f_50a8_2cca_e64e9585a7ce
  81474b82_2ee1_c89a_4632_f7e06e5f8c52["flush()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 81474b82_2ee1_c89a_4632_f7e06e5f8c52
  97815560_6649_550d_7d2a_7d037ec8648b["assertCalled()"]
  2295daae_3259_4418_81d2_db2b9b8e93a7 -->|method| 97815560_6649_550d_7d2a_7d037ec8648b

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 1861–1948

        final class OutboundCalledHandler extends ChannelOutboundHandlerAdapter {
            private static final int MASK_BIND = 1;
            private static final int MASK_CONNECT = 1 << 1;
            private static final int MASK_DISCONNECT = 1 << 2;
            private static final int MASK_CLOSE = 1 << 3;
            private static final int MASK_DEREGISTER = 1 << 4;
            private static final int MASK_READ = 1 << 5;
            private static final int MASK_WRITE = 1 << 6;
            private static final int MASK_FLUSH = 1 << 7;
            private static final int MASK_ADDED = 1 << 8;
            private static final int MASK_REMOVED = 1 << 9;

            private int executionMask;

            @Override
            public void handlerAdded(ChannelHandlerContext ctx) {
                executionMask |= MASK_ADDED;
            }

            @Override
            public void handlerRemoved(ChannelHandlerContext ctx) {
                executionMask |= MASK_REMOVED;
            }

            @Override
            public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) {
                executionMask |= MASK_BIND;
                promise.setSuccess();
            }

            @Override
            public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress,
                                SocketAddress localAddress, ChannelPromise promise) {
                executionMask |= MASK_CONNECT;
                promise.setSuccess();
            }

            @Override
            public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) {
                executionMask |= MASK_DISCONNECT;
                promise.setSuccess();
            }

            @Override
            public void close(ChannelHandlerContext ctx, ChannelPromise promise) {
                executionMask |= MASK_CLOSE;
                promise.setSuccess();
            }

            @Override
            public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) {
                executionMask |= MASK_DEREGISTER;
                promise.setSuccess();
            }

            @Override
            public void read(ChannelHandlerContext ctx) {
                executionMask |= MASK_READ;
            }

            @Override
            public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) {
                executionMask |= MASK_WRITE;
                promise.setSuccess();
            }

            @Override
            public void flush(ChannelHandlerContext ctx) {
                executionMask |= MASK_FLUSH;
            }

            void assertCalled() {
                assertCalled("handlerAdded", MASK_ADDED);
                assertCalled("handlerRemoved", MASK_REMOVED);
                assertCalled("bind", MASK_BIND);
                assertCalled("connect", MASK_CONNECT);
                assertCalled("disconnect", MASK_DISCONNECT);
                assertCalled("close", MASK_CLOSE);
                assertCalled("deregister", MASK_DEREGISTER);
                assertCalled("read", MASK_READ);
                assertCalled("write", MASK_WRITE);

Frequently Asked Questions

What is the OutboundCalledHandler class?
OutboundCalledHandler is a class in the netty codebase, defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java.
Where is OutboundCalledHandler defined?
OutboundCalledHandler is defined in transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java at line 1861.

Analyze Your Own Codebase

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

Try Supermodel Free