Home / Class/ ServerEngine Class — netty Architecture

ServerEngine Class — netty Architecture

Architecture documentation for the ServerEngine class in ConscryptAlpnSslEngine.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d9d431a0_964c_2741_0842_d5f52db90e6f["ServerEngine"]
  e51572cf_5b72_0ca1_2650_98c58f05ef33["ConscryptAlpnSslEngine.java"]
  d9d431a0_964c_2741_0842_d5f52db90e6f -->|defined in| e51572cf_5b72_0ca1_2650_98c58f05ef33
  298cc142_0d70_c4e8_9b2c_f49d46facc57["ServerEngine()"]
  d9d431a0_964c_2741_0842_d5f52db90e6f -->|method| 298cc142_0d70_c4e8_9b2c_f49d46facc57
  7bace539_99f9_d03e_3eed_443671615e0d["selectProtocol()"]
  d9d431a0_964c_2741_0842_d5f52db90e6f -->|method| 7bace539_99f9_d03e_3eed_443671615e0d

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/ConscryptAlpnSslEngine.java lines 141–171

    private static final class ServerEngine extends ConscryptAlpnSslEngine {
        private final ProtocolSelector protocolSelector;

        ServerEngine(SSLEngine engine, ByteBufAllocator alloc,
                     JdkApplicationProtocolNegotiator applicationNegotiator) {
            super(engine, alloc, applicationNegotiator.protocols());

            // Register for completion of the handshake.
            Conscrypt.setHandshakeListener(engine, new HandshakeListener() {
                @Override
                public void onHandshakeFinished() throws SSLException {
                    selectProtocol();
                }
            });

            protocolSelector = checkNotNull(applicationNegotiator.protocolSelectorFactory()
                            .newSelector(this,
                                    new LinkedHashSet<String>(applicationNegotiator.protocols())),
                    "protocolSelector");
        }

        private void selectProtocol() throws SSLException {
            try {
                String protocol = Conscrypt.getApplicationProtocol(getWrappedEngine());
                protocolSelector.select(protocol != null ? Collections.singletonList(protocol)
                        : Collections.<String>emptyList());
            } catch (Throwable e) {
                throw toSSLHandshakeException(e);
            }
        }
    }

Frequently Asked Questions

What is the ServerEngine class?
ServerEngine is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/ConscryptAlpnSslEngine.java.
Where is ServerEngine defined?
ServerEngine is defined in handler/src/main/java/io/netty/handler/ssl/ConscryptAlpnSslEngine.java at line 141.

Analyze Your Own Codebase

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

Try Supermodel Free