Class GlobalAsyncHttpClient
- java.lang.Object
-
- com.databricks.jdbc.dbclient.impl.http.GlobalAsyncHttpClient
-
public class GlobalAsyncHttpClient extends Object
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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClientgetClient()Gets the shared HTTP client instance, creating it if necessary.static voidreleaseClient()Decrements the reference count for the shared HTTP client.
-
-
-
Method Detail
-
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.
-
-