8000 Make sure TimeoutException is in the method signature · ThinkLib/rabbitmq-java-client@992a32d · GitHub
[go: up one dir, main page]

Skip to content

Commit 992a32d

Browse files
Make sure TimeoutException is in the method signature
1 parent 3f2dc78 commit 992a32d

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

src/com/rabbitmq/client/Channel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public interface Channel extends ShutdownNotifier {
7777
*
7878
* @throws java.io.IOException if an error is encountered
7979
*/
80-
void close() throws IOException;
80+
void close() throws IOException, TimeoutException;
8181

8282
/**
8383
* Close this channel.
@@ -86,7 +86,7 @@ public interface Channel extends ShutdownNotifier {
8686
* @param closeMessage a message indicating the reason for closing the connection
8787
* @throws java.io.IOException if an error is encountered
8888
*/
89-
void close(int closeCode, String closeMessage) throws IOException;
89+
void close(int closeCode, String closeMessage) throws IOException, TimeoutException;
9090

9191
/**
9292
* Indicates whether the server has asked this client to stop

src/com/rabbitmq/client/impl/ChannelN.java

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -422,22 +422,22 @@ protected void processDelivery(Command command, Basic.Deliver method) {
422422
command.getContentBody());
423423
} catch (Throwable ex) {
424424
getConnection().getExceptionHandler().handleConsumerException(this,
425-
ex,
426-
callback,
427-
m.getConsumerTag(),
428-
"handleDelivery");
425+
ex,
426+
callback,
427+
m.getConsumerTag(),
428+
"handleDelivery");
429429
}
430430
}
431431

432432
private void callReturnListeners(Command command, Basic.Return basicReturn) {
433433
try {
434434
for (ReturnListener l : this.returnListeners) {
435435
l.handleReturn(basicReturn.getReplyCode(),
436-
basicReturn.getReplyText(),
437-
basicReturn.getExchange(),
438-
basicReturn.getRoutingKey(),
439-
(BasicProperties) command.getContentHeader(),
440-
command.getContentBody());
436+
basicReturn.getReplyText(),
437+
basicReturn.getExchange(),
438+
basicReturn.getRoutingKey(),
439+
(BasicProperties) command.getContentHeader(),
440+
command.getContentBody());
441441
}
442442
} catch (Throwable ex) {
443443
getConnection().getExceptionHandler().handleReturnListenerException(this, ex);
@@ -493,15 +493,13 @@ private void asyncShutdown(Command command) throws IOException {
493493

494494
/** Public API - {@inheritDoc} */
495495
public void close()
496-
throws IOException
497-
{
496+
throws IOException, TimeoutException {
498497
close(AMQP.REPLY_SUCCESS, "OK");
499498
}
500499

501500
/** Public API - {@inheritDoc} */
502501
public void close(int closeCode, String closeMessage)
503-
throws IOException
504-
{
502+
throws IOException, TimeoutException {
505503
close(closeCode, closeMessage, true, null, false);
506504
}
507505

@@ -517,8 +515,12 @@ public void abort(int closeCode, String closeMessage)
517515
throws IOException
518516
{
519517
try {
520-
close(closeCode, closeMessage, true, null, true);
521-
} catch (IOException _e) { /* ignored */ }
518+
close(closeCode, closeMessage, true, null, true);
519+
} catch (IOException _e) {
520+
/* ignored */
521+
} catch (TimeoutException _e) {
522+
/* ignored */
523+
}
522524
}
523525

524526
/**

0 commit comments

Comments
 (0)
0