activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r641027 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java
Date Tue, 25 Mar 2008 21:51:39 GMT
Author: chirino
Date: Tue Mar 25 14:51:37 2008
New Revision: 641027

URL: http://svn.apache.org/viewvc?rev=641027&view=rev
Log:
Decrement the message reference when the messages are removed from the vm pending cursor.


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

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java?rev=641027&r1=641026&r2=641027&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/region/cursors/VMPendingMessageCursor.java
Tue Mar 25 14:51:37 2008
@@ -41,9 +41,12 @@
     @Override
     public List<MessageReference> remove(ConnectionContext context, Destination destination)
throws Exception {
         List<MessageReference> rc = new ArrayList<MessageReference>();
-        for (MessageReference r : list) {
+        for (Iterator<MessageReference> iterator = list.iterator(); iterator.hasNext();)
{
+            MessageReference r = iterator.next();
             if( r.getRegionDestination()==destination ) {
+                r.decrementReferenceCount();
                 rc.add(r);
+                iterator.remove();
             }
         }
         return rc ;        



Mime
View raw message