[hornetq-commits] JBoss hornetq SVN: r9859 - in branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor: impl and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Tue Nov 9 14:42:53 EST 2010


Author: clebert.suconic at jboss.com
Date: 2010-11-09 14:42:52 -0500 (Tue, 09 Nov 2010)
New Revision: 9859

Modified:
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageCursorProvider.java
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
   branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
Log:
tweak

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageCursorProvider.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageCursorProvider.java	2010-11-09 19:27:38 UTC (rev 9858)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PageCursorProvider.java	2010-11-09 19:42:52 UTC (rev 9859)
@@ -39,7 +39,7 @@
 
    PageCache getPageCache(PagePosition pos);
    
-   PagedReference newReference(final PagePosition pos, final PagedMessage msg);
+   PagedReference newReference(final PagePosition pos, final PagedMessage msg, PageSubscription sub);
    
    void addPageCache(PageCache cache);
 

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java	2010-11-09 19:27:38 UTC (rev 9858)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/PagedReferenceImpl.java	2010-11-09 19:42:52 UTC (rev 9859)
@@ -28,38 +28,37 @@
  */
 public class PagedReferenceImpl implements PagedReference
 {
-   
+
    private static final long serialVersionUID = -8640232251318264710L;
 
-   private PagePosition a;
-   private PagedMessage b;
+   private final PagePosition position;
+
+   private final PagedMessage message;
    
-   private Queue queue;
-   
-   private PageSubscription subscription;
-   
-   
+   private final PageSubscription subscription;
+
    public ServerMessage getMessage()
    {
-      return b.getMessage();
+      return message.getMessage();
    }
-   
+
    public PagedMessage getPagedMessage()
    {
-      return b;
+      return message;
    }
-   
+
    public PagePosition getPosition()
    {
-      return a;
+      return position;
    }
 
-   public PagedReferenceImpl(PagePosition a, PagedMessage b)
+   public PagedReferenceImpl(final PagePosition position, final PagedMessage message, final PageSubscription subscription)
    {
-      this.a = a;
-      this.b = b;
+      this.position = position;
+      this.message = message;
+      this.subscription = subscription;
    }
-   
+
    public boolean isPaged()
    {
       return true;
@@ -68,7 +67,7 @@
    /* (non-Javadoc)
     * @see org.hornetq.core.server.MessageReference#copy(org.hornetq.core.server.Queue)
     */
-   public MessageReference copy(Queue queue)
+   public MessageReference copy(final Queue queue)
    {
       // TODO Auto-generated method stub
       return null;
@@ -86,10 +85,10 @@
    /* (non-Javadoc)
     * @see org.hornetq.core.server.MessageReference#setScheduledDeliveryTime(long)
     */
-   public void setScheduledDeliveryTime(long scheduledDeliveryTime)
+   public void setScheduledDeliveryTime(final long scheduledDeliveryTime)
    {
       // TODO Auto-generated method stub
-      
+
    }
 
    /* (non-Javadoc)
@@ -104,10 +103,10 @@
    /* (non-Javadoc)
     * @see org.hornetq.core.server.MessageReference#setDeliveryCount(int)
     */
-   public void setDeliveryCount(int deliveryCount)
+   public void setDeliveryCount(final int deliveryCount)
    {
       // TODO Auto-generated method stub
-      
+
    }
 
    /* (non-Javadoc)
@@ -116,7 +115,7 @@
    public void incrementDeliveryCount()
    {
       // TODO Auto-generated method stub
-      
+
    }
 
    /* (non-Javadoc)
@@ -125,7 +124,7 @@
    public void decrementDeliveryCount()
    {
       // TODO Auto-generated method stub
-      
+
    }
 
    /* (non-Javadoc)
@@ -133,8 +132,7 @@
     */
    public Queue getQueue()
    {
-      // TODO Auto-generated method stub
-      return null;
+      return subscription.getQueue();
    }
 
    /* (non-Javadoc)
@@ -142,8 +140,7 @@
     */
    public void handled()
    {
-      // TODO Auto-generated method stub
-      
+      getQueue().referenceHandled();
    }
 
    /* (non-Javadoc)
@@ -151,16 +148,14 @@
     */
    public void acknowledge() throws Exception
    {
-      // TODO Auto-generated method stub
-      
+      subscription.ack(this);
    }
 
    /* (non-Javadoc)
     * @see org.hornetq.core.server.MessageReference#acknowledge(org.hornetq.core.transaction.Transaction)
     */
-   public void acknowledge(Transaction tx) throws Exception
+   public void acknowledge(final Transaction tx) throws Exception
    {
-      // TODO Auto-generated method stub
-      
+      subscription.ackTx(tx, this);
    }
 }

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2010-11-09 19:27:38 UTC (rev 9858)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageCursorProviderImpl.java	2010-11-09 19:42:52 UTC (rev 9859)
@@ -128,7 +128,7 @@
 
       while (true)
       {
-         PagedReference retPos = internalGetNext(cursorPos);
+         PagedReference retPos = internalGetNext(cursorPos, cursor);
 
          if (retPos == null)
          {
@@ -183,7 +183,7 @@
       return false;
    }
 
-   private PagedReference internalGetNext(final PagePosition pos)
+   private PagedReference internalGetNext(final PagePosition pos, final PageSubscription sub)
    {
       PagePosition retPos = pos.nextMessage();
 
@@ -210,7 +210,7 @@
 
       if (serverMessage != null)
       {
-         return newReference(retPos, serverMessage);
+         return newReference(retPos, serverMessage, sub);
       }
       else
       {
@@ -231,9 +231,9 @@
       return cache.getMessage(pos.getMessageNr());
    }
    
-   public PagedReference newReference(final PagePosition pos, final PagedMessage msg)
+   public PagedReference newReference(final PagePosition pos, final PagedMessage msg, final PageSubscription subscription)
    {
-      return new PagedReferenceImpl(pos, msg);
+      return new PagedReferenceImpl(pos, msg, subscription);
    }
 
    /**

Modified: branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java
===================================================================
--- branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2010-11-09 19:27:38 UTC (rev 9858)
+++ branches/Branch_New_Paging/src/main/org/hornetq/core/paging/cursor/impl/PageSubscriptionImpl.java	2010-11-09 19:42:52 UTC (rev 9859)
@@ -282,7 +282,7 @@
 
    private PagedReference getReference(PagePosition pos) throws Exception
    {
-      return cursorProvider.newReference(pos, cursorProvider.getMessage(pos));
+      return cursorProvider.newReference(pos, cursorProvider.getMessage(pos), this);
    }
 
    /* (non-Javadoc)



More information about the hornetq-commits mailing list