Package software.amazon.awssdk.crt.mqtt5
Class Mqtt5Listener
- java.lang.Object
-
- software.amazon.awssdk.crt.CrtResource
-
- software.amazon.awssdk.crt.mqtt5.Mqtt5Listener
-
- All Implemented Interfaces:
AutoCloseable
public class Mqtt5Listener extends CrtResource
This class wraps the aws-c-mqtt MQTT5 client to provide the basic MQTT5 pub/sub functionalities via the AWS Common Runtime One Mqtt5Listener class creates one connection. MQTT5 support is currently in developer preview. We encourage feedback at all times, but feedback during the preview window is especially valuable in shaping the final product. During the preview period we may make backwards-incompatible changes to the public API, but in general, this is something we will try our best to avoid.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class software.amazon.awssdk.crt.CrtResource
CrtResource.ResourceInstance
-
-
Constructor Summary
Constructors Constructor Description Mqtt5Listener(Mqtt5ListenerOptions options, Mqtt5Client client)Creates a Mqtt5Listener instance using the provided Mqtt5ListenerOptions.
-
Method Summary
All 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()Cleans up the native resources associated with this client.-
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
-
Mqtt5Listener
public Mqtt5Listener(Mqtt5ListenerOptions options, Mqtt5Client client) throws CrtRuntimeException
Creates a Mqtt5Listener instance using the provided Mqtt5ListenerOptions. Once the Mqtt5Listener is created, changing the settings will not cause a change in already created Mqtt5Listener's.- Parameters:
options- The Mqtt5ListenerOptions class to use to configure the new Mqtt5Listener.client- The Mqtt5Client class the mqtt5 listener listen to- Throws:
CrtRuntimeException- If the system is unable to allocate space for a native MQTT5 client structure
-
-
Method Detail
-
releaseNativeHandle
protected void releaseNativeHandle()
Cleans up the native resources associated with this client. The client is unusable after this call- Specified by:
releaseNativeHandlein classCrtResource
-
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
-
-