[jboss-cvs] JBoss Messaging SVN: r6900 - in trunk: docs/user-manual/en/modules and 23 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue May 19 20:17:29 EDT 2009


Author: clebert.suconic at jboss.com
Date: 2009-05-19 20:17:29 -0400 (Tue, 19 May 2009)
New Revision: 6900

Added:
   trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerImplTest.java
Removed:
   trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerITest.java
Modified:
   trunk/docs/reference-guide/en/modules/server-configuration.xml
   trunk/docs/user-manual/en/modules/configuration-index.xml
   trunk/docs/user-manual/en/modules/embedding-jbm.xml
   trunk/docs/user-manual/en/modules/paging.xml
   trunk/examples/jms/paging/server0/jbm-configuration.xml
   trunk/src/config/common/schema/jbm-configuration.xsd
   trunk/src/main/org/jboss/messaging/core/config/Configuration.java
   trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
   trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
   trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
   trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
   trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java
   trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
   trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
   trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
   trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
   trunk/tests/config/ConfigurationTest-full-config.xml
   trunk/tests/jms-tests/config/jbm-configuration.xml
   trunk/tests/src/org/jboss/messaging/tests/integration/client/ExpiryAddressTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/client/LargeMessageTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/client/PagingTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverMultiThreadTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/divert/PersistentDivertTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageCleanupTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageTestBase.java
   trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/xa/BasicXaRecoveryTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
Log:
tweak part II: renaming Paging attributes and tweaks on paging docs

Modified: trunk/docs/reference-guide/en/modules/server-configuration.xml
===================================================================
--- trunk/docs/reference-guide/en/modules/server-configuration.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/docs/reference-guide/en/modules/server-configuration.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -370,8 +370,8 @@
            </varlistentry>
          </variablelist>
       </section>          
-      <section id="paging-global-watermark-size.configuration">
-         <title>paging-global-watermark-size</title>
+      <section id="global-page-size.configuration">
+         <title>global-page-size</title>
          <variablelist>  
            <varlistentry>
              <term>type</term>

Modified: trunk/docs/user-manual/en/modules/configuration-index.xml
===================================================================
--- trunk/docs/user-manual/en/modules/configuration-index.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/docs/user-manual/en/modules/configuration-index.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -237,17 +237,16 @@
                         </row>
                         <row>
                             <entry><link linkend="paging.main.config"
-                                    >paging-global-watermark-size</link></entry>
+                                    >global-page-size</link></entry>
                             <entry>Long</entry>
-                            <entry>JBoss Messaging enters into global page mode as soon as the total
-                                memory consumed by messages hits this value</entry>
+                            <entry>The standard size of a page-file. JBoss Messaging will only read messages when there is enough space to read at least one page file, determined by this value.</entry>
                             <entry>10 * 1024 * 1024</entry>
                         </row>
                         <row>
                             <entry><link linkend="paging.main.config"
                                     >paging-max-global-size-bytes</link></entry>
                             <entry>Long</entry>
-                            <entry>The watermark used to determine when we start depaging</entry>
+                            <entry>JBoss Messaging enters into global page mode as soon as the total memory consumed by messages hits this value.</entry>
                             <entry>-1</entry>
                         </row>
                         <row>

Modified: trunk/docs/user-manual/en/modules/embedding-jbm.xml
===================================================================
--- trunk/docs/user-manual/en/modules/embedding-jbm.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/docs/user-manual/en/modules/embedding-jbm.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -41,7 +41,7 @@
         <para>You need to instantiate and start JBoss Messaging server. The class <literal
                 >Messaging</literal> on package <literal>org.jboss.messaging.core.server</literal>
             has a few static methods helpful on instantiating the server, which is aways our
-            preferable way of instantiating the server.</para>
+            preferable way.</para>
         <programlisting>import org.jboss.messaging.core.server.Messaging;
 import org.jboss.messaging.core.server.MessagingServer;
 

Modified: trunk/docs/user-manual/en/modules/paging.xml
===================================================================
--- trunk/docs/user-manual/en/modules/paging.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/docs/user-manual/en/modules/paging.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -5,38 +5,93 @@
     <para>Messages are regularly routed to their queues, persisted on disk for eventual recovery in
         case of server failure, sent to consumers or kept in memory if the consumers are not ready
         to read the messages.</para>
-    <para>If there are no consumers reading the queues, the memory could build up beyond the memory
-        capacity of the server. We prevent this problem by buffering messages on disk before the
-        used memory gets too high.</para>
-    <para>When in page mode, we store messages into files, before routing at the address level. Each
-        file is called a <literal>page-file</literal>, and each page has a maximum site. When the
-        page-file hits the maximum size, we close that file and open a new page-file.</para>
-    <para>Messages are aways read out of the paging system in batches of pages. We read a file when
-        there is enough space in memory. That means we never depage more messages than it would fit
-        in memory.</para>
-    <para>There are two page modes supported by JBoss Messaging. Global Page Mode (<xref
-            linkend="paging.global.mode"/>) and Address Paging Mode <xref
-            linkend="paging.address.mode"/></para>
+    <para>We compute the size of every message routed and stored in memory. When the total reaches a
+        max configured size JBoss Messaging starts storing messages on disk. As messages are
+        acknowledged and release the memory, we read the page and route messages to the destinations
+        on memory.</para>
+    <para>There are two page modes supported by JBoss Messaging. <link linkend="paging.global.mode"
+            >Global Paging Mode </link> and <link linkend="paging.address.mode">Address Paging Mode
+        </link></para>
     <section>
-        <title>Memory Size</title>
-        <para>We compute a memory estimate for every message stored in memory computing this level
-            both at a global and address level.</para>
+        <title>Page Files</title>
+        <para>Messages are stored per address on the file system. Each address has an individual
+            folder where messages are stored in multiple files (page files). Each file will contain
+            messages up to a max configured size. (<literal>page-size-bytes</literal>). When reading
+            page-files all messages on the page-file are read, routed and the file is deleted as
+            soon as the messages are recovered.</para>
     </section>
     <section id="paging.global.mode">
         <title>Global Paging Mode</title>
-        <para>When the total memory reaches the max configured size, the entire server enters in
-            page mode, JBoss Messaging starts to page messages for every address.</para>
-        <para>As messages are acknowledged, we start recovering them from the disk (we call this
-            operation as depaging) as soon as the memory is bellow a watermark size.</para>
-        <para>The maximum memory is determined by <literal>paging-max-global-size-bytes</literal>,
-            and the watermark is configured by <literal>paging-global-watermark-size</literal>
-                (<xref linkend="paging.main.config"/>). </para>
+        <para>JBoss Messaging enters into Global Paging Model when the total memory used by queues
+            reaches a configured maximum value, determined by <literal><link
+                    linkend="paging.main.config">paging-max-global-size-bytes</link></literal>. </para>
+        <para>When the total memory is greater than <literal>paging-max-global-size-bytes</literal>,
+            JBoss Messaging starts to page messages. When there is space in memory to fit a page
+            file (<literal>global-page-size</literal>) messages are read and routed of the paging
+            file.</para>
+        <section id="paging.main.config">
+            <title>Configuration</title>
+            <para>Global paging parameters are specified on the main configuration file.</para>
+            <programlisting>&lt;configuration xmlns="urn:jboss:messaging"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+xsi:schemaLocation="urn:jboss:messaging /schema/jbm-configuration.xsd">
+
+...
+
+&lt;paging-max-global-size-bytes>20485760&lt;/paging-max-global-size-bytes>
+&lt;paging-global-watermark-size>1048576&lt;/paging-global-watermark-size>
+
+...        </programlisting>
+            <para>
+                <table frame="topbot">
+                    <title/>
+                    <tgroup cols="3">
+                        <colspec colname="c1" colnum="1"/>
+                        <colspec colname="c2" colnum="2"/>
+                        <colspec colname="c3" colnum="3"/>
+                        <thead>
+                            <row>
+                                <entry>Property Name</entry>
+                                <entry>Description</entry>
+                                <entry>Default</entry>
+                            </row>
+                        </thead>
+                        <tbody>
+                            <row>
+                                <entry><literal>paging-directory</literal></entry>
+                                <entry>Where page files are stored. JBoss Messaging will create one
+                                    folder for each address being paged under this configured
+                                    location.</entry>
+                                <entry>data/paging</entry>
+                            </row>
+                            <row>
+                                <entry><literal>paging-max-global-size-bytes</literal></entry>
+                                <entry>JBoss Messaging enters into global page mode as soon as the
+                                    total memory consumed by messages hits this value.</entry>
+                                <entry>-1 (disabled)</entry>
+                            </row>
+                            <row>
+                                <entry><literal>global-page-size</literal></entry>
+                                <entry>The standard size of a page-file. JBoss Messaging will only
+                                    read messages when there is enough space to read at least one
+                                    page file, determined by this value.</entry>
+                                <entry>10MiB (10 * 1024 * 1024 bytes)</entry>
+                            </row>
+                        </tbody>
+                    </tgroup>
+                </table>
+            </para>
+        </section>
     </section>
     <section id="paging.address.mode">
         <title>Address Paging Mode</title>
