You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by gt...@apache.org on 2008/10/02 15:19:08 UTC

svn commit: r701118 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors: AbstractStoreCursor.java StoreQueueCursor.java

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;
     }