org.glassfish.jersey.client
Interface HttpUrlConnector.ConnectionFactory

Enclosing class:
HttpUrlConnector

public static interface HttpUrlConnector.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 factory instance may be registered with the constructor HttpUrlConnector.HttpUrlConnector(HttpUrlConnector.ConnectionFactory). Then the HttpUrlConnector instance may be registered with a JerseyClient or JerseyWebTarget configuration via ClientConfig.connector(org.glassfish.jersey.client.spi.Connector).


Method Summary
 java.net.HttpURLConnection getConnection(java.net.URL url)
          Get a HttpURLConnection for a given URL.
 

Method Detail

getConnection

java.net.HttpURLConnection getConnection(java.net.URL url)
                                         throws java.io.IOException
Get a HttpURLConnection 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:
java.io.IOException - in case the connection cannot be provided.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.