public class HttpClientTransportOverSPDY extends Object implements HttpClientTransport
| Constructor and Description |
|---|
HttpClientTransportOverSPDY(SPDYClient client) |
| Modifier and Type | Method and Description |
|---|---|
void |
connect(HttpDestination destination,
SocketAddress address,
Promise<Connection> promise)
Establishes a physical connection to the given
address. |
HttpDestination |
newHttpDestination(String scheme,
String host,
int port)
Creates a new, transport-specific,
HttpDestination object. |
void |
setHttpClient(HttpClient client)
Sets the
HttpClient instance on this transport. |
Connection |
tunnel(Connection connection)
Establishes an encrypted tunnel over the given
connection |
public HttpClientTransportOverSPDY(SPDYClient client)
public void setHttpClient(HttpClient client)
HttpClientTransportHttpClient instance on this transport.
This is needed because of a chicken-egg problem: in order to create the HttpClient
a HttpClientTransport is needed, that therefore cannot have a reference yet to the
HttpClient.setHttpClient in interface HttpClientTransportclient - the HttpClient that uses this transport.public HttpDestination newHttpDestination(String scheme, String host, int port)
HttpClientTransportHttpDestination object.
HttpDestination controls the destination-connection cardinality: protocols like
HTTP have 1-N cardinality, while multiplexed protocols like SPDY have a 1-1 cardinality.newHttpDestination in interface HttpClientTransportscheme - the destination schemehost - the destination hostport - the destination portHttpDestination objectpublic void connect(HttpDestination destination, SocketAddress address, Promise<Connection> promise)
HttpClientTransportaddress.connect in interface HttpClientTransportdestination - the destinationaddress - the address to connect topromise - the promise to notify when the connection succeeds or failspublic Connection tunnel(Connection connection)
HttpClientTransportconnectiontunnel in interface HttpClientTransportconnection - the connection to tunnelCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.