Home / Class/ PendingRegistrationPromise Class — netty Architecture

PendingRegistrationPromise Class — netty Architecture

Architecture documentation for the PendingRegistrationPromise class in AbstractBootstrap.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2a24a3b8_d474_4266_d873_e2c2514309a4["PendingRegistrationPromise"]
  05a9a8b1_0187_702f_2a42_748428efe210["AbstractBootstrap.java"]
  2a24a3b8_d474_4266_d873_e2c2514309a4 -->|defined in| 05a9a8b1_0187_702f_2a42_748428efe210
  b0da8cce_f5cc_7786_fb6c_722851b0ff01["PendingRegistrationPromise()"]
  2a24a3b8_d474_4266_d873_e2c2514309a4 -->|method| b0da8cce_f5cc_7786_fb6c_722851b0ff01
  dcb5e6bb_70bb_d698_1e3e_e0b29bf1f8d4["registered()"]
  2a24a3b8_d474_4266_d873_e2c2514309a4 -->|method| dcb5e6bb_70bb_d698_1e3e_e0b29bf1f8d4
  9e85d47c_b36c_eeae_abba_3cc217f990e4["EventExecutor()"]
  2a24a3b8_d474_4266_d873_e2c2514309a4 -->|method| 9e85d47c_b36c_eeae_abba_3cc217f990e4

Relationship Graph

Source Code

transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java lines 511–536

    static final class PendingRegistrationPromise extends DefaultChannelPromise {

        // Is set to the correct EventExecutor once the registration was successful. Otherwise it will
        // stay null and so the GlobalEventExecutor.INSTANCE will be used for notifications.
        private volatile boolean registered;

        PendingRegistrationPromise(Channel channel) {
            super(channel);
        }

        void registered() {
            registered = true;
        }

        @Override
        protected EventExecutor executor() {
            if (registered) {
                // If the registration was a success executor is set.
                //
                // See https://github.com/netty/netty/issues/2586
                return super.executor();
            }
            // The registration failed so we can only use the GlobalEventExecutor as last resort to notify.
            return GlobalEventExecutor.INSTANCE;
        }
    }

Frequently Asked Questions

What is the PendingRegistrationPromise class?
PendingRegistrationPromise is a class in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java.
Where is PendingRegistrationPromise defined?
PendingRegistrationPromise is defined in transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java at line 511.

Analyze Your Own Codebase

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

Try Supermodel Free