Package software.amazon.awssdk.crt.io
Class ClientBootstrap
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.io.ClientBootstrap
-
- All Implemented Interfaces:
AutoCloseable
public final class ClientBootstrap extends CrtResource
This class wraps the aws_client_bootstrap from aws-c-io to provide a client context for all protocol stacks in the AWS Common Runtime.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Constructor Summary
Constructors Constructor Description ClientBootstrap(EventLoopGroup elg, HostResolver hr)
Creates a new ClientBootstrap.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canReleaseReferencesImmediately()
Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.CompletableFuture<Void>
getShutdownCompleteFuture()
protected void
releaseNativeHandle()
Cleans up the client bootstrap's associated native handle-
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
-
-
-
-
Constructor Detail
-
ClientBootstrap
public ClientBootstrap(EventLoopGroup elg, HostResolver hr) throws CrtRuntimeException
Creates a new ClientBootstrap. Most applications will only ever need one instance of this.- Parameters:
hr
- A HostResolver instance, most applications only ever have oneelg
- An EventLoopGroup instance, most applications only ever have one- Throws:
CrtRuntimeException
- If the provided EventLoopGroup is null or invalid, or if the system is unable to allocate space for a native client bootstrap object
-
-
Method Detail
-
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:
canReleaseReferencesImmediately
in classCrtResource
- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Cleans up the client bootstrap's associated native handle- Specified by:
releaseNativeHandle
in classCrtResource
-
getShutdownCompleteFuture
public CompletableFuture<Void> getShutdownCompleteFuture()
-
-