activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r821933 - in /activemq/activemq-dotnet: Apache.NMS.EMS/trunk/ Apache.NMS.EMS/trunk/src/main/csharp/ Apache.NMS.MSMQ/trunk/src/main/csharp/ Apache.NMS/trunk/src/main/csharp/
Date Mon, 05 Oct 2009 17:48:09 GMT
Author: jgomes
Date: Mon Oct  5 17:48:09 2009
New Revision: 821933

URL: http://svn.apache.org/viewvc?rev=821933&view=rev
Log:
Fixed type on API name for QueueBrowser.
Added partial implementation of QueueBrowser support for EMS provider.
Added stubbed implementation of QueueBrowser for MSMQ provider.
Fixes [AMQNET-97]. (See https://issues.apache.org/activemq/browse/AMQNET-97)

Added:
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs
      - copied, changed from r821908, activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Queue.cs
Modified:
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Session.cs
    activemq/activemq-dotnet/Apache.NMS.EMS/trunk/vs2008-ems.csproj
    activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IQueueBrowser.cs

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs?rev=821933&r1=821932&r2=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/EMSConvert.cs Mon Oct  5
17:48:09 2009
@@ -52,13 +52,20 @@
 							: null);
 		}
 
-		public static Apache.NMS.IQueue ToNMSQueue(TIBCO.EMS.Queue tibcoQueue)
+		public static Apache.NMS.IQueueBrowser ToNMSQueueBrowser(TIBCO.EMS.QueueBrowser tibcoQueueBrowser)
 		{
-			return (null != tibcoQueue
-							? new Apache.NMS.EMS.Queue(tibcoQueue)
+			return (null != tibcoQueueBrowser
+							? new Apache.NMS.EMS.QueueBrowser(tibcoQueueBrowser)
 							: null);
-		}
-
+		}
+
+		public static Apache.NMS.IQueue ToNMSQueue(TIBCO.EMS.Queue tibcoQueue)
+		{
+			return (null != tibcoQueue
+							? new Apache.NMS.EMS.Queue(tibcoQueue)
+							: null);
+		}
+		
 		public static Apache.NMS.ITopic ToNMSTopic(TIBCO.EMS.Topic tibcoTopic)
 		{
 			return (null != tibcoTopic

Copied: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs (from
r821908, activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Queue.cs)
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs?p2=activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs&p1=activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Queue.cs&r1=821908&r2=821933&rev=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Queue.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/QueueBrowser.cs Mon Oct
 5 17:48:09 2009
@@ -15,52 +15,40 @@
  * limitations under the License.
  */
 
+using System.Collections;
+
 namespace Apache.NMS.EMS
 {
-	public class Queue : Apache.NMS.EMS.Destination, Apache.NMS.IQueue
+	public class QueueBrowser : Apache.NMS.IQueueBrowser
 	{
-		public TIBCO.EMS.Queue tibcoQueue
-		{
-			get { return this.tibcoDestination as TIBCO.EMS.Queue; }
-			set { this.tibcoDestination = value; }
-		}
-
-		public Queue(TIBCO.EMS.Queue queue)
-			: base(queue)
-		{
-		}
-
-		#region IQueue Members
+		public TIBCO.EMS.QueueBrowser tibcoQueueBrowser;
 
-		public string QueueName
+		public QueueBrowser(TIBCO.EMS.QueueBrowser queueBrowser)
 		{
-			get { return this.tibcoQueue.QueueName; }
+			this.tibcoQueueBrowser = queueBrowser;
 		}
 
-		#endregion
-
-		#region IDestination Members
-
-		public Apache.NMS.DestinationType DestinationType
+		public void  Close()
 		{
-			get { return Apache.NMS.DestinationType.Queue; }
+			this.tibcoQueueBrowser.Close();
 		}
 
-		public bool IsTopic
+		public string MessageSelector
 		{
-			get { return false; }
+			get { return this.tibcoQueueBrowser.MessageSelector; }
 		}
 
-		public bool IsQueue
+		public IQueue Queue
 		{
-			get { return true; }
+			get { return EMSConvert.ToNMSQueue(this.tibcoQueueBrowser.Queue); }
 		}
 
-		public bool IsTemporary
+		public IEnumerator GetEnumerator()
 		{
-			get { return false; }
+			// 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();
 		}
-
-		#endregion
 	}
-}
\ No newline at end of file
+}

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Session.cs?rev=821933&r1=821932&r2=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/src/main/csharp/Session.cs Mon Oct  5 17:48:09
2009
@@ -84,6 +84,20 @@
 			this.tibcoSession.Unsubscribe(name);
 		}
 
+		public IQueueBrowser CreateBrowser(IQueue queue)
+		{
+			Apache.NMS.EMS.Queue queueObj = (Apache.NMS.EMS.Queue) queue;
+
+			return EMSConvert.ToNMSQueueBrowser(this.tibcoSession.CreateBrowser(queueObj.tibcoQueue));
+		}
+
+		public IQueueBrowser CreateBrowser(IQueue queue, string selector)
+		{
+			Apache.NMS.EMS.Queue queueObj = (Apache.NMS.EMS.Queue) queue;
+
+			return EMSConvert.ToNMSQueueBrowser(this.tibcoSession.CreateBrowser(queueObj.tibcoQueue,
selector));
+		}
+
 		public Apache.NMS.IQueue GetQueue(string name)
 		{
 			return EMSConvert.ToNMSQueue(this.tibcoSession.CreateQueue(name));

Modified: activemq/activemq-dotnet/Apache.NMS.EMS/trunk/vs2008-ems.csproj
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.EMS/trunk/vs2008-ems.csproj?rev=821933&r1=821932&r2=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.EMS/trunk/vs2008-ems.csproj (original)
+++ activemq/activemq-dotnet/Apache.NMS.EMS/trunk/vs2008-ems.csproj Mon Oct  5 17:48:09 2009
@@ -71,6 +71,7 @@
     <Compile Include="src\main\csharp\CommonAssemblyInfo.cs" />
     <Compile Include="src\main\csharp\Connection.cs" />
     <Compile Include="src\main\csharp\ConnectionFactory.cs" />
+    <Compile Include="src\main\csharp\QueueBrowser.cs" />
     <Compile Include="src\main\csharp\Destination.cs" />
     <Compile Include="src\main\csharp\Dispatcher.cs" />
     <Compile Include="src\main\csharp\EMSConvert.cs" />

Modified: activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs?rev=821933&r1=821932&r2=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.MSMQ/trunk/src/main/csharp/Session.cs Mon Oct  5 17:48:09
2009
@@ -88,6 +88,16 @@
 			throw new NotSupportedException("Durable Topic subscribers are not supported by MSMQ");
 		}
 
+		public IQueueBrowser CreateBrowser(IQueue queue)
+		{
+			throw new NotImplementedException();
+		}
+
+		public IQueueBrowser CreateBrowser(IQueue queue, string selector)
+		{
+			throw new NotImplementedException();
+		}
+
 		public IQueue GetQueue(string name)
 		{
 			return new Queue(name);

Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IQueueBrowser.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IQueueBrowser.cs?rev=821933&r1=821932&r2=821933&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IQueueBrowser.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/IQueueBrowser.cs Mon Oct  5
17:48:09 2009
@@ -57,7 +57,7 @@
         /// If NMS Provider fails to retrieve the IQueue associated with the Browser
         /// doe to some internal error.
         /// </exception>
-        IQueue Qeuue { get; }
+        IQueue Queue { get; }
 
     }
 }



Mime
View raw message