Package software.amazon.awssdk.crt.io
Class TlsContext
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.io.TlsContext
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ClientTlsContext,ServerTlsContext
public class TlsContext extends CrtResource
This class wraps the aws_tls_context from aws-c-io to provide access to TLS configuration contexts 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 TlsContext()Creates a new Client TlsContext.TlsContext(TlsContextOptions options)Creates a new Client TlsContext.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanReleaseReferencesImmediately()Determines whether a resource releases its dependencies at the same time the native handle is released or if it waits.protected voidreleaseNativeHandle()Frees all native resources associated with the context.protected static longtlsContextNew(long options)-
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
-
TlsContext
public TlsContext(TlsContextOptions options) throws CrtRuntimeException
Creates a new Client TlsContext. There are significant native resources consumed to create a TlsContext, so most applications will only need to create one and re-use it for all connections.- Parameters:
options- A set of options for this context- Throws:
CrtRuntimeException- If the provided options are malformed or the system is unable to allocate space for a native tls context
-
TlsContext
public TlsContext() throws CrtRuntimeExceptionCreates a new Client TlsContext. There are significant native resources consumed to create a TlsContext, so most applications will only need to create one and re-use it for all connections.- Throws:
CrtRuntimeException
-
-
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:
canReleaseReferencesImmediatelyin classCrtResource- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Frees all native resources associated with the context. This object is unusable after close is called.- Specified by:
releaseNativeHandlein classCrtResource
-
tlsContextNew
protected static long tlsContextNew(long options) throws CrtRuntimeException- Throws:
CrtRuntimeException
-
-