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)
HttpClientTransport
HttpClient
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 HttpClientTransport
client
- the HttpClient
that uses this transport.public HttpDestination newHttpDestination(String scheme, String host, int port)
HttpClientTransport
HttpDestination
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 HttpClientTransport
scheme
- the destination schemehost
- the destination hostport
- the destination portHttpDestination
objectpublic void connect(HttpDestination destination, SocketAddress address, Promise<Connection> promise)
HttpClientTransport
address
.connect
in interface HttpClientTransport
destination
- the destinationaddress
- the address to connect topromise
- the promise to notify when the connection succeeds or failspublic Connection tunnel(Connection connection)
HttpClientTransport
connection
tunnel
in interface HttpClientTransport
connection
- the connection to tunnelCopyright © 1995-2013 Mort Bay Consulting. All Rights Reserved.