File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 16
16
17
17
package com .rabbitmq .client ;
18
18
19
+ import java .io .Closeable ;
19
20
import java .io .IOException ;
20
21
import java .util .Map ;
21
22
import java .util .concurrent .TimeoutException ;
58
59
*
59
60
*/
60
61
61
- public interface Channel extends ShutdownNotifier {
62
+ public interface Channel extends ShutdownNotifier , Closeable {
62
63
/**
63
64
* Retrieve this channel's channel number.
64
65
* @return the channel number
@@ -77,6 +78,7 @@ public interface Channel extends ShutdownNotifier {
77
78
*
78
79
* @throws java.io.IOException if an error is encountered
79
80
*/
81
+ @ Override
80
82
void close () throws IOException , TimeoutException ;
81
83
82
84
/**
Original file line number Diff line number Diff line change 16
16
17
17
package com .rabbitmq .client ;
18
18
19
+ import java .io .Closeable ;
19
20
import java .io .IOException ;
20
21
import java .net .InetAddress ;
21
22
import java .util .Map ;
50
51
* Current implementations are thread-safe for code at the client API level,
51
52
* and in fact thread-safe internally except for code within RPC calls.
52
53
*/
53
- public interface Connection extends ShutdownNotifier { // rename to AMQPConnection later, this is a temporary name
54
+ public interface Connection extends ShutdownNotifier , Closeable { // rename to AMQPConnection later, this is a temporary name
54
55
/**
55
56
* Retrieve the host.
56
57
* @return the hostname of the peer we're connected to.
@@ -123,6 +124,7 @@ public interface Connection extends ShutdownNotifier { // rename to AMQPConnecti
123
124
*
124
125
* @throws IOException if an I/O problem is encountered
125
126
*/
127
+ @ Override
126
128
void close () throws IOException ;
127
129
128
130
/**
Original file line number Diff line number Diff line change 19
19
20
20
import java .io .ByteArrayInputStream ;
21
21
import java .io .ByteArrayOutputStream ;
22
+ import java .io .Closeable ;
22
23
import java .io .DataInputStream ;
23
24
import java .io .DataOutputStream ;
24
25
import java .io .EOFException ;
41
42
* It simply provides a mechanism for sending a message to an exchange with a given routing key,
42
43
* and waiting for a response.
43
44
*/
44
- public class RpcClient {
45
+ public class RpcClient extends Closeable {
45
46
/** Channel we are communicating on */
46
47
private final Channel _channel ;
47
48
/** Exchange to send requests to */
@@ -113,6 +114,7 @@ public void checkConsumer() throws IOException {
113
114
* Public API - cancels the consumer, thus deleting the temporary queue, and marks the RpcClient as closed.
114
115
* @throws IOException if an error is encountered
115
116
*/
117
+ @ Override
116
118
public void close () throws IOException {
117
119
if (_consumer != null ) {
118
120
_channel .basicCancel (_consumer .getConsumerTag ());
Original file line number Diff line number Diff line change 17
17
18
18
package com .rabbitmq .client ;
19
19
20
+ import java .io .Closeable ;
20
21
import java .io .IOException ;
21
22
22
23
/**
23
24
* Class which manages a request queue for a simple RPC-style service.
24
25
* The class is agnostic about the format of RPC arguments / return values.
25
26
*/
26
- public class RpcServer {
27
+ public class RpcServer extends Closeable {
27
28
/** Channel we are communicating on */
28
29
private final Channel _channel ;
29
30
/** Queue to receive requests from */
@@ -66,6 +67,7 @@ public RpcServer(Channel channel, String queueName)
66
67
* it was a temporary queue, and marks the RpcServer as closed.
67
68
* @throws IOException if an error is encountered
68
69
*/
70
+ @ Override
69
71
public void close ()
70
72
throws IOException
71
73
{
You can’t perform that action at this time.
0 commit comments