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
ConstructorsConstructorDescriptionFor testing purpose only, assigning 'AZURE_ENABLE_HTTP_CLIENT_SHARING' to 'enableHttpClientSharing' for 'final' modifier. -
Method Summary
Modifier and TypeMethodDescriptioncom.azure.core.http.HttpClientCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.com.azure.core.http.HttpClientcreateInstance(com.azure.core.util.HttpClientOptions clientOptions) Creates a new instance of theHttpClientthat this HttpClientProvider is configured to create.
-
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.HttpClientProviderCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.- Specified by:
createInstancein interfacecom.azure.core.http.HttpClientProvider- Returns:
- A new
HttpClientinstance, 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.HttpClientProviderCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.- Specified by:
createInstancein interfacecom.azure.core.http.HttpClientProvider- Parameters:
clientOptions- Configuration options applied to the createdHttpClient.- Returns:
- A new
HttpClientinstance, entirely unrelated to all other instances that were created previously.
-