-        <para>It is possible to configured what's the maximum size at any given address. On this
-            case only the destination configured with that maximum size will be in page mode.</para>
-        <programlisting>  &lt;address-settings>
+        <para>It is possible to configured what's the maximum size individually at the address
+            level. As soon as the address is consuming more memory than the maximum configured, that
+            address alone goes into page mode.</para>
+        <section>
+            <title>Configuration</title>
+            <para>Address level config is done at the address settings.</para>
+            <programlisting>  &lt;address-settings>
       &lt;address-setting match="jms.someaddress">
          &lt;max-size-bytes>-1&lt;/max-size-bytes>
          &lt;page-size-bytes>10485760&lt;/page-size-bytes>
@@ -44,107 +99,51 @@
       &lt;/address-setting>
    &lt;/address-settings>
         </programlisting>
-        <para>This is the list of available parameters on the address settings.</para>
-        <para>
-            <table frame="topbot">
-                <title/>
-                <tgroup cols="3">
-                    <colspec colname="c1" colnum="1"/>
-                    <colspec colname="c2" colnum="2"/>
-                    <colspec colname="c3" colnum="3"/>
-                    <thead>
-                        <row>
-                            <entry>Property Name</entry>
-                            <entry>Description</entry>
-                            <entry>Default</entry>
-                        </row>
-                    </thead>
-                    <tbody>
-                        <row>
-                            <entry><literal>max-size</literal></entry>
-                            <entry>What's the max memory the address could have before entering on
-                                page mode.</entry>
-                            <entry>-1 (disabled)</entry>
-                        </row>
-                        <row>
-                            <entry><literal>page-size-bytes</literal></entry>
-                            <entry>The size of each page file used on the paging system</entry>
-                            <entry>10MiB (10 * 1024 * 1024 bytes)</entry>
-                        </row>
-                        <row>
-                            <entry><literal>drop-messages-when-full</literal></entry>
-                            <entry>if true, messages are dropped instead of paged when <literal
-                                    >used-memory</literal> is greater than <literal
-                                    >max-size</literal></entry>
-                            <entry>false</entry>
-                        </row>
-                    </tbody>
-                </tgroup>
-            </table>
-        </para>
-        <section>
-            <title>Configuration</title>
-            <para>All the configuratio for address paging mode is contained into :</para>
+            <para>This is the list of available parameters on the address settings.</para>
+            <para>
+                <table frame="topbot">
+                    <title/>
+                    <tgroup cols="3">
+                        <colspec colname="c1" colnum="1"/>
+                        <colspec colname="c2" colnum="2"/>
+                        <colspec colname="c3" colnum="3"/>
+                        <thead>
+                            <row>
+                                <entry>Property Name</entry>
+                                <entry>Description</entry>
+                                <entry>Default</entry>
+                            </row>
+                        </thead>
+                        <tbody>
+                            <row>
+                                <entry><literal>max-size</literal></entry>
+                                <entry>What's the max memory the address could have before entering
+                                    on page mode.</entry>
+                                <entry>-1 (disabled)</entry>
+                            </row>
+                            <row>
+                                <entry><literal>page-size-bytes</literal></entry>
+                                <entry>The size of each page file used on the paging system</entry>
+                                <entry>10MiB (10 * 1024 * 1024 bytes)</entry>
+                            </row>
+                            <row>
+                                <entry><literal>drop-messages-when-full</literal></entry>
+                                <entry>if true, messages are dropped instead of paged when <literal
+                                        >used-memory</literal> is greater than <literal
+                                        >max-size</literal></entry>
+                                <entry>false</entry>
+                            </row>
+                        </tbody>
+                    </tgroup>
+                </table>
+            </para>
         </section>
     </section>
-    <section id="paging.main.config">
-        <title>Configuration</title>
-        <para>Global paging parameters are specified on the main configuration file.</para>
-        <programlisting>&lt;configuration xmlns="urn:jboss:messaging"
-            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="urn:jboss:messaging /schema/jbm-configuration.xsd">
-
-...
-
-   &lt;paging-max-global-size-bytes>20485760&lt;/paging-max-global-size-bytes>
-   &lt;paging-global-watermark-size>1048576&lt;/paging-global-watermark-size>
-
-...        </programlisting>
-        <para>
-            <table frame="topbot">
-                <title/>
-                <tgroup cols="3">
-                    <colspec colname="c1" colnum="1"/>
-                    <colspec colname="c2" colnum="2"/>
-                    <colspec colname="c3" colnum="3"/>
-                    <thead>
-                        <row>
-                            <entry>Property Name</entry>
-                            <entry>Description</entry>
-                            <entry>Default</entry>
-                        </row>
-                    </thead>
-                    <tbody>
-                        <row>
-                            <entry><literal>paging-directory</literal></entry>
-                            <entry>Where page files are stored. JBoss Messaging will create one
-                                folder for each address being paged under this configured
-                                location.</entry>
-                            <entry>data/paging</entry>
-                        </row>
-                        <row>
-                            <entry><literal>paging-max-global-size-bytes</literal></entry>
-                            <entry>JBoss Messaging enters into global page mode as soon as the total
-                                memory consumed by messages hits this value.(<xref
-                                    linkend="paging.global.mode"/>) </entry>
-                            <entry>-1 (disabled)</entry>
-                        </row>
-                        <row>
-                            <entry><literal>paging-global-watermark-size</literal></entry>
-                            <entry>The watermark used to determine when we start depaging. This
-                                value should be equivalent to a page-file size.</entry>
-                            <entry>10MiB (10 * 1024 * 1024 bytes)</entry>
-                        </row>
-                    </tbody>
-                </tgroup>
-            </table>
-        </para>
-    </section>
     <section>
         <title>Caution with Addresses with Multiple Queues</title>
         <para>When a message is sent to multiple queues, on JMS Topics, or on Addresses with
             multiple queues, the same message is shared as a reference between multiple queues. The
-            message only leaves the memory when it is consumed in all the queus.</para>
+            message only leaves the memory when it is consumed in all the queues.</para>
         <para>For example:</para>
         <itemizedlist>
             <listitem>

