Class JettyHttpClientSupplier
- java.lang.Object
-
- org.glassfish.jersey.jetty.connector.JettyHttpClientSupplier
-
- All Implemented Interfaces:
JettyHttpClientContract
public class JettyHttpClientSupplier extends Object implements JettyHttpClientContract
Jetty HttpClient supplier to be registered into Jersey configuration to be used byJettyConnector. 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
HttpClientis configured as if it was created byJettyConnectorthe usual way.
-
-
Constructor Summary
Constructors Constructor Description JettyHttpClientSupplier(org.eclipse.jetty.client.HttpClient httpClient)HttpClientsupplier to be optionally registered to aClientConfig
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.jetty.client.HttpClientgetHttpClient()Supply a user predefined HttpClient
-
-
-
Constructor Detail
-
JettyHttpClientSupplier
public JettyHttpClientSupplier(org.eclipse.jetty.client.HttpClient httpClient)
HttpClientsupplier to be optionally registered to aClientConfig- Parameters:
httpClient- a HttpClient to be supplied whenJettyConnector#getHttpClient()is called.
-
-
Method Detail
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()
Description copied from interface:JettyHttpClientContractSupply a user predefined HttpClient- Specified by:
getHttpClientin interfaceJettyHttpClientContract- Returns:
- a user predefined HttpClient
-
-