activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r925204 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp: MessageConsumer.cs QueueBrowser.cs
Date Fri, 19 Mar 2010 12:59:12 GMT
Author: tabish
Date: Fri Mar 19 12:59:12 2010
New Revision: 925204

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

Implements IDisposable in QueueBrowser.

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

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=925204&r1=925203&r2=925204&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/MessageConsumer.cs
Fri Mar 19 12:59:12 2010
@@ -98,22 +98,6 @@ namespace Apache.NMS.ActiveMQ
             {
                 URISupport.SetProperties(this.info, destination.Options, "consumer.");
             }
-            
-//            try
-//            {
-//                this.session.AddConsumer(this);
-//                this.session.Connection.SyncRequest(this.info);
-//
-//                if(this.session.Connection.IsStarted)
-//                {
-//                    this.Start();
-//                }
-//            }
-//            catch(Exception)
-//            {
-//                this.session.RemoveConsumer(this.info.ConsumerId);
-//                throw;
-//            }
 		}
 
 		~MessageConsumer()

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/QueueBrowser.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/QueueBrowser.cs?rev=925204&r1=925203&r2=925204&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/QueueBrowser.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/QueueBrowser.cs Fri
Mar 19 12:59:12 2010
@@ -34,6 +34,7 @@ namespace Apache.NMS.ActiveMQ
 		private readonly string selector;
 
 		private MessageConsumer consumer;
+		private bool disposed;
 		private bool closed;
 		private readonly ConsumerId consumerId;
 		private readonly Atomic<bool> browseDone = new Atomic<bool>(true);
@@ -50,7 +51,41 @@ namespace Apache.NMS.ActiveMQ
 			this.dispatchAsync = dispatchAsync;
 			this.consumer = CreateConsumer();
 		}
+		
+		~QueueBrowser()
+		{
+		}
+
+		public void Dispose()
+		{
+			Dispose(true);
+			GC.SuppressFinalize(this);
+		}
+
+		protected void Dispose(bool disposing)
+		{
+			if(disposed)
+			{
+				return;
+			}
 
+			if(disposing)
+			{
+				// Dispose managed code here.
+			}
+
+			try
+			{
+				Close();
+			}
+			catch
+			{
+				// Ignore network errors.
+			}
+
+			disposed = true;
+		}
+		
 		private MessageConsumer CreateConsumer()
 		{
             this.browseDone.Value = false;



Mime
View raw message