Class HttpProxy.CreateTunnelPromise

  • All Implemented Interfaces:
    Promise<Connection>
    Enclosing class:
    HttpProxy

    private static class HttpProxy.CreateTunnelPromise
    extends java.lang.Object
    implements Promise<Connection>

    Creates a tunnel using HTTP CONNECT.

    It is implemented as a promise because it needs to establish the tunnel after the TCP connection is succeeded, and needs to notify the nested promise when the tunnel is established (or failed).

    • Field Detail

      • endPoint

        private final EndPoint endPoint
      • context

        private final java.util.Map<java.lang.String,​java.lang.Object> context
    • Method Detail

      • failed

        public void failed​(java.lang.Throwable x)
        Description copied from interface: Promise

        Callback invoked when the operation fails.

        Specified by:
        failed in interface Promise<Connection>
        Parameters:
        x - the reason for the operation failure
      • tunnelSucceeded

        private void tunnelSucceeded​(EndPoint endPoint)
      • tunnelFailed

        private void tunnelFailed​(EndPoint endPoint,
                                  java.lang.Throwable failure)