Package org.eclipse.jetty.client
Class HttpProxy.CreateTunnelPromise
- java.lang.Object
-
- org.eclipse.jetty.client.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).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Promise
Promise.Adapter<U>, Promise.Completable<S>, Promise.Wrapper<W>
-
-
Field Summary
Fields Modifier and Type Field Description private ClientConnectionFactory
connectionFactory
private java.util.Map<java.lang.String,java.lang.Object>
context
private EndPoint
endPoint
private Promise<Connection>
promise
-
Constructor Summary
Constructors Modifier Constructor Description private
CreateTunnelPromise(ClientConnectionFactory connectionFactory, EndPoint endPoint, Promise<Connection> promise, java.util.Map<java.lang.String,java.lang.Object> context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
failed(java.lang.Throwable x)
Callback invoked when the operation fails.void
succeeded(Connection connection)
Callback invoked when the operation completes.private void
tunnel(HttpDestination destination, Connection connection)
private void
tunnelFailed(EndPoint endPoint, java.lang.Throwable failure)
private void
tunnelSucceeded(EndPoint endPoint)
-
-
-
Field Detail
-
connectionFactory
private final ClientConnectionFactory connectionFactory
-
endPoint
private final EndPoint endPoint
-
promise
private final Promise<Connection> promise
-
context
private final java.util.Map<java.lang.String,java.lang.Object> context
-
-
Constructor Detail
-
CreateTunnelPromise
private CreateTunnelPromise(ClientConnectionFactory connectionFactory, EndPoint endPoint, Promise<Connection> promise, java.util.Map<java.lang.String,java.lang.Object> context)
-
-
Method Detail
-
succeeded
public void succeeded(Connection connection)
Description copied from interface:Promise
Callback invoked when the operation completes.
- Specified by:
succeeded
in interfacePromise<Connection>
- Parameters:
connection
- the context- See Also:
Promise.failed(Throwable)
-
failed
public void failed(java.lang.Throwable x)
Description copied from interface:Promise
Callback invoked when the operation fails.
- Specified by:
failed
in interfacePromise<Connection>
- Parameters:
x
- the reason for the operation failure
-
tunnel
private void tunnel(HttpDestination destination, Connection connection)
-
tunnelSucceeded
private void tunnelSucceeded(EndPoint endPoint)
-
tunnelFailed
private void tunnelFailed(EndPoint endPoint, java.lang.Throwable failure)
-
-