From 34b1fef825e94c6ee378206f92634f3843e75723 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Wed, 3 Oct 2007 15:26:10 +0000 Subject: QPID-614 : Applied supplementary patch from Aidan Skinner. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@581627 13f79535-47bb-0310-9956-ffa450edef68 --- .../protocol/BlockingMethodFrameListener.java | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'java/client') diff --git a/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java b/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java index 15a4257136..c64f46ba23 100644 --- a/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java +++ b/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java @@ -180,31 +180,33 @@ public abstract class BlockingMethodFrameListener implements AMQMethodListener { while (!_ready) { - if (timeout == -1) - { - _receivedCondition.await(); - } - else - { - nanoTimeout = _receivedCondition.awaitNanos(nanoTimeout); - - if (nanoTimeout <= 0 && !_ready && _error == null) + try { + if (timeout == -1) + { + _receivedCondition.await(); + } + else { - _error = new AMQTimeoutException("Server did not respond in a timely fashion"); - _ready = true; + nanoTimeout = _receivedCondition.awaitNanos(nanoTimeout); + + if (nanoTimeout <= 0 && !_ready && _error == null) + { + _error = new AMQTimeoutException("Server did not respond in a timely fashion"); + _ready = true; + } } + } + catch (InterruptedException e) + { + // IGNORE -- //fixme this isn't ideal as being interrupted isn't equivellant to sucess + // if (!_ready && timeout != -1) + // { + // _error = new AMQException("Server did not respond timely"); + // _ready = true; + // } } } } - catch (InterruptedException e) - { - // IGNORE -- //fixme this isn't ideal as being interrupted isn't equivellant to sucess - // if (!_ready && timeout != -1) - // { - // _error = new AMQException("Server did not respond timely"); - // _ready = true; - // } - } finally { _lock.unlock(); -- cgit v1.2.1