code: protected void getNativeAlpnChoice(SSLEngine engine, SSLConnectionLink link) {
          if (isNativeAlpnActive()) {
              try {
                  String alpnResult = (String) nativeAlpnGet.invoke(engine);
                  if (alpnResult == null || alpnResult.isEmpty()) {
                      alpnResult = (String) nativeAlpnGetHandshake.invoke(engine);
                  }
  
                  if (alpnResult == null) {
                      Tr.debug(tc, "getNativeAlpnChoice: protocol not yet determined " + engine);
                  } else if (alpnResult.isEmpty()) {
                      Tr.debug(tc, "getNativeAlpnChoice: ALPN will not be used " + engine);
                  } else if (h2.equals(alpnResult)) {
                      // a protocol was selected
                      if (link.getAlpnProtocol() == null) {
                          Tr.debug(tc, "getNativeAlpnChoice: h2 protocol selected " + engine);
                          link.setAlpnProtocol(h2);
                      }
                  }
  
              } catch (InvocationTargetException ie) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "getNativeAlpnChoice exception: " + ie.getTargetException());
                  }
              } catch (Exception e) {
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                      Tr.debug(tc, "getNativeAlpnChoice exception: " + e);
                  }
              }
          }
      }
docs: Invoke SSLEngine.getApplicationProtocol() - Get the selected ALPN protocol, and set that protocol on the link.
  
  @param SSLEngine
  @param SSLConnectionLink