You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2016/01/14 00:24:44 UTC

svn commit: r1724527 - /activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs

Author: jgomes
Date: Wed Jan 13 23:24:44 2016
New Revision: 1724527

URL: http://svn.apache.org/viewvc?rev=1724527&view=rev
Log:
Applied patch from Stephane Ramet to implement QueueBrowser.  Thanks Stephane!
Fixes [AMQNET-517]. (See https://issues.apache.org/jira/browse/AMQNET-517)

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

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs?rev=1724527&r1=1724526&r2=1724527&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs Wed Jan 13 23:24:44 2016
@@ -107,12 +107,37 @@ namespace Apache.NMS.EMS
 			get { return EMSConvert.ToNMSQueue(this.tibcoQueueBrowser.Queue); }
 		}
 
+		internal class Enumerator : IEnumerator
+		{
+			private IEnumerator innerEnumerator;
+
+			public Enumerator(IEnumerator innerEnumerator)
+			{
+				this.innerEnumerator = innerEnumerator;
+			}
+
+			public object Current
+			{
+				get
+				{
+					return EMSConvert.ToNMSMessage((TIBCO.EMS.Message)this.innerEnumerator.Current);
+				}
+			}
+
+			public bool MoveNext()
+			{
+				return this.innerEnumerator.MoveNext();
+			}
+
+			public void Reset()
+			{
+				this.innerEnumerator.Reset();
+			}
+		}
+
 		public IEnumerator GetEnumerator()
 		{
-			// TODO: This enumerator will need to be adapted.  As it is now, the low-level EMS
-			// objects will be enumerated.  We need to wrap these objects into the NMS interface
-			// types to fit into the provider agnostic system.
-			return this.tibcoQueueBrowser.GetEnumerator();
+			return new Enumerator(this.tibcoQueueBrowser.GetEnumerator());
 		}
 	}
 }