activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r825262 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs
Date Wed, 14 Oct 2009 20:24:31 GMT
Author: tabish
Date: Wed Oct 14 20:24:31 2009
New Revision: 825262

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

Adds ConnectionInterrupted and ConnectionResumed events to the Connection class.  When the
failover transport is used the client will receive notification via these events for the Connection
state. All other transports ignore these events.

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=825262&r1=825261&r2=825262&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 Wed Oct
14 20:24:31 2009
@@ -72,6 +72,8 @@
 		}
 
 		public event ExceptionListener ExceptionListener;
+        public event ConnectionInterruptedListener ConnectionInterruptedListener;
+        public event ConnectionResumedListener ConnectionResumedListener;
 
 		#region Properties
 
@@ -640,11 +642,33 @@
 		protected void OnTransportInterrupted(ITransport sender)
 		{
 			Tracer.Debug("Transport has been Interrupted.");
+
+            if(this.ConnectionInterruptedListener != null && !this.closing )
+            {
+                try
+                {
+                    this.ConnectionInterruptedListener();
+                }
+                catch
+                {
+                }                    
+            }
 		}
 
 		protected void OnTransportResumed(ITransport sender)
 		{
 			Tracer.Debug("Transport has resumed normal operation.");
+
+            if(this.ConnectionResumedListener != null && !this.closing )
+            {
+                try
+                {
+                    this.ConnectionResumedListener();
+                }
+                catch
+                {
+                }                    
+            }            
 		}
 
 		internal void OnSessionException(Session sender, Exception exception)



Mime
View raw message