Class JavaNetHttpConnector
- java.lang.Object
-
- org.glassfish.jersey.jnh.connector.JavaNetHttpConnector
-
- All Implemented Interfaces:
Connector,Inflector<ClientRequest,ClientResponse>
public class JavaNetHttpConnector extends Object implements Connector
Provides a Jersey clientConnector, which internally uses Java'sHttpClient. The following properties are provided to Java'sHttpClient.Builderduring creation of theHttpClient:- Author:
- Steffen Nießing
-
-
Constructor Summary
Constructors Constructor Description JavaNetHttpConnector(Client client, Configuration configuration)Constructs a newConnectorfor a Jersey client instance using Java'sHttpClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientResponseapply(ClientRequest request)Future<?>apply(ClientRequest request, AsyncConnectorCallback callback)voidclose()CookieHandlergetCookieHandler()HttpClientgetHttpClient()Returns the underlyingHttpClientinstance used by this connector.StringgetName()
-
-
-
Constructor Detail
-
JavaNetHttpConnector
public JavaNetHttpConnector(Client client, Configuration configuration)
Constructs a newConnectorfor a Jersey client instance using Java'sHttpClient.- Parameters:
client- a Jersey client instance to get additional configuration properties from (e.g.SSLContext)configuration- the configuration properties for this connector
-
-
Method Detail
-
getHttpClient
public HttpClient getHttpClient()
Returns the underlyingHttpClientinstance used by this connector.- Returns:
- the Java
HttpClientinstance
-
apply
public ClientResponse apply(ClientRequest request)
- Specified by:
applyin interfaceConnector- Specified by:
applyin interfaceInflector<ClientRequest,ClientResponse>
-
apply
public Future<?> apply(ClientRequest request, AsyncConnectorCallback callback)
-
getCookieHandler
public CookieHandler getCookieHandler()
-
-