public interface HttpClientTransport extends ClientConnectionFactory
HttpClientTransport
represents what transport implementations should provide
in order to plug-in a different transport for HttpClient
.
While the HttpClient
APIs define the HTTP semantic (request, response, headers, etc.)
how a HTTP exchange is carried over the network depends on implementations of this class.
The default implementation uses the HTTP protocol to carry over the network the HTTP exchange,
but the HTTP exchange may also be carried using the SPDY protocol or the FCGI protocol or, in future,
other protocols.ClientConnectionFactory.Helper
Modifier and Type | Field and Description |
---|---|
static String |
HTTP_CONNECTION_PROMISE_CONTEXT_KEY |
static String |
HTTP_DESTINATION_CONTEXT_KEY |
Modifier and Type | Method and Description |
---|---|
void |
connect(SocketAddress address,
Map<String,Object> context)
Establishes a physical connection to the given
address . |
HttpDestination |
newHttpDestination(Origin origin)
Creates a new, transport-specific,
HttpDestination object. |
void |
setHttpClient(HttpClient client)
Sets the
HttpClient instance on this transport. |
newConnection
static final String HTTP_DESTINATION_CONTEXT_KEY
static final String HTTP_CONNECTION_PROMISE_CONTEXT_KEY
void setHttpClient(HttpClient client)
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
.client
- the HttpClient
that uses this transport.HttpDestination newHttpDestination(Origin origin)
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.origin
- the destination originHttpDestination
objectvoid connect(SocketAddress address, Map<String,Object> context)
address
.address
- the address to connect tocontext
- the context information to establish the connectionCopyright © 1995-2015 Webtide. All Rights Reserved.