activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r701118 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors: AbstractStoreCursor.java StoreQueueCursor.java
Date Thu, 02 Oct 2008 13:19:08 GMT
Author: gtully
Date: Thu Oct  2 06:19:08 2008
New Revision: 701118

URL: http://svn.apache.org/viewvc?rev=701118&view=rev
Log:
AMQ-1962 - ensure size is not calculated on stop after store has shutdown

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java?rev=701118&r1=701117&r2=701118&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/AbstractStoreCursor.java
Thu Oct  2 06:19:08 2008
@@ -65,8 +65,8 @@
     public final synchronized void stop() throws Exception {
         getSystemUsage().getMemoryUsage().removeUsageListener(this);
         resetBatch();
-        gc();
         super.stop();
+        gc();
     }
 
     
@@ -194,7 +194,11 @@
         batchList.clear();
         batchResetNeeded = true;
         this.cacheEnabled=false;
-        size = getStoreSize();
+        if (isStarted()) { 
+            size = getStoreSize();
+        } else {
+            size = 0;
+        }
     }
     
     protected final synchronized void fillBatch() {

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java?rev=701118&r1=701117&r2=701118&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreQueueCursor.java
Thu Oct  2 06:19:08 2008
@@ -77,13 +77,13 @@
 
     public synchronized void stop() throws Exception {
         started = false;
-        super.stop();
         if (nonPersistent != null) {
             nonPersistent.stop();
             nonPersistent.gc();
         }
         persistent.stop();
         persistent.gc();
+        super.stop();
         pendingCount = 0;
     }
 



Mime
View raw message