activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r635932 - in /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors: StoreDurableSubscriberCursor.java StoreQueueCursor.java
Date Tue, 11 Mar 2008 14:05:21 GMT
Author: rajdavies
Date: Tue Mar 11 07:05:20 2008
New Revision: 635932

URL: http://svn.apache.org/viewvc?rev=635932&view=rev
Log:
Don't use FilePendingMessageCursor if persitence is off

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.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/StoreDurableSubscriberCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java?rev=635932&r1=635931&r2=635932&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/StoreDurableSubscriberCursor.java
Tue Mar 11 07:05:20 2008
@@ -64,7 +64,16 @@
         this.subscription=subscription;
         this.clientId = clientId;
         this.subscriberName = subscriberName;
-        this.nonPersistent = new FilePendingMessageCursor(broker,clientId + subscriberName);
+        if (broker.getBrokerService().isPersistent()) {
+            this.nonPersistent = new FilePendingMessageCursor(broker,clientId + subscriberName);
+        }else {
+            this.nonPersistent = new VMPendingMessageCursor();
+        }
+        this.nonPersistent.setMaxBatchSize(getMaxBatchSize());
+        this.nonPersistent.setSystemUsage(systemUsage);
+        this.nonPersistent.setEnableAudit(isEnableAudit());
+        this.nonPersistent.setMaxAuditDepth(getMaxAuditDepth());
+        this.nonPersistent.setMaxProducersToAudit(getMaxProducersToAudit());
         this.storePrefetches.add(this.nonPersistent);
     }
 
@@ -180,7 +189,6 @@
     }
 
     public synchronized void clear() {
-        nonPersistent.clear();
         for (PendingMessageCursor tsp : storePrefetches) {
             tsp.clear();
         }
@@ -267,9 +275,6 @@
         for (PendingMessageCursor cursor : storePrefetches) {
             cursor.setMaxAuditDepth(maxAuditDepth);
         }
-        if (nonPersistent != null) {
-            nonPersistent.setMaxProducersToAudit(maxProducersToAudit);
-        }
     }
 
     public synchronized void setMaxAuditDepth(int maxAuditDepth) {
@@ -277,9 +282,6 @@
         for (PendingMessageCursor cursor : storePrefetches) {
             cursor.setMaxAuditDepth(maxAuditDepth);
         }
-        if (nonPersistent != null) {
-            nonPersistent.setMaxAuditDepth(maxAuditDepth);
-        }
     }
     
     public synchronized void setEnableAudit(boolean enableAudit) {
@@ -287,9 +289,6 @@
         for (PendingMessageCursor cursor : storePrefetches) {
             cursor.setEnableAudit(enableAudit);
         }
-        if (nonPersistent != null) {
-            nonPersistent.setEnableAudit(enableAudit);
-        }
     }
     
     public synchronized void setUseCache(boolean useCache) {
@@ -297,9 +296,6 @@
         for (PendingMessageCursor cursor : storePrefetches) {
             cursor.setUseCache(useCache);
         }
-        if (nonPersistent != null) {
-            nonPersistent.setUseCache(useCache);
-        }
     }
     
     /**
@@ -310,9 +306,6 @@
         super.dispatched(message);
         for (PendingMessageCursor cursor : storePrefetches) {
             cursor.dispatched(message);
-        }
-        if (nonPersistent != null) {
-            nonPersistent.dispatched(message);
         }
     }
 

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=635932&r1=635931&r2=635932&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
Tue Mar 11 07:05:20 2008
@@ -59,7 +59,11 @@
         started = true;
         super.start();
         if (nonPersistent == null) {
-            nonPersistent = new FilePendingMessageCursor(broker,queue.getName());
+            if (broker.getBrokerService().isPersistent()) {
+                nonPersistent = new FilePendingMessageCursor(broker,queue.getName());
+            }else {
+                nonPersistent = new VMPendingMessageCursor();
+            }
             nonPersistent.setMaxBatchSize(getMaxBatchSize());
             nonPersistent.setSystemUsage(systemUsage);
             nonPersistent.setEnableAudit(isEnableAudit());



Mime
View raw message