Home / Function/ prepareToDestroy() — netty Function Reference

prepareToDestroy() — netty Function Reference

Architecture documentation for the prepareToDestroy() function in NioIoHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  835b5b88_c0c2_46ad_ca71_7e60be695e58["prepareToDestroy()"]
  db526e28_8aae_a182_b56b_dc12824d89f5["NioIoHandler"]
  835b5b88_c0c2_46ad_ca71_7e60be695e58 -->|defined in| db526e28_8aae_a182_b56b_dc12824d89f5
  0da770a6_c2c1_ab83_acae_aaaf42049c37["selectAgain()"]
  835b5b88_c0c2_46ad_ca71_7e60be695e58 -->|calls| 0da770a6_c2c1_ab83_acae_aaaf42049c37
  b2d60452_c9f9_89ec_0be0_2d281d72f3a4["close()"]
  835b5b88_c0c2_46ad_ca71_7e60be695e58 -->|calls| b2d60452_c9f9_89ec_0be0_2d281d72f3a4
  style 835b5b88_c0c2_46ad_ca71_7e60be695e58 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/nio/NioIoHandler.java lines 599–612

    @Override
    public void prepareToDestroy() {
        selectAgain();
        Set<SelectionKey> keys = selector.keys();
        Collection<DefaultNioRegistration> registrations = new ArrayList<>(keys.size());
        for (SelectionKey k: keys) {
            DefaultNioRegistration handle = (DefaultNioRegistration) k.attachment();
            registrations.add(handle);
        }

        for (DefaultNioRegistration reg: registrations) {
            reg.close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does prepareToDestroy() do?
prepareToDestroy() is a function in the netty codebase, defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java.
Where is prepareToDestroy() defined?
prepareToDestroy() is defined in transport/src/main/java/io/netty/channel/nio/NioIoHandler.java at line 599.
What does prepareToDestroy() call?
prepareToDestroy() calls 2 function(s): close, selectAgain.

Analyze Your Own Codebase

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

Try Supermodel Free