Home / Function/ setHandshakeApplicationProtocolSelector() — netty Function Reference

setHandshakeApplicationProtocolSelector() — netty Function Reference

Architecture documentation for the setHandshakeApplicationProtocolSelector() function in BouncyCastleAlpnSslUtils.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2f4771f4_339a_6208_4f82_6849dcdd6756["setHandshakeApplicationProtocolSelector()"]
  49900df4_31cd_ac6b_00c5_ebef487f1fd0["BouncyCastleAlpnSslUtils"]
  2f4771f4_339a_6208_4f82_6849dcdd6756 -->|defined in| 49900df4_31cd_ac6b_00c5_ebef487f1fd0
  style 2f4771f4_339a_6208_4f82_6849dcdd6756 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/BouncyCastleAlpnSslUtils.java lines 191–220

    static void setHandshakeApplicationProtocolSelector(
            SSLEngine engine, final BiFunction<SSLEngine, List<String>, String> selector) {
        try {
            Object selectorProxyInstance = Proxy.newProxyInstance(
                    BouncyCastleAlpnSslUtils.class.getClassLoader(),
                    new Class[]{BC_APPLICATION_PROTOCOL_SELECTOR},
                    new InvocationHandler() {
                        @Override
                        public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
                            if (method.getName().equals("select")) {
                                try {
                                    return selector.apply((SSLEngine) args[0], (List<String>) args[1]);
                                } catch (ClassCastException e) {
                                    throw new RuntimeException("BCApplicationProtocolSelector select method " +
                                            "parameter of invalid type.", e);
                                }
                            } else {
                                throw new UnsupportedOperationException(String.format("Method '%s' not supported.",
                                        method.getName()));
                            }
                        }
                    });

            SET_HANDSHAKE_APPLICATION_PROTOCOL_SELECTOR.invoke(engine, selectorProxyInstance);
        } catch (UnsupportedOperationException ex) {
            throw ex;
        } catch (Exception ex) {
            throw new IllegalStateException(ex);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does setHandshakeApplicationProtocolSelector() do?
setHandshakeApplicationProtocolSelector() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/BouncyCastleAlpnSslUtils.java.
Where is setHandshakeApplicationProtocolSelector() defined?
setHandshakeApplicationProtocolSelector() is defined in handler/src/main/java/io/netty/handler/ssl/BouncyCastleAlpnSslUtils.java at line 191.

Analyze Your Own Codebase

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

Try Supermodel Free