Modified: trunk/examples/jms/paging/server0/jbm-configuration.xml
===================================================================
--- trunk/examples/jms/paging/server0/jbm-configuration.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/examples/jms/paging/server0/jbm-configuration.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -23,7 +23,7 @@
 
    <paging-max-global-size-bytes>20485760</paging-max-global-size-bytes>
    
-   <paging-global-watermark-size>1048576</paging-global-watermark-size>
+   <global-page-size>1048576</global-page-size>
 
    <security-settings>
       <!--security for example queue-->

Modified: trunk/src/config/common/schema/jbm-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/jbm-configuration.xsd	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/config/common/schema/jbm-configuration.xsd	2009-05-20 00:17:29 UTC (rev 6900)
@@ -168,7 +168,7 @@
 				<xsd:element name="paging-directory" type="xsd:string"
 					maxOccurs="1" minOccurs="0">
 				</xsd:element>
-				<xsd:element name="paging-global-watermark-size" type="xsd:unsignedLong"
+				<xsd:element name="global-page-size" type="xsd:unsignedLong"
 					maxOccurs="1" minOccurs="0">
 				</xsd:element>
 				<xsd:element name="paging-max-global-size-bytes"

Modified: trunk/src/main/org/jboss/messaging/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -218,9 +218,9 @@
 
    void setPagingMaxGlobalSizeBytes(long maxGlobalSize);
 
-   int getPagingGlobalWatermarkSize();
+   int getGlobalPagingSize();
 
-   void setPagingGlobalWatermarkSize(int pageWatermarkSize);
+   void setGlobalPagingSize(int globalPageSize);
 
    // Large Messages Properties ------------------------------------------------------------
 

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -77,7 +77,7 @@
 
    public static final String DEFAULT_PAGING_DIR = "data/paging";
 
-   public static final int DEFAULT_PAGE_WATERMARK_SIZE = 10 * 1024 * 1024;
+   public static final int DEFAULT_GLOBAL_PAGE_SIZE = 10 * 1024 * 1024;
 
    public static final long DEFAULT_PAGE_MAX_GLOBAL_SIZE = -1;
 
@@ -207,7 +207,7 @@
 
    protected long pagingMaxGlobalSize = DEFAULT_PAGE_MAX_GLOBAL_SIZE;
 
-   protected int pageWatermarkSize = DEFAULT_PAGE_WATERMARK_SIZE;
+   protected int globalPageSize = DEFAULT_GLOBAL_PAGE_SIZE;
 
    protected String pagingDirectory = DEFAULT_PAGING_DIR;
 
@@ -723,17 +723,17 @@
    /* (non-Javadoc)
     * @see org.jboss.messaging.core.config.Configuration#getPagingDefaultSize()
     */
-   public int getPagingGlobalWatermarkSize()
+   public int getGlobalPagingSize()
    {
-      return pageWatermarkSize;
+      return globalPageSize;
    }
 
    /* (non-Javadoc)
     * @see org.jboss.messaging.core.config.Configuration#setPagingDefaultSize(long)
     */
-   public void setPagingGlobalWatermarkSize(final int pageSize)
+   public void setGlobalPagingSize(final int pageSize)
    {
-      pageWatermarkSize = pageSize;
+      globalPageSize = pageSize;
    }
 
    public String getLargeMessagesDirectory()
@@ -832,6 +832,6 @@
              cother.getScheduledThreadPoolMaxSize() == getScheduledThreadPoolMaxSize() &&
              cother.getSecurityInvalidationInterval() == getSecurityInvalidationInterval() &&
              cother.getManagementAddress().equals(getManagementAddress()) &&
-             cother.getPagingGlobalWatermarkSize() == getPagingGlobalWatermarkSize();
+             cother.getGlobalPagingSize() == getGlobalPagingSize();
    }
 }

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -272,7 +272,7 @@
 
       pagingMaxGlobalSize = getLong(e, "paging-max-global-size-bytes", pagingMaxGlobalSize);
 
-      pageWatermarkSize = getInteger(e, "paging-global-watermark-size", pageWatermarkSize);
+      globalPageSize = getInteger(e, "global-page-size", globalPageSize);
       
       createJournalDir = getBoolean(e, "create-journal-dir", createJournalDir);
 

Modified: trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -112,7 +112,7 @@
 
    boolean isPersistIDCache();
 
-   int getPagingGlobalWatermarkSize();
+   int getGlobalPageSize();
 
    String getLargeMessagesDirectory();
 

Modified: trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -597,9 +597,9 @@
       return configuration.getMessageExpiryThreadPriority();
    }
 
-   public int getPagingGlobalWatermarkSize()
+   public int getGlobalPageSize()
    {
-      return configuration.getPagingGlobalWatermarkSize();
+      return configuration.getGlobalPagingSize();
    }
 
    public long getQueueActivationTimeout()

Modified: trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -361,9 +361,9 @@
       return localControl.getMessageExpiryThreadPriority();
    }
 
-   public int getPagingGlobalWatermarkSize()
+   public int getGlobalPageSize()
    {
-      return localControl.getPagingGlobalWatermarkSize();
+      return localControl.getGlobalPageSize();
    }
 
    public long getQueueActivationTimeout()

Modified: trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -67,13 +67,6 @@
    /** During startup PostOffice may set GlobalPageMode as true */
    void setGlobalPageMode(boolean globalMode);
 
-   /**
-    * @param destination
-    * @return
-    * @throws Exception 
-    */
-   PagingStore createPageStore(SimpleString destination) throws Exception;
-
    /** To return the PageStore associated with the address */
    PagingStore getPageStore(SimpleString address) throws Exception;
 
@@ -125,7 +118,7 @@
    /**
     * @return
     */
-   long getGlobalDepageWatermarkBytes();
+   long getGlobalPageSize();
 
    /**
     * @param transactionID
@@ -135,18 +128,18 @@
    /**
     * @return
     */
-   long getMaxGlobalSize();
+   long getMaxMemory();
 
    /**
     * @return
     */
-   long getGlobalSize();
+   long getTotalMemory();
 
    /**
     * @param size
     * @return
     */
-   long addGlobalSize(long size);
+   long addSize(long size);
 
    /**
     * 

Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -61,7 +61,7 @@
 
    private volatile boolean backup;
 
-   private final AtomicLong globalSize = new AtomicLong(0);
+   private final AtomicLong totalMemoryBytes = new AtomicLong(0);
 
    private final AtomicBoolean globalMode = new AtomicBoolean(false);
 
@@ -73,7 +73,7 @@
 
    private final StorageManager storageManager;
 
-   private final long globalDepageWatermarkBytes;
+   private final long globalPageSize;
 
    private final boolean syncNonTransactional;
 
@@ -91,14 +91,14 @@
                             final StorageManager storageManager,
                             final HierarchicalRepository<AddressSettings> addressSettingsRepository,
                             final long maxGlobalSize,
-                            final long globalDepageWatermarkBytes,
+                            final long globalPageSize,
                             final boolean syncNonTransactional,
                             final boolean backup)
    {
       pagingStoreFactory = pagingSPI;
       this.addressSettingsRepository = addressSettingsRepository;
       this.storageManager = storageManager;
-      this.globalDepageWatermarkBytes = globalDepageWatermarkBytes;
+      this.globalPageSize = globalPageSize;
       this.maxGlobalSize = maxGlobalSize;
       this.syncNonTransactional = syncNonTransactional;
       this.backup = backup;
@@ -151,7 +151,7 @@
     * @param destination
     * @return
     */
-   public synchronized PagingStore createPageStore(final SimpleString storeName) throws Exception
+   private synchronized PagingStore createPageStore(final SimpleString storeName) throws Exception
    {
       PagingStore store = stores.get(storeName);
 
@@ -188,9 +188,9 @@
       pagingStoreFactory.setPostOffice(postOffice);
    }
 
