You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2009/12/23 20:21:28 UTC

svn commit: r893606 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs

Author: tabish
Date: Wed Dec 23 19:21:27 2009
New Revision: 893606

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

Update to inactivity monitor to handle the dispose call and ensure the Timers and TaskRunners are shutdown.  Remove some of the debug code now.

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

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs?rev=893606&r1=893605&r2=893606&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Transport/InactivityMonitor.cs Wed Dec 23 19:21:27 2009
@@ -93,7 +93,23 @@
             : base(next)
         {
             Tracer.Debug("Creating Inactivity Monitor");
-            Console.WriteLine("Creating Inactivity Monitor");
+        }
+
+        ~InactivityMonitor()
+        {
+            Dispose(false);
+        }
+
+        protected override void Dispose(bool disposing)
+        {
+            if(disposing)
+            {
+                // get rid of unmanaged stuff
+            }
+
+            StopMonitorThreads();
+
+            base.Dispose(disposing);
         }
 
         #region WriteCheck Related
@@ -102,11 +118,8 @@
         /// </summary>
         public void WriteCheck(object state)
         {
-            Console.WriteLine("Entered WriteCheck");
-
             if(this.inWrite.Value || this.failed.Value)
             {
-                Console.WriteLine("In write or already failed.");
                 return;
             }
 
@@ -130,13 +143,11 @@
         #region ReadCheck Related
         public void ReadCheck(object state)
         {
-            Console.WriteLine("Entered ReadCheck");
             DateTime now = DateTime.Now;
             TimeSpan elapsed = now - this.lastReadCheckTime;
 
             if(!AllowReadCheck(elapsed))
             {
-                Console.WriteLine("A read check is not yet allowed.");
                 return;
             }
 
@@ -145,7 +156,6 @@
             if(this.inRead.Value || this.failed.Value)
             {
                 Tracer.Debug("A receive is in progress or already failed.");
-                Console.WriteLine("A receive is in progress");
                 return;
             }