Package org.glassfish.jersey.client
Interface HttpUrlConnectorProvider.ConnectionFactory
- Enclosing class:
- HttpUrlConnectorProvider
public static interface HttpUrlConnectorProvider.ConnectionFactory
A factory for
HttpURLConnection
instances.
A factory may be used to create a HttpURLConnection
and configure
it in a custom manner that is not possible using the Client API.
A custom factory instance may be registered in the HttpUrlConnectorProvider
instance
via HttpUrlConnectorProvider.connectionFactory(ConnectionFactory)
method.
-
Method Summary
Modifier and TypeMethodDescriptiongetConnection
(URL url) Get aHttpURLConnection
for a given URL.default HttpURLConnection
getConnection
(URL url, Proxy proxy) Get aHttpURLConnection
for a given URL.
-
Method Details
-
getConnection
Get aHttpURLConnection
for a given URL.Implementation of the method MUST be thread-safe and MUST ensure that a dedicated
HttpURLConnection
instance is returned for concurrent requests.- Parameters:
url
- the endpoint URL.- Returns:
- the
HttpURLConnection
. - Throws:
IOException
- in case the connection cannot be provided.
-
getConnection
Get aHttpURLConnection
for a given URL.Implementation of the method MUST be thread-safe and MUST ensure that a dedicated
HttpURLConnection
instance is returned for concurrent requests.- Parameters:
url
- the endpoint URL.proxy
- the configured proxy or null.- Returns:
- the
HttpURLConnection
. - Throws:
IOException
- in case the connection cannot be provided.
-