-   public long getGlobalDepageWatermarkBytes()
+   public long getGlobalPageSize()
    {
-      return globalDepageWatermarkBytes;
+      return globalPageSize;
    }
 
    public boolean isPaging(final SimpleString destination) throws Exception
@@ -278,7 +278,7 @@
 
       pagingStoreFactory.stop();
 
-      globalSize.set(0);
+      totalMemoryBytes.set(0);
 
       globalMode.set(false);
    }
@@ -309,23 +309,23 @@
    /* (non-Javadoc)
     * @see org.jboss.messaging.core.paging.PagingManager#getGlobalSize()
     */
-   public long getGlobalSize()
+   public long getTotalMemory()
    {
-      return globalSize.get();
+      return totalMemoryBytes.get();
    }
 
    /* (non-Javadoc)
     * @see org.jboss.messaging.core.paging.PagingManager#addGlobalSize(long)
     */
-   public long addGlobalSize(final long size)
+   public long addSize(final long size)
    {
-      return globalSize.addAndGet(size);
+      return totalMemoryBytes.addAndGet(size);
    }
 
    /* (non-Javadoc)
     * @see org.jboss.messaging.core.paging.PagingManager#getMaxGlobalSize()
     */
-   public long getMaxGlobalSize()
+   public long getMaxMemory()
    {
       return maxGlobalSize;
    }

Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -226,15 +226,15 @@
       if (isDropWhenMaxSize())
       {
          addAddressSize(size);
-         pagingManager.addGlobalSize(size);
+         pagingManager.addSize(size);
 
          return;
       }
       else
       {
-         final long currentGlobalSize = pagingManager.addGlobalSize(size);
+         final long currentGlobalSize = pagingManager.addSize(size);
 
-         final long maxGlobalSize = pagingManager.getMaxGlobalSize();
+         final long maxGlobalSize = pagingManager.getMaxMemory();
 
          final long addressSize = addAddressSize(size);
 
@@ -265,8 +265,7 @@
          }
          else
          {
-            // When in Global mode, we use the default page size as the minimal
-            // watermark to start depage
+            // When in Global mode, we use the default page size as the mark to start depage
 
             if (isTrace)
             {
@@ -274,16 +273,16 @@
                log.trace(" globalDepage = " + pagingManager.isGlobalPageMode() +
                          " currentGlobalSize = " +
                          currentGlobalSize +
-                         " GlobalWatermark = " +
-                         pagingManager.getGlobalDepageWatermarkBytes() +
+                         " GlobalPageSize = " +
+                         pagingManager.getGlobalPageSize() +
                          " maxGlobalSize = " +
                          maxGlobalSize +
                          " maxGlobalSize - defaultPageSize = " +
-                         (maxGlobalSize - pagingManager.getGlobalDepageWatermarkBytes()));
+                         (maxGlobalSize - pagingManager.getGlobalPageSize()));
             }
 
             if (maxGlobalSize > 0 && pagingManager.isGlobalPageMode() &&
-                currentGlobalSize < maxGlobalSize - pagingManager.getGlobalDepageWatermarkBytes())
+                currentGlobalSize < maxGlobalSize - pagingManager.getGlobalPageSize())
             {
                pagingManager.startGlobalDepage();
             }
@@ -917,7 +916,7 @@
     */
    private boolean isGlobalFull(final long nextPageSize)
    {
-      return pagingManager.getMaxGlobalSize() > 0 && pagingManager.getGlobalSize() + nextPageSize > pagingManager.getMaxGlobalSize();
+      return pagingManager.getMaxMemory() > 0 && pagingManager.getTotalMemory() + nextPageSize > pagingManager.getMaxMemory();
    }
 
    private long addAddressSize(final long delta)
@@ -1002,8 +1001,8 @@
    private boolean isDrop()
    {
       return getMaxSizeBytes() > 0 && getAddressSize() > getMaxSizeBytes() ||
-             pagingManager.getMaxGlobalSize() > 0 &&
-             pagingManager.getGlobalSize() > pagingManager.getMaxGlobalSize();
+             pagingManager.getMaxMemory() > 0 &&
+             pagingManager.getTotalMemory() > pagingManager.getMaxMemory();
    }
 
    // Inner classes -------------------------------------------------

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -786,7 +786,7 @@
                                    storageManager,
                                    addressSettingsRepository,
                                    configuration.getPagingMaxGlobalSizeBytes(),
-                                   configuration.getPagingGlobalWatermarkSize(),
+                                   configuration.getGlobalPagingSize(),
                                    configuration.isJournalSyncNonTransactional(),
                                    configuration.isBackup());
    }

Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/config/ConfigurationTest-full-config.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -30,7 +30,7 @@
       <backup>true</backup>
       <persist-delivery-count-before-delivery>true</persist-delivery-count-before-delivery>      
       <paging-directory>pagingdir</paging-directory>
-      <paging-global-watermark-size>123</paging-global-watermark-size>
+      <global-page-size>123</global-page-size>
       <paging-max-global-size-bytes>4567</paging-max-global-size-bytes>
       <bindings-directory>somedir</bindings-directory>
       <create-bindings-dir>false</create-bindings-dir>

Modified: trunk/tests/jms-tests/config/jbm-configuration.xml
===================================================================
--- trunk/tests/jms-tests/config/jbm-configuration.xml	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/jms-tests/config/jbm-configuration.xml	2009-05-20 00:17:29 UTC (rev 6900)
@@ -33,8 +33,5 @@
 
       
      <journal-min-files>2</journal-min-files>
-
-      <paging-max-global-size-bytes>20485760</paging-max-global-size-bytes>
-      <paging-global-watermark-size>1048576</paging-global-watermark-size>
       
 </configuration>
\ No newline at end of file

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/ExpiryAddressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/ExpiryAddressTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/ExpiryAddressTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -71,7 +71,7 @@
       ClientConsumer clientConsumer = clientSession.createConsumer(qName);
       ClientMessage m = clientConsumer.receive(500);
       assertNull(m);
-      System.out.println("size3 = " + server.getPostOffice().getPagingManager().getGlobalSize());
+      System.out.println("size3 = " + server.getPostOffice().getPagingManager().getTotalMemory());
       m = clientConsumer.receive(500);
       assertNull(m);
       clientConsumer.close();
@@ -82,7 +82,7 @@
       m.acknowledge();
       
       // PageSize should be the same as when it started
-      assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+      assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
    }
 
    public void testBasicSendToMultipleQueues() throws Exception
@@ -101,17 +101,17 @@
       ClientMessage clientMessage = createTextMessage("heyho!", clientSession);
       clientMessage.setExpiration(System.currentTimeMillis());
       
-      System.out.println("initialPageSize = " + server.getPostOffice().getPagingManager().getGlobalSize());
+      System.out.println("initialPageSize = " + server.getPostOffice().getPagingManager().getTotalMemory());
       
       producer.send(clientMessage);
       
-      System.out.println("pageSize after message sent = " + server.getPostOffice().getPagingManager().getGlobalSize());
+      System.out.println("pageSize after message sent = " + server.getPostOffice().getPagingManager().getTotalMemory());
       
       clientSession.start();
       ClientConsumer clientConsumer = clientSession.createConsumer(qName);
       ClientMessage m = clientConsumer.receive(500);
       
-      System.out.println("pageSize after message received = " + server.getPostOffice().getPagingManager().getGlobalSize());
+      System.out.println("pageSize after message received = " + server.getPostOffice().getPagingManager().getTotalMemory());
       
       assertNull(m);
       
@@ -146,7 +146,7 @@
       clientSession.commit();
 
       // PageGlobalSize should be untouched as the message expired
