activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1306865 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java
Date Thu, 29 Mar 2012 13:43:19 GMT
Author: gtully
Date: Thu Mar 29 13:43:18 2012
New Revision: 1306865

URL: http://svn.apache.org/viewvc?rev=1306865&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3473: add defensive null check for brokerservice
and region broker in case of dup detection during initalisation or partially initialised test,
pa is always eagerly created

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java?rev=1306865&r1=1306864&r2=1306865&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/kahadb/KahaDBStore.java
Thu Mar 29 13:43:18 2012
@@ -287,11 +287,15 @@ public class KahaDBStore extends Message
 
     @Override
     void rollbackStatsOnDuplicate(KahaDestination commandDestination) {
-        RegionBroker regionBroker = (RegionBroker) brokerService.getRegionBroker();
-        Set<Destination> destinationSet = regionBroker.getDestinations(convert(commandDestination));
-        for (Destination destination : destinationSet) {
-            destination.getDestinationStatistics().getMessages().decrement();
-            destination.getDestinationStatistics().getEnqueues().decrement();
+        if (brokerService != null) {
+            RegionBroker regionBroker = (RegionBroker) brokerService.getRegionBroker();
+            if (regionBroker != null) {
+                Set<Destination> destinationSet = regionBroker.getDestinations(convert(commandDestination));
+                for (Destination destination : destinationSet) {
+                    destination.getDestinationStatistics().getMessages().decrement();
+                    destination.getDestinationStatistics().getEnqueues().decrement();
+                }
+            }
         }
     }
 



Mime
View raw message