activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r960444 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/policy/SimpleDispatchPolicy.java
Date Mon, 05 Jul 2010 05:06:18 GMT
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;
     }
 



Mime
View raw message