-      assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+      assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
    }
 
    public void testBasicSendToNoQueue() throws Exception

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/LargeMessageTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/LargeMessageTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/LargeMessageTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -1206,7 +1206,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(20 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       server = createServer(realFiles, config, new HashMap<String, AddressSettings>());
 
@@ -1336,12 +1336,12 @@
    {
       // addGlobalSize on LargeMessage is only done after the delivery, and the addSize could be asynchronous
       long timeout = System.currentTimeMillis() + 5000;
-      while (timeout > System.currentTimeMillis() && server.getPostOffice().getPagingManager().getGlobalSize() != 0)
+      while (timeout > System.currentTimeMillis() && server.getPostOffice().getPagingManager().getTotalMemory() != 0)
       {
          Thread.sleep(100);
       }
 
-      assertEquals(0l, server.getPostOffice().getPagingManager().getGlobalSize());
+      assertEquals(0l, server.getPostOffice().getPagingManager().getTotalMemory());
    }
 
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/PagingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/PagingTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/PagingTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -78,7 +78,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -136,7 +136,7 @@
 
          sf = createInVMFactory();
 
-         assertTrue(server.getPostOffice().getPagingManager().getGlobalSize() > 0);
+         assertTrue(server.getPostOffice().getPagingManager().getTotalMemory() > 0);
 
          session = sf.createSession(null, null, false, true, true, false, 0);
 
@@ -172,7 +172,7 @@
 
          session.close();
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
 
       }
       finally
@@ -203,7 +203,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -309,7 +309,7 @@
 
          session.close();
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
 
       }
       finally
@@ -342,7 +342,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -450,7 +450,7 @@
 
          session.close();
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
 
       }
       finally
@@ -473,7 +473,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -497,7 +497,7 @@
 
          ClientProducer producer = session.createProducer(ADDRESS);
 
-         long initialSize = server.getPostOffice().getPagingManager().getGlobalSize();
+         long initialSize = server.getPostOffice().getPagingManager().getTotalMemory();
 
          ClientMessage message = null;
 
@@ -527,7 +527,7 @@
 
          session.close();
 
-         assertEquals(initialSize, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(initialSize, server.getPostOffice().getPagingManager().getTotalMemory());
       }
       finally
       {
@@ -549,7 +549,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -573,7 +573,7 @@
 
          ClientProducer producer = session.createProducer(ADDRESS);
 
-         long initialSize = server.getPostOffice().getPagingManager().getGlobalSize();
+         long initialSize = server.getPostOffice().getPagingManager().getTotalMemory();
 
          ClientMessage message = null;
 
@@ -609,7 +609,7 @@
 
          session.close();
 
-         assertEquals(initialSize, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(initialSize, server.getPostOffice().getPagingManager().getTotalMemory());
       }
       finally
       {
@@ -668,7 +668,7 @@
          set.setMaxSizeBytes(10 * 1024);
       }
 
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, settings);
 
@@ -719,7 +719,7 @@
 
          assertNull(consumer.receive(100));
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
          assertEquals(0, server.getPostOffice().getPagingManager().getPageStore(ADDRESS).getAddressSize());
 
          for (int i = 0; i < numberOfMessages; i++)
@@ -780,7 +780,7 @@
 
          session.close();
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
          assertEquals(0, server.getPostOffice().getPagingManager().getPageStore(ADDRESS).getAddressSize());
 
       }
@@ -806,7 +806,7 @@
       int NUMBER_OF_MESSAGES = 2;
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -855,7 +855,7 @@
 
          sf = createInVMFactory();
 
-         assertTrue(server.getPostOffice().getPagingManager().getGlobalSize() > 0);
+         assertTrue(server.getPostOffice().getPagingManager().getTotalMemory() > 0);
 
          session = sf.createSession(null, null, false, true, true, false, 0);
 
@@ -893,7 +893,7 @@
 
          assertEquals("There are pending messages on the server", 0, server.getPostOffice()
                                                                            .getPagingManager()
-                                                                           .getGlobalSize());
+                                                                           .getTotalMemory());
 
       }
       finally
@@ -917,7 +917,7 @@
       Configuration configuration = createDefaultConfig();
 
       configuration.setPagingMaxGlobalSizeBytes(0);
-      configuration.setPagingGlobalWatermarkSize(0);
+      configuration.setGlobalPagingSize(0);
 
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
@@ -1024,7 +1024,7 @@
       Configuration configuration = createDefaultConfig();
 
       configuration.setPagingMaxGlobalSizeBytes(0);
-      configuration.setPagingGlobalWatermarkSize(0);
+      configuration.setGlobalPagingSize(0);
 
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
@@ -1159,7 +1159,7 @@
       Configuration configuration = createDefaultConfig();
 
       configuration.setPagingMaxGlobalSizeBytes(30 * 1024);
-      configuration.setPagingGlobalWatermarkSize(1024);
+      configuration.setGlobalPagingSize(1024);
 
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
@@ -1298,9 +1298,6 @@
       Configuration configuration = createDefaultConfig();
       configuration.setPagingMaxGlobalSizeBytes(104857600);
 
-      System.out.println("getPagingMaxGlobalSizeBytes:" + configuration.getPagingMaxGlobalSizeBytes());
-      System.out.println("getPagingGlobalWatermarkSize:" + configuration.getPagingGlobalWatermarkSize());
-      
       Map<String, AddressSettings> addresses = new HashMap<String, AddressSettings>();
 
       addresses.put("#", new AddressSettings());
@@ -1355,7 +1352,7 @@
                                                        .getPageStore(PAGED_ADDRESS_A)
                                                        .getAddressSize() +
                             " globalSize = " +
-                            server.getPostOffice().getPagingManager().getGlobalSize());
+                            server.getPostOffice().getPagingManager().getTotalMemory());
 
          for (int i = 0; i < NUMBER_OF_MESSAGES_GLOBAL; i++)
          {
@@ -1368,7 +1365,7 @@
                                                        .getPageStore(PAGED_ADDRESS_A)
                                                        .getAddressSize() +
                             " globalSize = " +
-                            server.getPostOffice().getPagingManager().getGlobalSize());
+                            server.getPostOffice().getPagingManager().getTotalMemory());
 
          assertTrue(server.getPostOffice().getPagingManager().getPageStore(PAGED_ADDRESS_A).isPaging());
          assertTrue(server.getPostOffice().getPagingManager().getPageStore(PAGED_ADDRESS_GLOBAL).isPaging());

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/FailoverTestBase.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -127,7 +127,7 @@
          backupConf.setJournalType(JournalType.ASYNCIO);
 
          backupConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-         backupConf.setPagingGlobalWatermarkSize(pageSize);
+         backupConf.setGlobalPagingSize(pageSize);
          backupServer = Messaging.newMessagingServer(backupConf);
       }
       else
@@ -161,7 +161,7 @@
          liveConf.setPagingDirectory(getPageDir(getTestDir() + "/live"));
 
          liveConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-         liveConf.setPagingGlobalWatermarkSize(pageSize);
+         liveConf.setGlobalPagingSize(pageSize);
          liveConf.setJournalFileSize(100 * 1024);
 
          liveConf.setJournalType(JournalType.ASYNCIO);
@@ -211,7 +211,7 @@
          backupConf.setJournalType(JournalType.ASYNCIO);
 
          backupConf.setPagingMaxGlobalSizeBytes(-1);
-         backupConf.setPagingGlobalWatermarkSize(-1);
+         backupConf.setGlobalPagingSize(-1);
          backupServer = Messaging.newMessagingServer(backupConf);
       }
       else
