Author: ritchiem
Date: Wed Apr 15 10:56:26 2009
New Revision: 765132
URL: http://svn.apache.org/viewvc?rev=765132&view=rev
Log:
QPID-1809 : When a DisconnectedException is recieved check the StateManager to
see if there is a cause of the disconnection that we can throw instead to give
more meaning.
Modified:
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
Modified:
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
URL:
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java?rev=765132&r1=765131&r2=765132&view=diff
==============================================================================
---
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
(original)
+++
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
Wed Apr 15 10:56:26 2009
@@ -1310,6 +1310,17 @@
else
{
//Should never get here as all AMQEs are required to have an
ErrorCode!
+ // Other than AMQDisconnectedEx!
+
+ if (cause instanceof AMQDisconnectedException)
+ {
+ Exception last =
_protocolHandler.getStateManager().getLastException();
+ if (last != null)
+ {
+ _logger.info("StateManager had an exception for us to
use a cause of our Disconnected Exception");
+ cause = last;
+ }
+ }
je = new JMSException("Exception thrown against " + toString()
+ ": " + cause);
}
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:[email protected]