Home / Function/ acceptOutboundMessage() — netty Function Reference

acceptOutboundMessage() — netty Function Reference

Architecture documentation for the acceptOutboundMessage() function in HttpResponseEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c71d1c96_0144_1b0f_6ae0_cf23e738fe33["acceptOutboundMessage()"]
  bcdc6576_85d8_9fc4_6f59_ed2fc79de374["HttpResponseEncoder"]
  c71d1c96_0144_1b0f_6ae0_cf23e738fe33 -->|defined in| bcdc6576_85d8_9fc4_6f59_ed2fc79de374
  style c71d1c96_0144_1b0f_6ae0_cf23e738fe33 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseEncoder.java lines 29–42

    @Override
    public boolean acceptOutboundMessage(Object msg) throws Exception {
        // JDK type checks vs non-implemented interfaces costs O(N), where
        // N is the number of interfaces already implemented by the concrete type that's being tested.
        // !(msg instanceof HttpRequest) is supposed to always be true (and meaning that msg isn't a HttpRequest),
        // but sadly was part of the original behaviour of this method and cannot be removed.
        // We place here exact checks vs DefaultHttpResponse and DefaultFullHttpResponse because bad users can
        // extends such types and make them to implement HttpRequest (non-sense, but still possible).
        final Class<?> msgClass = msg.getClass();
        if (msgClass == DefaultFullHttpResponse.class || msgClass == DefaultHttpResponse.class) {
            return true;
        }
        return super.acceptOutboundMessage(msg) && !(msg instanceof HttpRequest);
    }

Subdomains

Frequently Asked Questions

What does acceptOutboundMessage() do?
acceptOutboundMessage() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseEncoder.java.
Where is acceptOutboundMessage() defined?
acceptOutboundMessage() is defined in codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseEncoder.java at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free