Class GlobalAsyncHttpClient
java.lang.Object
com.databricks.jdbc.dbclient.impl.http.GlobalAsyncHttpClient
A singleton manager for an asynchronous HTTP client using Apache HttpAsyncClient. This class
implements a reference-counting mechanism to manage the lifecycle of the shared HTTP client. The
client is automatically initialized on first use and shut down when no references remain.
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClientGets the shared HTTP client instance, creating it if necessary.static voidDecrements the reference count for the shared HTTP client.
-
Method Details
-
getClient
public static org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient getClient()Gets the shared HTTP client instance, creating it if necessary. Increments the reference count for the client.- Returns:
- A shared
CloseableHttpAsyncClientinstance
-
releaseClient
public static void releaseClient()Decrements the reference count for the shared HTTP client. When the reference count reaches zero, the client is automatically shut down.
-