activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [03/29] git commit: https://issues.apache.org/jira/browse/AMQ-4995 - more fixes
Date Thu, 20 Mar 2014 17:44:14 GMT
https://issues.apache.org/jira/browse/AMQ-4995 - more fixes


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/b1a01259
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/b1a01259
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/b1a01259

Branch: refs/heads/activemq-5.9
Commit: b1a01259603049c51f2efa0e4a1e8b5fc6624609
Parents: 008698c
Author: Dejan Bosanac <dejan@nighttale.net>
Authored: Tue Jan 28 16:08:53 2014 +0100
Committer: Hadrian Zbarcea <hadrian@apache.org>
Committed: Thu Mar 20 13:02:24 2014 -0400

----------------------------------------------------------------------
 .../activemq/broker/region/AbstractRegion.java  | 25 +++++++++++++-------
 .../plugin/RuntimeConfigurationBroker.java      |  5 ++--
 2 files changed, 19 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/b1a01259/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
index 7f7b7e4..2d1171d 100755
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
@@ -583,16 +583,23 @@ public abstract class AbstractRegion implements Region {
     }
 
     public void reapplyInterceptor() {
-        DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor();
-        Map<ActiveMQDestination, Destination> map = getDestinationMap();
-        for (ActiveMQDestination key : map.keySet()) {
-            Destination destination = map.get(key);
-            if (destination instanceof CompositeDestinationFilter) {
-                destination = ((CompositeDestinationFilter)destination).next;
+        destinationsLock.writeLock().lock();
+        try {
+            DestinationInterceptor destinationInterceptor = broker.getDestinationInterceptor();
+            Map<ActiveMQDestination, Destination> map = getDestinationMap();
+            for (ActiveMQDestination key : map.keySet()) {
+                Destination destination = map.get(key);
+                if (destination instanceof CompositeDestinationFilter) {
+                    destination = ((CompositeDestinationFilter) destination).next;
+                }
+                if (destinationInterceptor != null) {
+                    destination = destinationInterceptor.intercept(destination);
+                }
+                getDestinationMap().put(key, destination);
+                destinations.put(key, destination);
             }
-            destination = destinationInterceptor.intercept(destination);
-            getDestinationMap().put(key, destination);
-            destinations.put(key, destination);
+        } finally {
+            destinationsLock.writeLock().unlock();
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/activemq/blob/b1a01259/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
----------------------------------------------------------------------
diff --git a/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
b/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
index 01072b1..dba013c 100644
--- a/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
+++ b/activemq-runtime-config/src/main/java/org/apache/activemq/plugin/RuntimeConfigurationBroker.java
@@ -552,6 +552,7 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
                 public void run() {
 
                     boolean updatedExistingInterceptor = false;
+                    RegionBroker regionBroker = (RegionBroker) getBrokerService().getRegionBroker();
 
                     for (DestinationInterceptor destinationInterceptor : getBrokerService().getDestinationInterceptors())
{
                         if (destinationInterceptor instanceof VirtualDestinationInterceptor)
{
@@ -577,11 +578,11 @@ public class RuntimeConfigurationBroker extends BrokerFilter {
 
                         DestinationInterceptor[] destinationInterceptors = interceptorsList.toArray(new
DestinationInterceptor[]{});
                         getBrokerService().setDestinationInterceptors(destinationInterceptors);
-                        RegionBroker regionBroker = (RegionBroker) getBrokerService().getRegionBroker();
+
                         ((CompositeDestinationInterceptor) regionBroker.getDestinationInterceptor()).setInterceptors(destinationInterceptors);
                         info("applied new: " + interceptorsList);
-                        regionBroker.reapplyInterceptor();
                     }
+                    regionBroker.reapplyInterceptor();
                 }
             });
         } else if (o instanceof DtoPolicyEntry) {


Mime
View raw message