diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2007-01-16 11:13:38 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2007-01-16 11:13:38 +0000 |
| commit | 01b9e5025b7f301b4a094c4f2f2b21e9bd42ce11 (patch) | |
| tree | 8677bcd1a2ef66bcd453c7938076082863189792 /java/client/src | |
| parent | f4d558a399c72f571b3575e5ac12ca20d71b0cb7 (diff) | |
| download | qpid-python-01b9e5025b7f301b4a094c4f2f2b21e9bd42ce11.tar.gz | |
QPID-300
Updated BlockingMethodFrameListener so it passed FailoverExceptions without wrapping in AMQExceptions.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@496661 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src')
| -rw-r--r-- | java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java | 11 |
1 files changed, 9 insertions, 2 deletions
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 c05e6faf53..f96da300ff 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 @@ -25,6 +25,7 @@ import org.apache.qpid.framing.AMQMethodBody; import org.apache.qpid.protocol.AMQMethodEvent; import org.apache.qpid.protocol.AMQMethodListener; import org.apache.qpid.client.protocol.AMQProtocolSession; +import org.apache.qpid.client.failover.FailoverException; public abstract class BlockingMethodFrameListener implements AMQMethodListener { @@ -52,6 +53,7 @@ public abstract class BlockingMethodFrameListener implements AMQMethodListener /** * This method is called by the MINA dispatching thread. Note that it could * be called before blockForFrame() has been called. + * * @param evt the frame event * @return true if the listener has dealt with this frame * @throws AMQException @@ -109,11 +111,15 @@ public abstract class BlockingMethodFrameListener implements AMQMethodListener { if (_error instanceof AMQException) { - throw (AMQException)_error; + throw(AMQException) _error; + } + else if (_error instanceof FailoverException) + { + throw (FailoverException)_error; // needed to expose FailoverException. } else { - throw new AMQException("Woken up due to " + _error.getClass(), _error); // FIXME: This will wrap FailoverException and prevent it being caught. + throw new AMQException("Woken up due to " + _error.getClass(), _error); } } @@ -123,6 +129,7 @@ public abstract class BlockingMethodFrameListener implements AMQMethodListener /** * This is a callback, called by the MINA dispatcher thread only. It is also called from within this * class to avoid code repetition but again is only called by the MINA dispatcher thread. + * * @param e */ public void error(Exception e) |
