-
- All Superinterfaces:
org.eclipse.jetty.io.ClientConnectionFactory
- All Known Implementing Classes:
AbstractConnectorHttpClientTransport,AbstractHttpClientTransport,HttpClientTransportDynamic,HttpClientTransportOverHTTP
public interface HttpClientTransport extends org.eclipse.jetty.io.ClientConnectionFactoryHttpClientTransportrepresents what transport implementations should provide in order to plug-in a different transport forHttpClient.While the
HttpClientAPIs 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
Fields Modifier and Type Field Description static java.lang.StringHTTP_CONNECTION_PROMISE_CONTEXT_KEYstatic java.lang.StringHTTP_DESTINATION_CONTEXT_KEY
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidconnect(java.net.InetSocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)Deprecated.useconnect(SocketAddress, Map)instead.default voidconnect(java.net.SocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)Establishes a physical connection to the givenaddress.ConnectionPool.FactorygetConnectionPoolFactory()HttpDestinationnewHttpDestination(Origin origin)Creates a new, transport-specific,HttpDestinationobject.OriginnewOrigin(HttpRequest request)Creates a new Origin with the given request.voidsetConnectionPoolFactory(ConnectionPool.Factory factory)voidsetHttpClient(HttpClient client)Sets theHttpClientinstance on this transport.
-
-
-
Field Detail
-
HTTP_DESTINATION_CONTEXT_KEY
static final java.lang.String HTTP_DESTINATION_CONTEXT_KEY
- See Also:
- Constant Field Values
-
HTTP_CONNECTION_PROMISE_CONTEXT_KEY
static final java.lang.String HTTP_CONNECTION_PROMISE_CONTEXT_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
setHttpClient
void setHttpClient(HttpClient client)
Sets theHttpClientinstance on this transport.This is needed because of a chicken-egg problem: in order to create the
HttpClienta HttpClientTransport is needed, that therefore cannot have a reference yet to theHttpClient.- Parameters:
client- theHttpClientthat uses this transport.
-
newOrigin
Origin newOrigin(HttpRequest request)
Creates a new Origin with the given request.- Parameters:
request- the request that triggers the creation of the Origin- Returns:
- an Origin that identifies a destination
-
newHttpDestination
HttpDestination newHttpDestination(Origin origin)
Creates a new, transport-specific,HttpDestinationobject.HttpDestinationcontrols the destination-connection cardinality: protocols like HTTP have 1-N cardinality, while multiplexed protocols like HTTP/2 have a 1-1 cardinality.- Parameters:
origin- the destination origin- Returns:
- a new, transport-specific,
HttpDestinationobject
-
connect
@Deprecated void connect(java.net.InetSocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)Deprecated.useconnect(SocketAddress, Map)instead.Establishes a physical connection to the givenaddress.- Parameters:
address- the address to connect tocontext- the context information to establish the connection
-
connect
default void connect(java.net.SocketAddress address, java.util.Map<java.lang.String,java.lang.Object> context)Establishes a physical connection to the givenaddress.- Parameters:
address- the address to connect tocontext- the context information to establish the connection
-
getConnectionPoolFactory
ConnectionPool.Factory getConnectionPoolFactory()
- Returns:
- the factory for ConnectionPool instances
-
setConnectionPoolFactory
void setConnectionPoolFactory(ConnectionPool.Factory factory)
- Parameters:
factory- the factory for ConnectionPool instances
-
-