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 2011/12/15 17:03:19 UTC

svn commit: r1214825 - /activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs

Author: tabish
Date: Thu Dec 15 16:03:19 2011
New Revision: 1214825

URL: http://svn.apache.org/viewvc?rev=1214825&view=rev
Log:
Add an additional utility method for temp dests

Modified:
    activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs

Modified: activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs?rev=1214825&r1=1214824&r2=1214825&view=diff
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs (original)
+++ activemq/activemq-dotnet/Apache.NMS.ActiveMQ/trunk/src/main/csharp/Util/AdvisorySupport.cs Thu Dec 15 16:03:19 2011
@@ -280,6 +280,28 @@ namespace Apache.NMS.ActiveMQ
             return IsDestinationAdvisoryTopic(ActiveMQDestination.Transform(destination));
         }
 
+        public static bool IsTempDestinationAdvisoryTopic(ActiveMQDestination destination)
+        {
+            if (destination.IsComposite)
+            {
+                ActiveMQDestination[] compositeDestinations = destination.GetCompositeDestinations();
+                bool containsNonTempDests = false;
+                for (int i = 0; i < compositeDestinations.Length; i++)
+                {
+                    if (!IsTempDestinationAdvisoryTopic(compositeDestinations[i]))
+                    {
+                        containsNonTempDests = true;
+                    }
+                }
+                return !containsNonTempDests;
+            }
+            else
+            {
+                return destination.Equals(TEMP_QUEUE_ADVISORY_TOPIC) ||
+                       destination.Equals(TEMP_TOPIC_ADVISORY_TOPIC);
+            }
+        }
+
         public static bool IsDestinationAdvisoryTopic(ActiveMQDestination destination)
         {
             if (destination.IsComposite)