Home / Class/ CheckOrderHandler Class — netty Architecture

CheckOrderHandler Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  98864a3c_e0b8_49b8_63fc_89f392c1726d["CheckOrderHandler"]
  ded22145_bbcf_15a1_69b7_30cac8d4be02["DefaultChannelPipelineTest.java"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|defined in| ded22145_bbcf_15a1_69b7_30cac8d4be02
  619c7d68_f7f8_be9e_2a99_4ccb84dad111["CheckOrderHandler()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| 619c7d68_f7f8_be9e_2a99_4ccb84dad111
  ace82855_f4cf_3d21_c6c6_52a28cfe74a8["handlerAdded()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| ace82855_f4cf_3d21_c6c6_52a28cfe74a8
  41fe3d1a_3ec5_bc37_5ade_9a4a01b03617["handlerRemoved()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| 41fe3d1a_3ec5_bc37_5ade_9a4a01b03617
  15181a20_10b0_ed1d_ba2d_b7b6fd63f770["exceptionCaught()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| 15181a20_10b0_ed1d_ba2d_b7b6fd63f770
  9656838b_d1e0_65d2_7ed3_ac7e8818cba8["checkError()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| 9656838b_d1e0_65d2_7ed3_ac7e8818cba8
  17e826db_5986_71a8_25b1_b2b294996113["checkExecutor()"]
  98864a3c_e0b8_49b8_63fc_89f392c1726d -->|method| 17e826db_5986_71a8_25b1_b2b294996113

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/DefaultChannelPipelineTest.java lines 2314–2353

    private static final class CheckOrderHandler extends ChannelHandlerAdapter {
        private final Queue<CheckOrderHandler> addedQueue;
        private final Queue<CheckOrderHandler> removedQueue;
        private final AtomicReference<Throwable> error = new AtomicReference<Throwable>();

        CheckOrderHandler(Queue<CheckOrderHandler> addedQueue, Queue<CheckOrderHandler> removedQueue) {
            this.addedQueue = addedQueue;
            this.removedQueue = removedQueue;
        }

        @Override
        public void handlerAdded(ChannelHandlerContext ctx) throws Exception {
            addedQueue.add(this);
            checkExecutor(ctx);
        }

        @Override
        public void handlerRemoved(ChannelHandlerContext ctx) {
            removedQueue.add(this);
            checkExecutor(ctx);
        }

        @Override
        public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
            error.set(cause);
        }

        void checkError() throws Throwable {
            Throwable cause = error.get();
            if (cause != null) {
                throw cause;
            }
        }

        private void checkExecutor(ChannelHandlerContext ctx) {
            if (!ctx.executor().inEventLoop()) {
                error.set(new AssertionError());
            }
        }
    }

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free