Class GrizzlyConnectorProvider

    • Constructor Detail

      • GrizzlyConnectorProvider

        public GrizzlyConnectorProvider()
        Create new Grizzly Async HTTP Client connector provider.
      • GrizzlyConnectorProvider

        public GrizzlyConnectorProvider​(GrizzlyConnectorProvider.AsyncClientCustomizer asyncClientCustomizer)
        Create new Grizzly Async HTTP Client connector provider with a custom client configuration customizer.
        Parameters:
        asyncClientCustomizer - Async HTTP Client configuration customizer.
        Since:
        2.10
    • Method Detail

      • getHttpClient

        public static com.ning.http.client.AsyncHttpClient getHttpClient​(jakarta.ws.rs.core.Configurable<?> component)
        Retrieve the underlying Grizzly AsyncHttpClient instance from JerseyClient or JerseyWebTarget configured to use GrizzlyConnectorProvider.
        Parameters:
        component - JerseyClient or JerseyWebTarget instance that is configured to use GrizzlyConnectorProvider.
        Returns:
        underlying Grizzly AsyncHttpClient instance.
        Throws:
        IllegalArgumentException - in case the component is neither JerseyClient nor JerseyWebTarget instance or in case the component is not configured to use a GrizzlyConnectorProvider.
        Since:
        2.8
      • register

        public static jakarta.ws.rs.client.Invocation.Builder register​(jakarta.ws.rs.client.Invocation.Builder builder,
                                                                       GrizzlyConnectorProvider.RequestCustomizer customizer)
        Register a request customizer for a single request. A registered customizer will be used to customize the underlying Async HTTP Client request builder.

        Invoking this method on an instance that is not configured to use Grizzly Async HTTP Client connector does not have any effect.

        Parameters:
        builder - JAX-RS request invocation builder.
        customizer - request customizer to be registered.
        Returns:
        updated Jersey client config with the Grizzly GrizzlyConnectorProvider.RequestCustomizer attached.
      • register

        public static ClientConfig register​(ClientConfig config,
                                            GrizzlyConnectorProvider.RequestCustomizer customizer)
        Register a request customizer for a all requests executed by a client instance configured with this client config. A registered customizer will be used to customize underlying Async HTTP Client request builders for all requests created using the Jersey client instance configured with this client config.

        Invoking this method on an instance that is not configured to use Grizzly Async HTTP Client connector does not have any effect.

        Parameters:
        config - Jersey client configuration.
        customizer - Async HTTP Client configuration customizer.
        Returns:
        updated JAX-RS client invocation builder with the Grizzly RequestCustomizer attached.