Skip to content

Commit

Permalink
[MQTTv5] Enable use of Java's try-with-resources statement
Browse files Browse the repository at this point in the history
For MQTTv3 this has already been done with #446
  • Loading branch information
a-st authored Aug 14, 2024
1 parent 9c742c1 commit a962da7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.eclipse.paho.mqttv5.common.MqttSubscription;
import org.eclipse.paho.mqttv5.common.packet.MqttProperties;

public interface IMqttAsyncClient {
public interface IMqttAsyncClient extends AutoCloseable {

/**
* Connects to an MQTT server using the default options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* style. The blocking client provides compatibility with earlier versions
* of the MQTT client.</p>
*/
public interface IMqttClient { //extends IMqttAsyncClient {
public interface IMqttClient extends AutoCloseable { //extends IMqttAsyncClient {
/**
* Connects to an MQTT server using the default options.
* <p>The default options are specified in {@link MqttConnectionOptions} class.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* It is up to the persistence interface to log any exceptions or error information
* which may be required when diagnosing a persistence failure.</p>
*/
public interface MqttClientPersistence {
public interface MqttClientPersistence extends AutoCloseable {
/**
* Initialise the persistent store.
* If a persistent store exists for this client ID then open it, otherwise
Expand Down

0 comments on commit a962da7

Please sign in to comment.