Home / Class/ ObservableChannel Class — netty Architecture

ObservableChannel Class — netty Architecture

Architecture documentation for the ObservableChannel class in IdleStateHandlerTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  9873eaef_5107_e984_9681_bde558527770["ObservableChannel"]
  b59afc75_3039_0a17_e1e6_3e9ae434e05b["IdleStateHandlerTest.java"]
  9873eaef_5107_e984_9681_bde558527770 -->|defined in| b59afc75_3039_0a17_e1e6_3e9ae434e05b
  debc1f58_1548_0245_2304_17ee9f9d6b51["ObservableChannel()"]
  9873eaef_5107_e984_9681_bde558527770 -->|method| debc1f58_1548_0245_2304_17ee9f9d6b51
  726c6cc9_8149_8a64_fb9b_92b23935b38f["doWrite()"]
  9873eaef_5107_e984_9681_bde558527770 -->|method| 726c6cc9_8149_8a64_fb9b_92b23935b38f
  1c6cfd6e_68ac_43f0_9b0f_bda9125ba73f["Object()"]
  9873eaef_5107_e984_9681_bde558527770 -->|method| 1c6cfd6e_68ac_43f0_9b0f_bda9125ba73f

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java lines 375–418

    private static class ObservableChannel extends EmbeddedChannel {

        ObservableChannel(ChannelHandler... handlers) {
            super(handlers);
        }

        @Override
        protected void doWrite(ChannelOutboundBuffer in) throws Exception {
            // Overridden to change EmbeddedChannel's default behavior. We went to keep
            // the messages in the ChannelOutboundBuffer.
        }

        private Object consume() {
            ChannelOutboundBuffer buf = unsafe().outboundBuffer();
            if (buf != null) {
                Object msg = buf.current();
                if (msg != null) {
                    ReferenceCountUtil.retain(msg);
                    buf.remove();
                    return msg;
                }
            }
            return null;
        }

        /**
         * Consume the part of a message.
         *
         * @param byteCount count of byte to be consumed
         * @return the message currently being consumed
         */
        private Object consumePart(int byteCount) {
            ChannelOutboundBuffer buf = unsafe().outboundBuffer();
            if (buf != null) {
                Object msg = buf.current();
                if (msg != null) {
                    ReferenceCountUtil.retain(msg);
                    buf.removeBytes(byteCount);
                    return msg;
                }
            }
            return null;
        }
    }

Frequently Asked Questions

What is the ObservableChannel class?
ObservableChannel is a class in the netty codebase, defined in handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java.
Where is ObservableChannel defined?
ObservableChannel is defined in handler/src/test/java/io/netty/handler/timeout/IdleStateHandlerTest.java at line 375.

Analyze Your Own Codebase

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

Try Supermodel Free