activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject svn commit: r924301 - in /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp: Commands/ActiveMQTempDestination.cs Commands/ActiveMQTempQueue.cs Commands/ActiveMQTempTopic.cs Connection.cs
Date Wed, 17 Mar 2010 14:10:52 GMT
Author: tabish
Date: Wed Mar 17 14:10:52 2010
New Revision: 924301

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

Update the STOMP commands to match the changes in the NMS API.

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempDestination.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempQueue.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempTopic.cs
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Connection.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempDestination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempDestination.cs?rev=924301&r1=924300&r2=924301&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempDestination.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempDestination.cs
Wed Mar 17 14:10:52 2010
@@ -16,6 +16,7 @@
  */
 
 using System;
+using Apache.NMS.ActiveMQ;
 
 //
 //  Marshalling code for Open Wire Format for ActiveMQTempDestination
@@ -29,6 +30,7 @@ namespace Apache.NMS.ActiveMQ.Commands
 {
 	public abstract class ActiveMQTempDestination : ActiveMQDestination
 	{
+        private Connection connection;
 
 		/// <summary>
 		/// Method GetDestinationType
@@ -58,16 +60,20 @@ namespace Apache.NMS.ActiveMQ.Commands
 
 		public const byte ID_ActiveMQTempDestination = 0;
 
-		public ActiveMQTempDestination()
-			: base()
+		public ActiveMQTempDestination() : base()
 		{
 		}
 
-		public ActiveMQTempDestination(String name)
-			: base(name)
+		public ActiveMQTempDestination(String name) : base(name)
 		{
 		}
 
+        public Connection Connection
+        {
+            get { return this.connection; }
+            set { this.connection = value; }
+        }
+
 		public override byte GetDataStructureType()
 		{
 			return ID_ActiveMQTempDestination;
@@ -88,6 +94,14 @@ namespace Apache.NMS.ActiveMQ.Commands
 			return o;
 		}
 
+        public void Delete()
+        {
+            if(this.connection != null)
+            {
+                this.connection.DeleteTemporaryDestination(this);
+            }
+        }
+
 	}
 }
 

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempQueue.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempQueue.cs?rev=924301&r1=924300&r2=924301&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempQueue.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempQueue.cs
Wed Mar 17 14:10:52 2010
@@ -31,8 +31,7 @@ namespace Apache.NMS.ActiveMQ.Commands
         {
         }
 
-        public ActiveMQTempQueue(String name)
-            : base(name)
+        public ActiveMQTempQueue(String name) : base(name)
         {
         }
 
@@ -43,6 +42,11 @@ namespace Apache.NMS.ActiveMQ.Commands
                 return DestinationType.TemporaryQueue;
             }
         }
+        
+        public String QueueName
+        {
+            get { return PhysicalName; }
+        }
 
         public String GetQueueName()
         {

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempTopic.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempTopic.cs?rev=924301&r1=924300&r2=924301&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempTopic.cs
(original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Commands/ActiveMQTempTopic.cs
Wed Mar 17 14:10:52 2010
@@ -26,13 +26,11 @@ namespace Apache.NMS.ActiveMQ.Commands
     {
         public const byte ID_ACTIVEMQTEMPTOPIC = 103;
 
-        public ActiveMQTempTopic()
-            : base()
+        public ActiveMQTempTopic() : base()
         {
         }
 
-        public ActiveMQTempTopic(String name)
-            : base(name)
+        public ActiveMQTempTopic(String name) : base(name)
         {
         }
 
@@ -44,7 +42,11 @@ namespace Apache.NMS.ActiveMQ.Commands
             }
         }
 
-
+        public String TopicName
+        {
+            get { return PhysicalName; }
+        }
+            
         public String GetTopicName()
         {
             return PhysicalName;

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=924301&r1=924300&r2=924301&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 Mar
17 14:10:52 2010
@@ -708,7 +708,8 @@ namespace Apache.NMS.ActiveMQ
                     IDispatcher dispatcher = (IDispatcher) dispatchers[dispatch.ConsumerId];
 
                     // Can be null when a consumer has sent a MessagePull and there was
-                    // no available message at the broker to dispatch.
+                    // no available message at the broker to dispatch or when signalled
+                    // that the end of a Queue browse has been reached.
                     if(dispatch.Message != null)
                     {
                         dispatch.Message.ReadOnlyBody = true;
@@ -850,5 +851,21 @@ namespace Apache.NMS.ActiveMQ
             answer.SessionId = sessionId;
             return answer;
         }
+
+        public void DeleteTemporaryDestination(IDestination destination)
+        {
+            this.DeleteDestination(destination);
+        }
+
+        public void DeleteDestination(IDestination destination)
+        {
+            DestinationInfo command = new DestinationInfo();
+            command.ConnectionId = this.ConnectionId;
+            command.OperationType = DestinationInfo.REMOVE_OPERATION_TYPE; // 1 is remove
+            command.Destination = (ActiveMQDestination) destination;
+
+            this.Oneway(command);
+        }
+
     }
 }



Mime
View raw message