activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1207224 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region: AbstractRegion.java Region.java RegionBroker.java
Date Mon, 28 Nov 2011 14:30:47 GMT
Author: gtully
Date: Mon Nov 28 14:30:46 2011
New Revision: 1207224

URL: http://svn.apache.org/viewvc?rev=1207224&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3454 - remove copy of destinationMap in region getDestinationMap
api, return a direct reference to the unerlying concurrent hash map, makes it more efficient
to determine presence of a destination

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java?rev=1207224&r1=1207223&r2=1207224&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/AbstractRegion.java
Mon Nov 28 14:30:46 2011
@@ -254,7 +254,7 @@ public abstract class AbstractRegion imp
     public Map<ActiveMQDestination, Destination> getDestinationMap() {
         destinationsLock.readLock().lock();
         try{
-            return new HashMap<ActiveMQDestination, Destination>(destinations);
+            return destinations;
         } finally {
             destinationsLock.readLock().unlock();
         }

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java?rev=1207224&r1=1207223&r2=1207224&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/Region.java
Mon Nov 28 14:30:46 2011
@@ -67,9 +67,7 @@ public interface Region extends Service 
     void removeDestination(ConnectionContext context, ActiveMQDestination destination, long
timeout) throws Exception;
 
     /**
-     * Returns a copy of the current destinations available in the region
-     * 
-     * @return a copy of the regions currently active at the time of the call with the key
the destination and the value the Destination.
+     * Returns a reference to the concurrent hash map that holds known destinations, do not
modify
      */
     Map<ActiveMQDestination, Destination> getDestinationMap();
     

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java?rev=1207224&r1=1207223&r2=1207224&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/RegionBroker.java
Mon Nov 28 14:30:46 2011
@@ -133,7 +133,7 @@ public class RegionBroker extends EmptyB
 
     @Override
     public Map<ActiveMQDestination, Destination> getDestinationMap() {
-        Map<ActiveMQDestination, Destination> answer = getQueueRegion().getDestinationMap();
+        Map<ActiveMQDestination, Destination> answer = new HashMap<ActiveMQDestination,
Destination>(getQueueRegion().getDestinationMap());
         answer.putAll(getTopicRegion().getDestinationMap());
         return answer;
     }



Mime
View raw message