Interface GrizzlyConnectorProvider.AsyncClientCustomizer

Enclosing class:
GrizzlyConnectorProvider

public static interface GrizzlyConnectorProvider.AsyncClientCustomizer
A customization SPI for the async client instance underlying Grizzly connectors.

An implementation of async client customizer can be registered in a GrizzlyConnectorProvider constructor. When a connector instance is then created, the customizer is invoked to update the underlying async client configuration builder before the actual configuration instance is built and used to create the async client instance. The customizer thus provides a way how to configure parts of the underlying async client SPI that are not directly exposed in the GrizzlyConnectorProvider API.

Since:
2.10
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    com.ning.http.client.AsyncHttpClientConfig.Builder
    customize(Client client, Configuration config, com.ning.http.client.AsyncHttpClientConfig.Builder configBuilder)
    Customize the underlying asynchronous client configuration builder.
  • Method Details

    • customize

      com.ning.http.client.AsyncHttpClientConfig.Builder customize(Client client, Configuration config, com.ning.http.client.AsyncHttpClientConfig.Builder configBuilder)
      Customize the underlying asynchronous client configuration builder.

      The configuration builder instance instance returned from the method will be subsequently used to build the configuration object that configures both the GrizzlyAsyncHttpProvider Grizzly async client provider} as well as the underlying async HTTP client instance itself.

      Note that any JAX-RS and Jersey specific configuration updates on the configuration builder happen before this method is invoked. As such, changes made to the configuration builder may override or cancel the effect of the JAX-RS and Jersey specific configuration changes. As such any configuration changes should be made with care and implementers should be aware of possible side effect of their changes.

      Parameters:
      client - JAX-RS client for which the connector is being created.
      config - JAX-RS configuration that was used to initialize connector's configuration.
      configBuilder - Async HTTP Client configuration builder that has been initialized based on the JAX-RS configuration.
      Returns:
      Async HTTP Client builder instance to be used to configure the underlying Grizzly provider and async HTTP client instance. Typically, the method returns the same configBuilder instance that has been passed into the method as an input parameter, but it is not required to do so.