public class JettyHttpClientSupplier extends Object implements JettyHttpClientContract
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 and Description |
---|
JettyHttpClientSupplier(org.eclipse.jetty.client.HttpClient httpClient)
HttpClient supplier to be optionally registered to a ClientConfig |
Modifier and Type | Method and Description |
---|---|
org.eclipse.jetty.client.HttpClient |
getHttpClient()
Supply a user predefined HttpClient
|
public JettyHttpClientSupplier(org.eclipse.jetty.client.HttpClient httpClient)
HttpClient
supplier to be optionally registered to a ClientConfig
httpClient
- a HttpClient to be supplied when JettyConnector.getHttpClient()
is called.public org.eclipse.jetty.client.HttpClient getHttpClient()
JettyHttpClientContract
getHttpClient
in interface JettyHttpClientContract
Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.