Class JdkHttpClientProvider

java.lang.Object
com.azure.core.http.jdk.httpclient.JdkHttpClientProvider
All Implemented Interfaces:
com.azure.core.http.HttpClientProvider

public final class JdkHttpClientProvider extends Object implements com.azure.core.http.HttpClientProvider
An HttpClientProvider that provides an implementation of HttpClient based on native JDK HttpClient.

NOTE: This implementation is only available in Java 11+ as that is when HttpClient was introduced.

  • Constructor Summary

    Constructors
    Constructor
    Description
    For testing purpose only, assigning 'AZURE_ENABLE_HTTP_CLIENT_SHARING' to 'enableHttpClientSharing' for 'final' modifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.azure.core.http.HttpClient
    Creates a new instance of the HttpClient that this HttpClientProvider is configured to create.
    com.azure.core.http.HttpClient
    createInstance(com.azure.core.util.HttpClientOptions clientOptions)
    Creates a new instance of the HttpClient that this HttpClientProvider is configured to create.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JdkHttpClientProvider

      public JdkHttpClientProvider()
      For testing purpose only, assigning 'AZURE_ENABLE_HTTP_CLIENT_SHARING' to 'enableHttpClientSharing' for 'final' modifier.
  • Method Details

    • createInstance

      public com.azure.core.http.HttpClient createInstance()
      Description copied from interface: com.azure.core.http.HttpClientProvider
      Creates a new instance of the HttpClient that this HttpClientProvider is configured to create.
      Specified by:
      createInstance in interface com.azure.core.http.HttpClientProvider
      Returns:
      A new HttpClient instance, entirely unrelated to all other instances that were created previously.
    • createInstance

      public com.azure.core.http.HttpClient createInstance(com.azure.core.util.HttpClientOptions clientOptions)
      Description copied from interface: com.azure.core.http.HttpClientProvider
      Creates a new instance of the HttpClient that this HttpClientProvider is configured to create.
      Specified by:
      createInstance in interface com.azure.core.http.HttpClientProvider
      Parameters:
      clientOptions - Configuration options applied to the created HttpClient.
      Returns:
      A new HttpClient instance, entirely unrelated to all other instances that were created previously.