Home / Function/ channelInactiveHappensAfterExceptionCaughtEvents() — netty Function Reference

channelInactiveHappensAfterExceptionCaughtEvents() — netty Function Reference

Architecture documentation for the channelInactiveHappensAfterExceptionCaughtEvents() function in Http2MultiplexTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2b88d2e9_40e8_60d4_0d44_d9375fd2f809["channelInactiveHappensAfterExceptionCaughtEvents()"]
  4745ff96_ed57_3bd8_9861_4b786d0b6e09["Http2MultiplexTest"]
  2b88d2e9_40e8_60d4_0d44_d9375fd2f809 -->|defined in| 4745ff96_ed57_3bd8_9861_4b786d0b6e09
  style 2b88d2e9_40e8_60d4_0d44_d9375fd2f809 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java lines 1185–1229

    @Test
    public void channelInactiveHappensAfterExceptionCaughtEvents() throws Exception {
        final AtomicInteger count = new AtomicInteger(0);
        final AtomicInteger exceptionCaught = new AtomicInteger(-1);
        final AtomicInteger channelInactive = new AtomicInteger(-1);
        final AtomicInteger channelUnregistered = new AtomicInteger(-1);
        Http2StreamChannel childChannel = newOutboundStream(new ChannelInboundHandlerAdapter() {

            @Override
            public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception {
                ctx.close();
                throw new Exception("exception");
            }
        });

        childChannel.pipeline().addLast(new ChannelInboundHandlerAdapter() {

            @Override
            public void channelInactive(ChannelHandlerContext ctx) throws Exception {
                channelInactive.set(count.getAndIncrement());
                super.channelInactive(ctx);
            }

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

            @Override
            public void channelUnregistered(ChannelHandlerContext ctx) throws Exception {
                channelUnregistered.set(count.getAndIncrement());
                super.channelUnregistered(ctx);
            }
        });

        childChannel.pipeline().fireUserEventTriggered(new Object());
        parentChannel.runPendingTasks();

        // The events should have happened in this order because the inactive and deregistration events
        // get deferred as they do in the AbstractChannel.
        assertEquals(0, exceptionCaught.get());
        assertEquals(1, channelInactive.get());
        assertEquals(2, channelUnregistered.get());
    }

Domain

Subdomains

Frequently Asked Questions

What does channelInactiveHappensAfterExceptionCaughtEvents() do?
channelInactiveHappensAfterExceptionCaughtEvents() is a function in the netty codebase, defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java.
Where is channelInactiveHappensAfterExceptionCaughtEvents() defined?
channelInactiveHappensAfterExceptionCaughtEvents() is defined in codec-http2/src/test/java/io/netty/handler/codec/http2/Http2MultiplexTest.java at line 1185.

Analyze Your Own Codebase

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

Try Supermodel Free