Class JettyHttpClientSupplier

  • All Implemented Interfaces:
    JettyHttpClientContract

    public class JettyHttpClientSupplier
    extends Object
    implements 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 Detail

      • JettyHttpClientSupplier

        public JettyHttpClientSupplier​(org.eclipse.jetty.client.HttpClient httpClient)
        HttpClient supplier to be optionally registered to a ClientConfig
        Parameters:
        httpClient - a HttpClient to be supplied when JettyConnector#getHttpClient() is called.