Home / Function/ prepareToDestroy() — netty Function Reference

prepareToDestroy() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  36b68eb9_52c7_e010_b6ac_066e18cb31c4["prepareToDestroy()"]
  75a3ba71_0590_fec0_e352_8a91c916c5af["KQueueIoHandler"]
  36b68eb9_52c7_e010_b6ac_066e18cb31c4 -->|defined in| 75a3ba71_0590_fec0_e352_8a91c916c5af
  ca6401ff_3419_7724_1b24_ecfcdf566e0b["kqueueWaitNow()"]
  36b68eb9_52c7_e010_b6ac_066e18cb31c4 -->|calls| ca6401ff_3419_7724_1b24_ecfcdf566e0b
  1e77e40a_f188_9c62_9373_036f4078e2fa["close()"]
  36b68eb9_52c7_e010_b6ac_066e18cb31c4 -->|calls| 1e77e40a_f188_9c62_9373_036f4078e2fa
  87233553_29d8_ea69_ab7a_ba11b941aba3["processCancelledRegistrations()"]
  36b68eb9_52c7_e010_b6ac_066e18cb31c4 -->|calls| 87233553_29d8_ea69_ab7a_ba11b941aba3
  style 36b68eb9_52c7_e010_b6ac_066e18cb31c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueIoHandler.java lines 348–365

    @Override
    public void prepareToDestroy() {
        try {
            kqueueWaitNow();
        } catch (IOException e) {
            // ignore on close
        }

        // Using the intermediate collection to prevent ConcurrentModificationException.
        // In the `close()` method, the channel is deleted from `channels` map.
        DefaultKqueueIoRegistration[] copy = registrations.values().toArray(new DefaultKqueueIoRegistration[0]);

        for (DefaultKqueueIoRegistration reg: copy) {
            reg.close();
        }

        processCancelledRegistrations();
    }

Domain

Subdomains

Frequently Asked Questions

What does prepareToDestroy() do?
prepareToDestroy() is a function in the netty codebase, defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueIoHandler.java.
Where is prepareToDestroy() defined?
prepareToDestroy() is defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueIoHandler.java at line 348.
What does prepareToDestroy() call?
prepareToDestroy() calls 3 function(s): close, kqueueWaitNow, processCancelledRegistrations.

Analyze Your Own Codebase

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

Try Supermodel Free