Author: clebert.suconic
Date: 2011-09-27 21:35:42 -0400 (Tue, 27 Sep 2011)
New Revision: 11436
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/AddressControl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/AddressControlImpl.java
Log:
HORNETQ-786 - exposing isPaging on the AddressControl
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/AddressControl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/AddressControl.java 2011-09-27
22:24:35 UTC (rev 11435)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/api/core/management/AddressControl.java 2011-09-28
01:35:42 UTC (rev 11436)
@@ -50,6 +50,8 @@
* Returns the number of pages used by this address.
*/
int getNumberOfPages() throws Exception;
+
+ boolean isPaging() throws Exception;
/**
* Returns the number of bytes used by each page for this address.
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/AddressControlImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/AddressControlImpl.java 2011-09-27
22:24:35 UTC (rev 11435)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/management/impl/AddressControlImpl.java 2011-09-28
01:35:42 UTC (rev 11436)
@@ -23,6 +23,7 @@
import org.hornetq.api.core.management.AddressControl;
import org.hornetq.core.logging.Logger;
import org.hornetq.core.paging.PagingManager;
+import org.hornetq.core.paging.PagingStore;
import org.hornetq.core.persistence.StorageManager;
import org.hornetq.core.postoffice.Binding;
import org.hornetq.core.postoffice.Bindings;
@@ -194,13 +195,35 @@
blockOnIO();
}
}
+
+ public boolean isPaging() throws Exception
+ {
+ clearIO();
+ try
+ {
+ return pagingManager.getPageStore(address).isPaging();
+ }
+ finally
+ {
+ blockOnIO();
+ }
+ }
public int getNumberOfPages() throws Exception
{
clearIO();
try
{
- return pagingManager.getPageStore(address).getNumberOfPages();
+ PagingStore pageStore = pagingManager.getPageStore(address);
+
+ if (!pageStore.isPaging())
+ {
+ return 0;
+ }
+ else
+ {
+ return pagingManager.getPageStore(address).getNumberOfPages();
+ }
}
finally
{