Home / Class/ FrameCountDown Class — netty Architecture

FrameCountDown Class — netty Architecture

Architecture documentation for the FrameCountDown class in Http2TestUtil.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2feb2175_1019_fd99_d93d_493bbaef7447["FrameCountDown"]
  945883ee_c685_faa4_5503_879b96c1a6d1["Http2TestUtil.java"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|defined in| 945883ee_c685_faa4_5503_879b96c1a6d1
  82717c6c_a12c_b638_2253_88128a702d4d["FrameCountDown()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 82717c6c_a12c_b638_2253_88128a702d4d
  6c3b4f4a_8289_d9d2_c382_f215f872b4b0["onDataRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 6c3b4f4a_8289_d9d2_c382_f215f872b4b0
  fc842353_837c_302f_0ac9_c691078acc5b["onHeadersRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| fc842353_837c_302f_0ac9_c691078acc5b
  f14b9862_c733_d95f_063f_2326e2dbd1b0["onPriorityRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| f14b9862_c733_d95f_063f_2326e2dbd1b0
  2355f1b3_26bd_f4de_540a_0cb1d100fb4b["onRstStreamRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 2355f1b3_26bd_f4de_540a_0cb1d100fb4b
  4c19ad33_401f_4a39_9263_5cb3ad9cb933["onSettingsAckRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 4c19ad33_401f_4a39_9263_5cb3ad9cb933
  3d6e6009_7f67_333c_f702_449fd7b2f46b["onSettingsRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 3d6e6009_7f67_333c_f702_449fd7b2f46b
  7fa4d481_c009_bd90_7b2c_390d60c53936["onPingRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 7fa4d481_c009_bd90_7b2c_390d60c53936
  7619de9f_b9da_e212_1c8e_f741c66e215c["onPingAckRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| 7619de9f_b9da_e212_1c8e_f741c66e215c
  e0f17436_e9f9_3ffe_bca4_b592f36c5feb["onPushPromiseRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| e0f17436_e9f9_3ffe_bca4_b592f36c5feb
  ffa43b18_9c43_6edf_0065_f51e3f91648a["onGoAwayRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| ffa43b18_9c43_6edf_0065_f51e3f91648a
  a2c1fd39_4a00_33bf_d26f_64e4040e4f7d["onWindowUpdateRead()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| a2c1fd39_4a00_33bf_d26f_64e4040e4f7d
  a0a4c781_7a6a_7720_6c1d_c736fd7a464a["onUnknownFrame()"]
  2feb2175_1019_fd99_d93d_493bbaef7447 -->|method| a0a4c781_7a6a_7720_6c1d_c736fd7a464a

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2TestUtil.java lines 152–273

    static class FrameCountDown implements Http2FrameListener {
        private final Http2FrameListener listener;
        private final CountDownLatch messageLatch;
        private final CountDownLatch settingsAckLatch;
        private final CountDownLatch dataLatch;
        private final CountDownLatch trailersLatch;
        private final CountDownLatch goAwayLatch;

        FrameCountDown(Http2FrameListener listener, CountDownLatch settingsAckLatch, CountDownLatch messageLatch,
                CountDownLatch dataLatch, CountDownLatch trailersLatch) {
            this(listener, settingsAckLatch, messageLatch, dataLatch, trailersLatch, messageLatch);
        }

        FrameCountDown(Http2FrameListener listener, CountDownLatch settingsAckLatch, CountDownLatch messageLatch,
                CountDownLatch dataLatch, CountDownLatch trailersLatch, CountDownLatch goAwayLatch) {
            this.listener = listener;
            this.messageLatch = messageLatch;
            this.settingsAckLatch = settingsAckLatch;
            this.dataLatch = dataLatch;
            this.trailersLatch = trailersLatch;
            this.goAwayLatch = goAwayLatch;
        }

        @Override
        public int onDataRead(ChannelHandlerContext ctx, int streamId, ByteBuf data, int padding, boolean endOfStream)
                throws Http2Exception {
            int numBytes = data.readableBytes();
            int processed = listener.onDataRead(ctx, streamId, data, padding, endOfStream);
            messageLatch.countDown();
            if (dataLatch != null) {
                for (int i = 0; i < numBytes; ++i) {
                    dataLatch.countDown();
                }
            }
            return processed;
        }

        @Override
        public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int padding,
                boolean endStream) throws Http2Exception {
            listener.onHeadersRead(ctx, streamId, headers, padding, endStream);
            messageLatch.countDown();
            if (trailersLatch != null && endStream) {
                trailersLatch.countDown();
            }
        }

        @Override
        public void onHeadersRead(ChannelHandlerContext ctx, int streamId, Http2Headers headers, int streamDependency,
                short weight, boolean exclusive, int padding, boolean endStream) throws Http2Exception {
            listener.onHeadersRead(ctx, streamId, headers, streamDependency, weight, exclusive, padding, endStream);
            messageLatch.countDown();
            if (trailersLatch != null && endStream) {
                trailersLatch.countDown();
            }
        }

        @Override
        public void onPriorityRead(ChannelHandlerContext ctx, int streamId, int streamDependency, short weight,
                boolean exclusive) throws Http2Exception {
            listener.onPriorityRead(ctx, streamId, streamDependency, weight, exclusive);
            messageLatch.countDown();
        }

        @Override
        public void onRstStreamRead(ChannelHandlerContext ctx, int streamId, long errorCode) throws Http2Exception {
            listener.onRstStreamRead(ctx, streamId, errorCode);
            messageLatch.countDown();
        }

        @Override
        public void onSettingsAckRead(ChannelHandlerContext ctx) throws Http2Exception {
            listener.onSettingsAckRead(ctx);
            settingsAckLatch.countDown();
        }

        @Override
        public void onSettingsRead(ChannelHandlerContext ctx, Http2Settings settings) throws Http2Exception {
            listener.onSettingsRead(ctx, settings);
            messageLatch.countDown();
        }

Frequently Asked Questions

What is the FrameCountDown class?
FrameCountDown is a class in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2TestUtil.java.
Where is FrameCountDown defined?
FrameCountDown is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2TestUtil.java at line 152.

Analyze Your Own Codebase

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

Try Supermodel Free