You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2010/07/05 07:06:18 UTC

svn commit: r960444 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java

Author: rajdavies
Date: Mon Jul  5 05:06:18 2010
New Revision: 960444

URL: http://svn.apache.org/viewvc?rev=960444&view=rev
Log:
removed unnecessary synchronization around dispatch list

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java?rev=960444&r1=960443&r2=960444&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java (original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java Mon Jul  5 05:06:18 2010
@@ -16,7 +16,6 @@
  */
 package org.apache.activemq.broker.region.policy;
 
-import java.util.Iterator;
 import java.util.List;
 import org.apache.activemq.broker.region.MessageReference;
 import org.apache.activemq.broker.region.Subscription;
@@ -31,25 +30,24 @@ import org.apache.activemq.filter.Messag
  */
 public class SimpleDispatchPolicy implements DispatchPolicy {
 
-    public boolean dispatch(MessageReference node,MessageEvaluationContext msgContext, List<Subscription> consumers)
+    public boolean dispatch(MessageReference node, MessageEvaluationContext msgContext, List<Subscription> consumers)
             throws Exception {
 
         int count = 0;
-        synchronized (consumers) {
-            for (Subscription sub:consumers) {
-                // Don't deliver to browsers
-                if (sub.getConsumerInfo().isBrowser()) {
-                    continue;
-                }
-                // Only dispatch to interested subscriptions
-                if (!sub.matches(node, msgContext)) {
-                    continue;
-                }
-
-                sub.add(node);
-                count++;
+        for (Subscription sub : consumers) {
+            // Don't deliver to browsers
+            if (sub.getConsumerInfo().isBrowser()) {
+                continue;
+            }
+            // Only dispatch to interested subscriptions
+            if (!sub.matches(node, msgContext)) {
+                continue;
             }
+
+            sub.add(node);
+            count++;
         }
+
         return count > 0;
     }