@@ -259,7 +259,7 @@
          liveConf.setPagingDirectory(getPageDir(getTestDir() + "/live"));
 
          liveConf.setPagingMaxGlobalSizeBytes(-1);
-         liveConf.setPagingGlobalWatermarkSize(-1);
+         liveConf.setGlobalPagingSize(-1);
          liveConf.setJournalFileSize(100 * 1024);
 
          liveConf.setJournalType(JournalType.ASYNCIO);

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverMultiThreadTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverMultiThreadTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverMultiThreadTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -389,7 +389,7 @@
          backupConf.setJournalType(JournalType.ASYNCIO);
 
          backupConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-         backupConf.setPagingGlobalWatermarkSize(pageSize);
+         backupConf.setGlobalPagingSize(pageSize);
          backupServer = Messaging.newMessagingServer(backupConf);
       }
       else
@@ -423,7 +423,7 @@
          liveConf.setPagingDirectory(getPageDir(getTestDir() + "/live"));
 
          liveConf.setPagingMaxGlobalSizeBytes(maxGlobalSize);
-         liveConf.setPagingGlobalWatermarkSize(pageSize);
+         liveConf.setGlobalPagingSize(pageSize);
          liveConf.setJournalFileSize(100 * 1024);
 
          liveConf.setJournalType(JournalType.ASYNCIO);

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/PagingFailoverTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -170,11 +170,11 @@
 
          final RemotingConnection conn = ((ClientSessionImpl)session).getConnection();
 
-         assertEquals("GloblSize", pmLive.getGlobalSize(), pmBackup.getGlobalSize());
+         assertEquals("GloblSize", pmLive.getTotalMemory(), pmBackup.getTotalMemory());
 
-         assertEquals("PageSizeLive", storeLive.getAddressSize(), pmLive.getGlobalSize());
+         assertEquals("PageSizeLive", storeLive.getAddressSize(), pmLive.getTotalMemory());
 
-         assertEquals("PageSizeBackup", storeBackup.getAddressSize(), pmBackup.getGlobalSize());
+         assertEquals("PageSizeBackup", storeBackup.getAddressSize(), pmBackup.getTotalMemory());
 
          ClientConsumer consumer = session.createConsumer(ADDRESS);
 
@@ -202,10 +202,10 @@
 
          if (!fail)
          {
-            assertEquals(0, pmLive.getGlobalSize());
+            assertEquals(0, pmLive.getTotalMemory());
             assertEquals(0, storeLive.getAddressSize());
          }
-         assertEquals(0, pmBackup.getGlobalSize());
+         assertEquals(0, pmBackup.getTotalMemory());
          assertEquals(0, storeBackup.getAddressSize());
 
       }

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/divert/PersistentDivertTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/divert/PersistentDivertTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/divert/PersistentDivertTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -369,7 +369,7 @@
       
       sf.close();
       
-      assertEquals(0, messagingService.getPostOffice().getPagingManager().getGlobalSize());
+      assertEquals(0, messagingService.getPostOffice().getPagingManager().getTotalMemory());
       
       messagingService.stop();
    }

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageCleanupTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageCleanupTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageCleanupTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -103,7 +103,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(20 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       server = createServer(true, config, new HashMap<String, AddressSettings>());
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageTestBase.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/largemessage/LargeMessageTestBase.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -471,7 +471,7 @@
 
          session.close();
 
-         long globalSize = server.getPostOffice().getPagingManager().getGlobalSize();
+         long globalSize = server.getPostOffice().getPagingManager().getTotalMemory();
          assertEquals(0l, globalSize);
          assertEquals(0, ((Queue)server.getPostOffice().getBinding(ADDRESS).getBindable()).getDeliveringCount());
          assertEquals(0, ((Queue)server.getPostOffice().getBinding(ADDRESS).getBindable()).getMessageCount());

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -103,7 +103,7 @@
       assertEquals(conf.isCreateJournalDir(), serverControl.isCreateJournalDir());      
       assertEquals(conf.getPagingDirectory(), serverControl.getPagingDirectory());
       assertEquals(conf.getPagingMaxGlobalSizeBytes(), serverControl.getPagingMaxGlobalSizeBytes());
-      assertEquals(conf.getPagingGlobalWatermarkSize(), serverControl.getPagingGlobalWatermarkSize());
+      assertEquals(conf.getGlobalPagingSize(), serverControl.getGlobalPageSize());
       assertEquals(conf.getLargeMessagesDirectory(), serverControl.getLargeMessagesDirectory());
       assertEquals(conf.isWildcardRoutingEnabled(), serverControl.isWildcardRoutingEnabled());
       assertEquals(conf.getTransactionTimeout(), serverControl.getTransactionTimeout());

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -252,9 +252,9 @@
             return (String)proxy.retrieveAttributeValue("PagingDirectory");
          }
 
-         public int getPagingGlobalWatermarkSize()
+         public int getGlobalPageSize()
          {
-            return (Integer)proxy.retrieveAttributeValue("PagingGlobalWatermarkSize");
+            return (Integer)proxy.retrieveAttributeValue("GlobalPageSize");
          }
 
          public long getPagingMaxGlobalSizeBytes()

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/paging/PageCrashTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -94,7 +94,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer messagingService = createServer(true, config, new HashMap<String, AddressSettings>());
 
@@ -136,7 +136,7 @@
       Configuration config = createDefaultConfig();
 
       config.setPagingMaxGlobalSizeBytes(100 * 1024);
-      config.setPagingGlobalWatermarkSize(10 * 1024);
+      config.setGlobalPagingSize(10 * 1024);
 
       MessagingServer server = newMessagingServer(config);
 
@@ -181,7 +181,7 @@
 
          session.close();
 
-         assertTrue(server.getPostOffice().getPagingManager().getGlobalSize() > 0);
+         assertTrue(server.getPostOffice().getPagingManager().getTotalMemory() > 0);
 
          session = sf.createSession(null, null, false, true, true, false, 0);
 
@@ -202,7 +202,7 @@
 
          session.close();
 
-         assertEquals(0, server.getPostOffice().getPagingManager().getGlobalSize());
+         assertEquals(0, server.getPostOffice().getPagingManager().getTotalMemory());
 
       }
       finally
@@ -230,7 +230,7 @@
       MessagingServer server = new FailingMessagingServerImpl(configuration, securityManager);
 
       AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+      defaultSetting.setPageSizeBytes(configuration.getGlobalPagingSize());
 
       server.getAddressSettingsRepository().addMatch("#", defaultSetting);
 
@@ -256,7 +256,7 @@
                                       super.getStorageManager(),
                                       super.getAddressSettingsRepository(),
                                       super.getConfiguration().getPagingMaxGlobalSizeBytes(),
-                                      super.getConfiguration().getPagingGlobalWatermarkSize(),
+                                      super.getConfiguration().getGlobalPagingSize(),
                                       super.getConfiguration().isJournalSyncNonTransactional(),
                                       false);
       }

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/xa/BasicXaRecoveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/xa/BasicXaRecoveryTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/xa/BasicXaRecoveryTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -341,7 +341,7 @@
 
       clientSession.createQueue(pageQueue, pageQueue, null, true);
       
-      long initialPageSize = this.server.getPostOffice().getPagingManager().getGlobalSize();
+      long initialPageSize = this.server.getPostOffice().getPagingManager().getTotalMemory();
 
       clientSession.start(xid, XAResource.TMNOFLAGS);
 
@@ -379,7 +379,7 @@
 
       assertNull(pageConsumer.receive(100));
       
