Class JettyHttpClientSupplier
java.lang.Object
org.glassfish.jersey.jetty.connector.JettyHttpClientSupplier
- All Implemented Interfaces:
JettyHttpClientContract
Jetty HttpClient supplier to be registered into Jersey configuration to be used by
JettyConnector
.
Not every possible configuration option is covered by the Jetty Connector and this supplier offers a way to provide
an HttpClient that has configured the options not covered by the Jetty Connector.
Typical usage:
HttpClient httpClient = ...
ClientConfig config = new ClientConfig();
config.connectorProvider(new JettyConnectorProvider());
config.register(new JettyHttpClientSupplier(httpClient));
Client client = ClientBuilder.newClient(config);
The HttpClient
is configured as if it was created by JettyConnector
the usual way.
-
Constructor Summary
ConstructorDescriptionJettyHttpClientSupplier
(org.eclipse.jetty.client.HttpClient httpClient) HttpClient
supplier to be optionally registered to aClientConfig
-
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.jetty.client.HttpClient
Supply a user predefined HttpClient
-
Constructor Details
-
JettyHttpClientSupplier
public JettyHttpClientSupplier(org.eclipse.jetty.client.HttpClient httpClient) HttpClient
supplier to be optionally registered to aClientConfig
- Parameters:
httpClient
- a HttpClient to be supplied whenJettyConnector.getHttpClient()
is called.
-
-
Method Details
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()Description copied from interface:JettyHttpClientContract
Supply a user predefined HttpClient- Specified by:
getHttpClient
in interfaceJettyHttpClientContract
- Returns:
- a user predefined HttpClient
-