Top Description Fields Methods
org.eclipse.jetty.client

public Interface HttpClientTransport

extends ClientConnectionFactory
Known Direct Implementers
org.eclipse.jetty.client.AbstractHttpClientTransport
Imports
java.net.InetSocketAddress, .SocketAddress, java.util.Map, org.eclipse.jetty.client.transport.HttpDestination, org.eclipse.jetty.io.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 an 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 FCGI protocol, the HTTP/2 protocol or, in future, other protocols.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
Inherited from org.eclipse.jetty.io.ClientConnectionFactory:
CLIENT_CONTEXT_KEY

Method Summary

Modifier and TypeMethod and Description
public void
connect(InetSocketAddress
the address to connect to
address
,
Map<String, Object>
the context information to establish the connection
context
)
Deprecated use connect(SocketAddress, Map) instead.

Establishes a physical connection to the given address.

public default void
connect(SocketAddress
the address to connect to
address
,
Map<String, Object>
the context information to establish the connection
context
)

Establishes a physical connection to the given address.

public ConnectionPool.Factory
getConnectionPoolFactory()

Returns: the factory for ConnectionPool instances

public Destination

Returns:

a new, transport-specific, HttpDestination object
newDestination
(Origin
the destination origin
origin
)

Creates a new, transport-specific, HttpDestination object.

public Origin

Returns:

an Origin that identifies a destination
newOrigin
(Request
the request that triggers the creation of the Origin
request
)

Creates a new Origin with the given request.

public void
setConnectionPoolFactory(ConnectionPool.Factory
the factory for ConnectionPool instances
factory
)

Set the factory for ConnectionPool instances.

public void
setHttpClient(HttpClient
the HttpClient that uses this transport.
client
)

Sets the HttpClient instance on this transport.

Inherited from org.eclipse.jetty.io.ClientConnectionFactory:
customizenewConnection

Field Detail

HTTP_CONNECTION_PROMISE_CONTEXT_KEYback to summary
public static final String HTTP_CONNECTION_PROMISE_CONTEXT_KEY
HTTP_DESTINATION_CONTEXT_KEYback to summary
public static final String HTTP_DESTINATION_CONTEXT_KEY

Method Detail

connectback to summary
public void connect(InetSocketAddress address, Map<String, Object> context)

Deprecated

use connect(SocketAddress, Map) instead.

Establishes a physical connection to the given address.

Parameters
address:InetSocketAddress

the address to connect to

context:Map<String, Object>

the context information to establish the connection

Annotations
@Deprecated
connectback to summary
public default void connect(SocketAddress address, Map<String, Object> context)

Establishes a physical connection to the given address.

Parameters
address:SocketAddress

the address to connect to

context:Map<String, Object>

the context information to establish the connection

getConnectionPoolFactoryback to summary
public ConnectionPool.Factory getConnectionPoolFactory()
Returns:ConnectionPool.Factory

the factory for ConnectionPool instances

newDestinationback to summary
public Destination newDestination(Origin origin)

Creates a new, transport-specific, HttpDestination object.

HttpDestination controls the destination-connection cardinality: protocols like HTTP have 1-N cardinality, while multiplexed protocols like HTTP/2 have a 1-1 cardinality.

Parameters
origin:Origin

the destination origin

Returns:Destination

a new, transport-specific, HttpDestination object

newOriginback to summary
public Origin newOrigin(Request request)

Creates a new Origin with the given request.

Parameters
request:Request

the request that triggers the creation of the Origin

Returns:Origin

an Origin that identifies a destination

setConnectionPoolFactoryback to summary
public void setConnectionPoolFactory(ConnectionPool.Factory factory)

Set the factory for ConnectionPool instances.

Parameters
factory:ConnectionPool.Factory

the factory for ConnectionPool instances

setHttpClientback to summary
public void setHttpClient(HttpClient client)

Sets the 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.

Parameters
client:HttpClient

the HttpClient that uses this transport.