-      long globalSize = this.server.getPostOffice().getPagingManager().getGlobalSize();
+      long globalSize = this.server.getPostOffice().getPagingManager().getTotalMemory();
       // Management message (from createQueue) will not be taken into account again as it is nonPersistent
       
       log.info("global size is " + globalSize +  " initial page size is " + initialPageSize);

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -120,7 +120,7 @@
 
       assertEquals(ConfigurationImpl.DEFAULT_PAGE_MAX_GLOBAL_SIZE, conf.getPagingMaxGlobalSizeBytes());
 
-      assertEquals(ConfigurationImpl.DEFAULT_PAGE_WATERMARK_SIZE, conf.getPagingGlobalWatermarkSize());
+      assertEquals(ConfigurationImpl.DEFAULT_GLOBAL_PAGE_SIZE, conf.getGlobalPagingSize());
       
       assertEquals(ConfigurationImpl.DEFAULT_LARGE_MESSAGES_DIR, conf.getLargeMessagesDirectory());
       

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -72,7 +72,7 @@
       assertEquals(true, conf.isBackup());
       assertEquals(true, conf.isPersistDeliveryCountBeforeDelivery());      
       assertEquals("pagingdir", conf.getPagingDirectory());
-      assertEquals(123, conf.getPagingGlobalWatermarkSize());
+      assertEquals(123, conf.getGlobalPagingSize());
       assertEquals(4567, conf.getPagingMaxGlobalSizeBytes());
       assertEquals("somedir", conf.getBindingsDirectory());
       assertEquals(false, conf.isCreateBindingsDir());

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -347,7 +347,7 @@
          return null;
       }
 
