[jboss-cvs] JBoss Messaging SVN: r5249 - in trunk: src/main/org/jboss/messaging/core/server/impl and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Nov 3 14:01:37 EST 2008


Author: timfox
Date: 2008-11-03 14:01:36 -0500 (Mon, 03 Nov 2008)
New Revision: 5249

Modified:
   trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
   trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/MultiThreadRandomFailoverTest.java
Log:
More tweaks


Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2008-11-03 17:33:11 UTC (rev 5248)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2008-11-03 19:01:36 UTC (rev 5249)
@@ -215,8 +215,6 @@
     * */
    public Page depage() throws Exception
    {
-      validateInit();
-
       positioningGlobalLock.acquire(); // Can't change currentPage or any of ids
                                        // without a global lock
       lock.writeLock().lock(); // Wait pending writes to finish before
@@ -282,8 +280,6 @@
 
    public boolean page(final PageMessage message) throws Exception
    {
-      validateInit();
-
       // Max-size is set, but reject is activated, what means.. never page on
       // this address
       if (dropMessagesOnSize)
@@ -359,8 +355,6 @@
 
    public void sync() throws Exception
    {
-      validateInit();
-
       lock.readLock().lock();
 
       try
@@ -502,8 +496,6 @@
 
    public boolean startPaging() throws Exception
    {
-      validateInit();
-
       // First check without any global locks.
       // (Faster)
       lock.readLock().lock();
@@ -545,7 +537,6 @@
 
    public void forceAnotherPage() throws Exception
    {
-      validateInit();
       openNewPage();
    }
 
@@ -630,14 +621,6 @@
       return Integer.parseInt(fileName.substring(0, fileName.indexOf('.')));
    }
 
-   private void validateInit()
-   {
-      if (!initialized)
-      {
-         throw new IllegalStateException("PagingStore " + storeName + " not initialized!");
-      }
-   }
-
    // Inner classes -------------------------------------------------
 
    class DepageRunnable implements Runnable

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java	2008-11-03 17:33:11 UTC (rev 5248)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java	2008-11-03 19:01:36 UTC (rev 5249)
@@ -101,6 +101,8 @@
    private final java.util.Queue<MessageReference> deliveringRefs = new ConcurrentLinkedQueue<MessageReference>();
 
    private final Channel channel;
+   
+   private volatile boolean closed;
 
    // Constructors
    // ---------------------------------------------------------------------------------
@@ -251,6 +253,8 @@
 
       Iterator<MessageReference> iter = refs.iterator();
 
+      closed = true;
+      
       while (iter.hasNext())
       {
          MessageReference ref = iter.next();
@@ -332,7 +336,8 @@
          {
             throw new IllegalStateException("Could not find reference with id " + messageID +
                                             " backup " +
-                                            messageQueue.isBackup());
+                                            messageQueue.isBackup() + 
+                                            " closed " + closed);
          }
       }
       while (ref.getMessage().getMessageID() != messageID);

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/MultiThreadRandomFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/MultiThreadRandomFailoverTest.java	2008-11-03 17:33:11 UTC (rev 5248)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/MultiThreadRandomFailoverTest.java	2008-11-03 19:01:36 UTC (rev 5249)
@@ -1194,7 +1194,7 @@
 
    protected int getNumIterations()
    {
-      return 50;
+      return 20;
    }
 
    protected void setUp() throws Exception




More information about the jboss-cvs-commits mailing list