activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r749311 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Date Mon, 02 Mar 2009 14:07:56 GMT
Author: tabish
Date: Mon Mar  2 14:07:55 2009
New Revision: 749311

URL: http://svn.apache.org/viewvc?rev=749311&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQNET-149

Applied Jim's patch to add handling of ConnectionError to the Connection class.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs?rev=749311&r1=749310&r2=749311&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs Mon Mar
 2 14:07:55 2009
@@ -434,12 +434,32 @@
 			}
 			else if(command is ShutdownInfo)
 			{
-				//ShutdownInfo info = (ShutdownInfo)command;
 				if(!closing && !closed)
 				{
 					OnException(commandTransport, new NMSException("Broker closed this connection."));
 				}
 			}
+			else if(command is ConnectionError)
+			{
+			    if(!closing && !closed)
+			    {
+			        ConnectionError connectionError = (ConnectionError) command;
+			        BrokerError brokerError = connectionError.Exception;
+			        string message = "Broker connection error.";
+			        string cause = "";
+
+			        if(null != brokerError)
+			        {
+			            message = brokerError.Message;
+			            if(null != brokerError.Cause)
+			            {
+			                cause = brokerError.Cause.Message;
+			            }
+			        }
+
+			        OnException(commandTransport, new NMSConnectionException(message, cause));
+			    }
+			}
 			else
 			{
 				Tracer.Error("Unknown command: " + command);



Mime
View raw message