From 906342ac4f5d90dbf5dcce881ccb7d056aa263cb Mon Sep 17 00:00:00 2001 From: Matthew Shinn Date: Tue, 23 Dec 2014 19:55:52 -0800 Subject: [PATCH] Make Channel and Connection implement AutoCloseable for use in try-with-resources --- src/com/rabbitmq/client/Channel.java | 2 +- src/com/rabbitmq/client/Connection.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/rabbitmq/client/Channel.java b/src/com/rabbitmq/client/Channel.java index 324d73c91b..6c3b96d11c 100644 --- a/src/com/rabbitmq/client/Channel.java +++ b/src/com/rabbitmq/client/Channel.java @@ -58,7 +58,7 @@ * */ -public interface Channel extends ShutdownNotifier { +public interface Channel extends ShutdownNotifier, AutoCloseable { /** * Retrieve this channel's channel number. * @return the channel number diff --git a/src/com/rabbitmq/client/Connection.java b/src/com/rabbitmq/client/Connection.java index 3abfaa2226..9e39918d19 100644 --- a/src/com/rabbitmq/client/Connection.java +++ b/src/com/rabbitmq/client/Connection.java @@ -50,7 +50,7 @@ * Current implementations are thread-safe for code at the client API level, * and in fact thread-safe internally except for code within RPC calls. */ -public interface Connection extends ShutdownNotifier { // rename to AMQPConnection later, this is a temporary name +public interface Connection extends ShutdownNotifier, AutoCloseable { // rename to AMQPConnection later, this is a temporary name /** * Retrieve the host. * @return the hostname of the peer we're connected to.