Home / Function/ replace0() — netty Function Reference

replace0() — netty Function Reference

Architecture documentation for the replace0() function in DefaultChannelPipeline.java from the netty codebase.

Function java Buffer Search called by 1

Entity Profile

Dependency Diagram

graph TD
  5b52a1f8_d25c_e60d_7c70_fb789879cbc8["replace0()"]
  12185bde_01b4_fad0_496c_1d27b952b797["DefaultChannelPipeline"]
  5b52a1f8_d25c_e60d_7c70_fb789879cbc8 -->|defined in| 12185bde_01b4_fad0_496c_1d27b952b797
  53925787_6b4f_0476_dece_0db30a06101e["ChannelHandler()"]
  53925787_6b4f_0476_dece_0db30a06101e -->|calls| 5b52a1f8_d25c_e60d_7c70_fb789879cbc8
  style 5b52a1f8_d25c_e60d_7c70_fb789879cbc8 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java lines 526–542

    private static void replace0(AbstractChannelHandlerContext oldCtx, AbstractChannelHandlerContext newCtx) {
        AbstractChannelHandlerContext prev = oldCtx.prev;
        AbstractChannelHandlerContext next = oldCtx.next;
        newCtx.prev = prev;
        newCtx.next = next;

        // Finish the replacement of oldCtx with newCtx in the linked list.
        // Note that this doesn't mean events will be sent to the new handler immediately
        // because we are currently at the event handler thread and no more than one handler methods can be invoked
        // at the same time (we ensured that in replace().)
        prev.next = newCtx;
        next.prev = newCtx;

        // update the reference to the replacement so forward of buffered content will work correctly
        oldCtx.prev = newCtx;
        oldCtx.next = newCtx;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does replace0() do?
replace0() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java.
Where is replace0() defined?
replace0() is defined in transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java at line 526.
What calls replace0()?
replace0() is called by 1 function(s): ChannelHandler.

Analyze Your Own Codebase

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

Try Supermodel Free