Author: rupertlssmith
Date: Tue Oct 9 07:07:53 2007
New Revision: 583176
URL: http://svn.apache.org/viewvc?rev=583176&view=rev
Log:
Merged revisions 583173 via svnmerge from
https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1
........
r583173 | rupertlssmith | 2007-10-09 15:05:30 +0100 (Tue, 09 Oct 2007) | 1
line
Changed exception handler to propagate unknown exceptions to all method
listeners, rather than throw it back to the caller.
........
Modified:
incubator/qpid/branches/M2/ (props changed)
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
Propchange: incubator/qpid/branches/M2/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Oct 9 07:07:53 2007
@@ -1 +1 @@
-/incubator/qpid/branches/M2.1:1-573736,573738-577772,577774-578732,578734,578736-578744,578746-578827,578829-583156,583170
+/incubator/qpid/branches/M2.1:1-573736,573738-577772,577774-578732,578734,578736-578744,578746-578827,578829-583156,583170,583173
Modified:
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
URL:
http://svn.apache.org/viewvc/incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs?rev=583176&r1=583175&r2=583176&view=diff
==============================================================================
---
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
(original)
+++
incubator/qpid/branches/M2/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
Tue Oct 9 07:07:53 2007
@@ -161,20 +161,20 @@
/// <summary>
/// Receives notification of any IO exceptions on the connection.
///
- /// <p/>Upon receipt of a connection closed exception, the fail-over
process is attempted. If the fail-over fails, then all method listeners
- /// and the application connection object are notified of the
connection failure exception.
+ /// <p/>Upon receipt of a connection closed exception or any
IOException, the fail-over process is attempted. If the fail-over fails, then
+ /// all method listeners and the application connection object are
notified of the connection failure exception.
///
- /// <p/>This exception handler only deals with
AMQConnectionClosedExceptions, any other exception types are thrown back to the
caller.
+ /// <p/>All other exception types are propagated to all method
listeners.
/// </summary>
public void OnException(Exception cause)
{
_log.Warn("public void OnException(Exception cause = " + cause +
"): called");
- if (cause is AMQConnectionClosedException || cause is
System.IO.IOException)
+ // Ensure that the method listener set cannot be changed whilst
this exception is propagated to all listeners. This also
+ // ensures that this exception is fully propagated to all
listeners, before another one can be processed.
+ lock (_lock)
{
- // Ensure that the method listener set cannot be changed
whilst this exception is propagated to all listeners. This also
- // ensures that this exception is fully propagated to all
listeners, before another one can be processed.
- lock (_lock)
+ if (cause is AMQConnectionClosedException || cause is
System.IO.IOException)
{
// Try a fail-over because the connection has failed.
FailoverState failoverState = AttemptFailover();
@@ -190,11 +190,12 @@
_connection.ExceptionReceived(cause);
}
}
- }
- // Throw the exception back to the caller if it is not of a known
type, to ensure unhandled runtimes are not swallowed.
- else
- {
- throw cause;
+ // Notify all method listeners of the exception.
+ else
+ {
+ PropagateExceptionToWaiters(cause);
+ _connection.ExceptionReceived(cause);
+ }
}
}