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
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
ConstructorsConstructorDescriptionClientBootstrap(EventLoopGroup elg, HostResolver hr) Creates a new ClientBootstrap. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the static ClientBootstrap, if it exists.static ClientBootstrapThis default will be used when a ClientBootstrap is not explicitly passed but is needed to allow the process to function.Methods inherited from class software.amazon.awssdk.crt.CrtResource
addRef, addReferenceTo, close, collectNativeResource, collectNativeResources, decRef, getNativeHandle, getResourceLogDescription, isNull, logNativeResources, logNativeResources, removeReferenceTo, setDescription, waitForNoResources
-
Constructor Details
-
ClientBootstrap
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 Details
-
getShutdownCompleteFuture
-
closeStaticDefault
public static void closeStaticDefault()Closes the static ClientBootstrap, if it exists. Primarily intended for tests that use the static default ClientBootstrap, before they call waitForNoResources(). -
getOrCreateStaticDefault
This default will be used when a ClientBootstrap is not explicitly passed but is needed to allow the process to function. An example of this would be in the MQTT connection creation workflow. The default ClientBootstrap will use the default EventLoopGroup and HostResolver, creating them if necessary. The default ClientBootstrap will be automatically managed and released when it's resources are being freed, not requiring any manual memory management.- Returns:
- the static default ClientBootstrap
-