-      public int getPagingGlobalWatermarkSize()
+      public int getGlobalPageSize()
       {
          // TODO Auto-generated method stub
          return 0;

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerITest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerITest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerITest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.messaging.tests.unit.core.paging.impl;
-
-import java.io.File;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.concurrent.Executors;
-
-import org.jboss.messaging.core.buffers.ChannelBuffers;
-import org.jboss.messaging.core.paging.Page;
-import org.jboss.messaging.core.paging.PagedMessage;
-import org.jboss.messaging.core.paging.impl.PagedMessageImpl;
-import org.jboss.messaging.core.paging.impl.PagingManagerImpl;
-import org.jboss.messaging.core.paging.impl.PagingStoreFactoryNIO;
-import org.jboss.messaging.core.paging.impl.TestSupportPageStore;
-import org.jboss.messaging.core.persistence.impl.nullpm.NullStorageManager;
-import org.jboss.messaging.core.server.ServerMessage;
-import org.jboss.messaging.core.server.impl.ServerMessageImpl;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
-import org.jboss.messaging.core.settings.impl.HierarchicalObjectRepository;
-import org.jboss.messaging.tests.util.RandomUtil;
-import org.jboss.messaging.tests.util.UnitTestCase;
-import org.jboss.messaging.utils.OrderedExecutorFactory;
-import org.jboss.messaging.utils.SimpleString;
-
-/**
- * 
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class PagingManagerITest extends UnitTestCase
-{
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public void testPagingManager() throws Exception
-   {
-      
-      HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<AddressSettings>();
-      addressSettings.setDefault(new AddressSettings());
-      
-      PagingManagerImpl managerImpl = new PagingManagerImpl(new PagingStoreFactoryNIO(getPageDir(), new OrderedExecutorFactory(Executors.newCachedThreadPool())),
-                                                            new NullStorageManager(),
-                                                            addressSettings,
-                                                            -1,
-                                                            1024 * 1024,
-                                                            true,
-                                                            false);
-
-      managerImpl.start();
-
-      TestSupportPageStore store = (TestSupportPageStore)managerImpl.createPageStore(new SimpleString("simple-test"));
-
-      ServerMessage msg = createMessage(1l, new SimpleString("simple-test"), createRandomBuffer(10));
-
-      assertFalse(store.page(new PagedMessageImpl(msg), true, true));
-
-      store.startPaging();
-
-      assertTrue(store.page(new PagedMessageImpl(msg), true, true));
-
-      Page page = store.depage();
-
-      page.open();
-
-      List<PagedMessage> msgs = page.read();
-
-      page.close();
-
-      assertEquals(1, msgs.size());
-
-      assertEqualsByteArrays(msg.getBody().array(), (msgs.get(0).getMessage(null)).getBody().array());
-
-      assertTrue(store.isPaging());
-
-      assertNull(store.depage());
-
-      assertFalse(store.page(new PagedMessageImpl(msg), true, true));
-   }
-
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-   @Override
-   protected void setUp() throws Exception
-   {
-      super.setUp();
-      recreateDirectory();
-   }
-
-   protected ServerMessage createMessage(final long messageId, final SimpleString destination, final ByteBuffer buffer)
-   {
-      ServerMessage msg = new ServerMessageImpl((byte)1,
-                                                true,
-                                                0,
-                                                System.currentTimeMillis(),
-                                                (byte)0,
-                                                ChannelBuffers.wrappedBuffer(new byte[1024]));
-
-      msg.setMessageID(messageId);
-
-      msg.setDestination(destination);
-      return msg;
-   }
-
-   protected ByteBuffer createRandomBuffer(final int size)
-   {
-      ByteBuffer buffer = ByteBuffer.allocate(size);
-
-      for (int j = 0; j < buffer.limit(); j++)
-      {
-         buffer.put(RandomUtil.randomByte());
-      }
-      return buffer;
-   }
-
-   @Override
-   protected void tearDown() throws Exception
-   {
-      super.tearDown();
-      // deleteDirectory(new File(journalDir));
-   }
-   
-   // Private -------------------------------------------------------
-
-   private void recreateDirectory()
-   {
-      File fileJournalDir = new File(getJournalDir());
-      deleteDirectory(fileJournalDir);
-      fileJournalDir.mkdirs();
-
-      File pageDirDir = new File(getPageDir());
-      deleteDirectory(pageDirDir);
-      pageDirDir.mkdirs();
-   }
-
-   // Inner classes -------------------------------------------------
-
-}

Copied: trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerImplTest.java (from rev 6897, trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerITest.java)
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerImplTest.java	                        (rev 0)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingManagerImplTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -0,0 +1,170 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.messaging.tests.unit.core.paging.impl;
+
+import java.io.File;
+import java.nio.ByteBuffer;
+import java.util.List;
+import java.util.concurrent.Executors;
+
+import org.jboss.messaging.core.buffers.ChannelBuffers;
+import org.jboss.messaging.core.paging.Page;
+import org.jboss.messaging.core.paging.PagedMessage;
+import org.jboss.messaging.core.paging.impl.PagedMessageImpl;
+import org.jboss.messaging.core.paging.impl.PagingManagerImpl;
+import org.jboss.messaging.core.paging.impl.PagingStoreFactoryNIO;
+import org.jboss.messaging.core.paging.impl.TestSupportPageStore;
+import org.jboss.messaging.core.persistence.impl.nullpm.NullStorageManager;
+import org.jboss.messaging.core.server.ServerMessage;
+import org.jboss.messaging.core.server.impl.ServerMessageImpl;
+import org.jboss.messaging.core.settings.HierarchicalRepository;
+import org.jboss.messaging.core.settings.impl.AddressSettings;
+import org.jboss.messaging.core.settings.impl.HierarchicalObjectRepository;
+import org.jboss.messaging.tests.util.RandomUtil;
+import org.jboss.messaging.tests.util.UnitTestCase;
+import org.jboss.messaging.utils.OrderedExecutorFactory;
+import org.jboss.messaging.utils.SimpleString;
+
+/**
+ * 
+ * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
+ *
+ */
+public class PagingManagerImplTest extends UnitTestCase
+{
+
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   public void testPagingManager() throws Exception
+   {
+      
+      HierarchicalRepository<AddressSettings> addressSettings = new HierarchicalObjectRepository<AddressSettings>();
+      addressSettings.setDefault(new AddressSettings());
+      
+      PagingManagerImpl managerImpl = new PagingManagerImpl(new PagingStoreFactoryNIO(getPageDir(), new OrderedExecutorFactory(Executors.newCachedThreadPool())),
+                                                            new NullStorageManager(),
+                                                            addressSettings,
+                                                            -1,
+                                                            1024 * 1024,
+                                                            true,
+                                                            false);
+
+      managerImpl.start();
+
+      TestSupportPageStore store = (TestSupportPageStore)managerImpl.getPageStore(new SimpleString("simple-test"));
+
+      ServerMessage msg = createMessage(1l, new SimpleString("simple-test"), createRandomBuffer(10));
+
+      assertFalse(store.page(new PagedMessageImpl(msg), true, true));
+
+      store.startPaging();
+
+      assertTrue(store.page(new PagedMessageImpl(msg), true, true));
+
+      Page page = store.depage();
+
+      page.open();
+
+      List<PagedMessage> msgs = page.read();
+
+      page.close();
+
+      assertEquals(1, msgs.size());
+
+      assertEqualsByteArrays(msg.getBody().array(), (msgs.get(0).getMessage(null)).getBody().array());
+
+      assertTrue(store.isPaging());
+
+      assertNull(store.depage());
+
+      assertFalse(store.page(new PagedMessageImpl(msg), true, true));
+   }
+
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+   @Override
+   protected void setUp() throws Exception
+   {
+      super.setUp();
+      recreateDirectory();
+   }
+
+   protected ServerMessage createMessage(final long messageId, final SimpleString destination, final ByteBuffer buffer)
+   {
+      ServerMessage msg = new ServerMessageImpl((byte)1,
+                                                true,
+                                                0,
+                                                System.currentTimeMillis(),
+                                                (byte)0,
+                                                ChannelBuffers.wrappedBuffer(new byte[1024]));
+
+      msg.setMessageID(messageId);
+
+      msg.setDestination(destination);
+      return msg;
+   }
+
+   protected ByteBuffer createRandomBuffer(final int size)
+   {
+      ByteBuffer buffer = ByteBuffer.allocate(size);
+
+      for (int j = 0; j < buffer.limit(); j++)
+      {
+         buffer.put(RandomUtil.randomByte());
+      }
+      return buffer;
+   }
+
+   @Override
+   protected void tearDown() throws Exception
+   {
+      super.tearDown();
+      // deleteDirectory(new File(journalDir));
+   }
+   
+   // Private -------------------------------------------------------
+
+   private void recreateDirectory()
+   {
+      File fileJournalDir = new File(getJournalDir());
+      deleteDirectory(fileJournalDir);
+      fileJournalDir.mkdirs();
+
+      File pageDirDir = new File(getPageDir());
+      deleteDirectory(pageDirDir);
+      pageDirDir.mkdirs();
+   }
+
+   // Inner classes -------------------------------------------------
+
+}

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreImplTest.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/paging/impl/PagingStoreImplTest.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -731,177 +731,108 @@
    class FakePagingManager implements PagingManager
    {
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#activate()
-       */
       public void activate()
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#addGlobalSize(long)
-       */
-      public long addGlobalSize(final long size)
+      public long addSize(final long size)
       {
          return 0;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#addTransaction(org.jboss.messaging.core.paging.PageTransactionInfo)
-       */
       public void addTransaction(final PageTransactionInfo pageTransaction)
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#createPageStore(org.jboss.messaging.utils.SimpleString)
-       */
       public PagingStore createPageStore(final SimpleString destination) throws Exception
       {
          return null;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#getGlobalDepageWatermarkBytes()
-       */
-      public long getGlobalDepageWatermarkBytes()
+      public long getGlobalPageSize()
       {
-         return ConfigurationImpl.DEFAULT_PAGE_WATERMARK_SIZE;
+         return ConfigurationImpl.DEFAULT_GLOBAL_PAGE_SIZE;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#getGlobalSize()
-       */
-      public long getGlobalSize()
+      public long getTotalMemory()
       {
          return 0;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#getMaxGlobalSize()
-       */
-      public long getMaxGlobalSize()
+      public long getMaxMemory()
       {
          return 0;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#getPageStore(org.jboss.messaging.utils.SimpleString)
-       */
       public PagingStore getPageStore(final SimpleString address) throws Exception
       {
          return null;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#getTransaction(long)
-       */
       public PageTransactionInfo getTransaction(final long transactionID)
       {
          return null;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#isBackup()
-       */
       public boolean isBackup()
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#isGlobalPageMode()
-       */
       public boolean isGlobalPageMode()
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#isPaging(org.jboss.messaging.utils.SimpleString)
-       */
       public boolean isPaging(final SimpleString destination) throws Exception
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#page(org.jboss.messaging.core.server.ServerMessage, boolean)
-       */
       public boolean page(final ServerMessage message, final boolean duplicateDetection) throws Exception
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#page(org.jboss.messaging.core.server.ServerMessage, long, boolean)
-       */
       public boolean page(final ServerMessage message, final long transactionId, final boolean duplicateDetection) throws Exception
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#reloadStores()
-       */
       public void reloadStores() throws Exception
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#removeTransaction(long)
-       */
       public void removeTransaction(final long transactionID)
       {
 
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#setGlobalPageMode(boolean)
-       */
       public void setGlobalPageMode(final boolean globalMode)
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#setPostOffice(org.jboss.messaging.core.postoffice.PostOffice)
-       */
       public void setPostOffice(final PostOffice postOffice)
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#startGlobalDepage()
-       */
       public void startGlobalDepage()
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.paging.PagingManager#sync(java.util.Collection)
-       */
       public void sync(final Collection<SimpleString> destinationsToSync) throws Exception
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.server.MessagingComponent#isStarted()
-       */
       public boolean isStarted()
       {
          return false;
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.server.MessagingComponent#start()
-       */
       public void start() throws Exception
       {
       }
 
-      /* (non-Javadoc)
-       * @see org.jboss.messaging.core.server.MessagingComponent#stop()
-       */
       public void stop() throws Exception
       {
       }
@@ -913,8 +844,6 @@
 
       public void setUniqueIDSequence(long id)
       {
-         // TODO Auto-generated method stub
-         
       }
 
       /* (non-Javadoc)
@@ -1177,13 +1106,11 @@
 
       public Object getNotificationLock()
       {
-         // TODO Auto-generated method stub
          return null;
       }
 
       public Bindings getMatchingBindings(SimpleString address)
       {
-         // TODO Auto-generated method stub
          return null;
       }
 

Modified: trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java	2009-05-19 19:14:07 UTC (rev 6899)
+++ trunk/tests/src/org/jboss/messaging/tests/util/ServiceTestBase.java	2009-05-20 00:17:29 UTC (rev 6900)
@@ -152,7 +152,7 @@
       }
 
       AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+      defaultSetting.setPageSizeBytes(configuration.getGlobalPagingSize());
 
       server.getAddressSettingsRepository().addMatch("#", defaultSetting);
 
@@ -181,7 +181,7 @@
       }
 
       AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+      defaultSetting.setPageSizeBytes(configuration.getGlobalPagingSize());
 
       server.getAddressSettingsRepository().addMatch("#", defaultSetting);
 
@@ -220,7 +220,7 @@
       }
 
       AddressSettings defaultSetting = new AddressSettings();
-      defaultSetting.setPageSizeBytes(configuration.getPagingGlobalWatermarkSize());
+      defaultSetting.setPageSizeBytes(configuration.getGlobalPagingSize());
 
       server.getAddressSettingsRepository().addMatch("#", defaultSetting);
 




More information about the jboss-cvs-commits mailing list