Package software.amazon.awssdk.crt.io
Class HostResolver
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.io.HostResolver
-
- All Implemented Interfaces:
AutoCloseable
public class HostResolver extends CrtResource
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Constructor Summary
Constructors Constructor Description HostResolver(EventLoopGroup elg)
HostResolver(EventLoopGroup elg, int maxEntries)
-
Method Summary
All Methods Static 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.static void
closeStaticDefault()
Closes the static default host resolver, if it exists.protected void
releaseNativeHandle()
Cleans up the resolver's associated native handlestatic void
setStaticDefaultMaxEntries(int maxEntries)
Sets the max number of cached host entries for the static default resolver, if it's ever created/used.-
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
-
HostResolver
public HostResolver(EventLoopGroup elg) throws CrtRuntimeException
- Throws:
CrtRuntimeException
-
HostResolver
public HostResolver(EventLoopGroup elg, int maxEntries) throws CrtRuntimeException
- 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:
canReleaseReferencesImmediately
in classCrtResource
- Returns:
- true if this resource releases synchronously, false if this resource performs async shutdown
-
releaseNativeHandle
protected void releaseNativeHandle()
Cleans up the resolver's associated native handle- Specified by:
releaseNativeHandle
in classCrtResource
-
setStaticDefaultMaxEntries
public static void setStaticDefaultMaxEntries(int maxEntries)
Sets the max number of cached host entries for the static default resolver, if it's ever created/used. Has no effect if the static default host resolver has already been created.- Parameters:
maxEntries
- maximum number of host entries cached
-
closeStaticDefault
public static void closeStaticDefault()
Closes the static default host resolver, if it exists. Primarily intended for tests that use the static default resolver, before they call waitForNoResources().
-
-