Package software.amazon.awssdk.crt.http
Class HttpClientConnectionManager
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.http.HttpClientConnectionManager
-
- All Implemented Interfaces:
AutoCloseable
public class HttpClientConnectionManager extends CrtResource
Manages a Pool of Http Connections
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<HttpClientConnection>acquireConnection()Request a HttpClientConnection from the Connection Pool.protected booleancanReleaseReferencesImmediately()Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.static HttpClientConnectionManagercreate(HttpClientConnectionManagerOptions options)Factory function for HttpClientConnectionManager instancesHttpManagerMetricsgetManagerMetrics()intgetMaxConnections()CompletableFuture<Void>getShutdownCompleteFuture()URIgetUri()longgetWindowSize()voidreleaseConnection(HttpClientConnection conn)Releases this HttpClientConnection back into the Connection Pool, and allows another Request to acquire this connection.protected voidreleaseNativeHandle()Closes this Connection Pool and any pending Connection Acquisitions-
Methods inherited from class software.amazon.awssdk.crt.CrtResource
acquireNativeHandle, addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, releaseReferences, removeReferenceTo, setDescription, swapReferenceTo, waitForNoResources
-
-
-
-
Method Detail
-
create
public static HttpClientConnectionManager create(HttpClientConnectionManagerOptions options)
Factory function for HttpClientConnectionManager instances- Parameters:
options- configuration options- Returns:
- a new instance of an HttpClientConnectionManager
-
acquireConnection
public CompletableFuture<HttpClientConnection> acquireConnection()
Request a HttpClientConnection from the Connection Pool.- Returns:
- A Future for a HttpClientConnection that will be completed when a connection is acquired.
-
releaseConnection
public void releaseConnection(HttpClientConnection conn)
Releases this HttpClientConnection back into the Connection Pool, and allows another Request to acquire this connection.- Parameters:
conn- Connection to release
-
canReleaseReferencesImmediately
protected boolean canReleaseReferencesImmediately()
Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits. Resources that wait are responsible for calling releaseReferences() manually.- Specified by:
canReleaseReferencesImmediatelyin classCrtResource- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Closes this Connection Pool and any pending Connection Acquisitions- Specified by:
releaseNativeHandlein classCrtResource
-
getShutdownCompleteFuture
public CompletableFuture<Void> getShutdownCompleteFuture()
-
getMaxConnections
public int getMaxConnections()
- Returns:
- maximum number of connections this connection manager will pool
-
getManagerMetrics
public HttpManagerMetrics getManagerMetrics()
- Returns:
- concurrency metrics for the current manager
-
getWindowSize
public long getWindowSize()
- Returns:
- size of the per-connection streaming read window for response handling
-
getUri
public URI getUri()
- Returns:
- uri the connection manager is making connections to
-
-