[jboss-cvs] JBoss Messaging SVN: r6373 - in trunk: examples/jms/browser/server0 and 35 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 9 07:51:33 EDT 2009
Author: jmesnil
Date: 2009-04-09 07:51:33 -0400 (Thu, 09 Apr 2009)
New Revision: 6373
Modified:
trunk/AS/config/jbm-jboss-beans.xml
trunk/examples/jms/browser/server0/jbm-standalone-beans.xml
trunk/examples/jms/clustered-durable-subscription/server0/jbm-standalone-beans.xml
trunk/examples/jms/clustered-durable-subscription/server1/jbm-standalone-beans.xml
trunk/examples/jms/clustered-queue/server0/jbm-standalone-beans.xml
trunk/examples/jms/clustered-queue/server1/jbm-standalone-beans.xml
trunk/examples/jms/clustered-topic/server0/jbm-standalone-beans.xml
trunk/examples/jms/clustered-topic/server1/jbm-standalone-beans.xml
trunk/examples/jms/common/config/jbm-example-beans.xml
trunk/examples/jms/common/src/org/jboss/jms/example/JMSExample.java
trunk/examples/jms/dead-letter/server0/jbm-standalone-beans.xml
trunk/examples/jms/durable-subscription/server0/jbm-standalone-beans.xml
trunk/examples/jms/expiry/server0/jbm-standalone-beans.xml
trunk/examples/jms/http-transport/server0/jbm-standalone-beans.xml
trunk/examples/jms/jmx/server0/jbm-standalone-beans.xml
trunk/examples/jms/large-message/server0/jbm-standalone-beans.xml
trunk/examples/jms/management/server0/jbm-standalone-beans.xml
trunk/examples/jms/paging/server0/jbm-standalone-beans.xml
trunk/examples/jms/queue-requestor/server0/jbm-standalone-beans.xml
trunk/examples/jms/queue-selector/server0/jbm-standalone-beans.xml
trunk/examples/jms/queue/server0/jbm-standalone-beans.xml
trunk/examples/jms/request-reply/server0/jbm-standalone-beans.xml
trunk/examples/jms/scheduled-message/server0/jbm-standalone-beans.xml
trunk/examples/jms/temp-queue/server0/jbm-standalone-beans.xml
trunk/examples/jms/topic-selector-example1/server0/jbm-standalone-beans.xml
trunk/examples/jms/topic-selector-example2/server0/jbm-standalone-beans.xml
trunk/examples/jms/topic/server0/jbm-standalone-beans.xml
trunk/examples/jms/transactional/server0/jbm-standalone-beans.xml
trunk/src/config/jbm-cluster-standalone-beans.xml
trunk/src/config/jbm-standalone-beans.xml
trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java
trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareQueueControlWrapper.java
trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java
trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSMessageInfo.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java
Log:
JBMESSAGING-1595: JMS management controls should depend on core management controls
* refactored JMS management controls to use core control (instead of resources directly)
* removed unused core references from JMSManagementServiceImpl
* updated all beans configuration files to use the updated simplified JMSServerManagerImpl constructor
Modified: trunk/AS/config/jbm-jboss-beans.xml
===================================================================
--- trunk/AS/config/jbm-jboss-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/AS/config/jbm-jboss-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -74,15 +74,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/browser/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/browser/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/browser/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-durable-subscription/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-durable-subscription/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-durable-subscription/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-durable-subscription/server1/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-durable-subscription/server1/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-durable-subscription/server1/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-queue/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-queue/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-queue/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-queue/server1/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-queue/server1/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-queue/server1/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-topic/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-topic/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-topic/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/clustered-topic/server1/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/clustered-topic/server1/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/clustered-topic/server1/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/common/config/jbm-example-beans.xml
===================================================================
--- trunk/examples/jms/common/config/jbm-example-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/common/config/jbm-example-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/common/src/org/jboss/jms/example/JMSExample.java
===================================================================
--- trunk/examples/jms/common/src/org/jboss/jms/example/JMSExample.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/common/src/org/jboss/jms/example/JMSExample.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -164,8 +164,8 @@
{
for (Process server : servers)
{
- server.getInputStream().close();
- server.getErrorStream().close();
+ // server.getInputStream().close();
+ // server.getErrorStream().close();
server.destroy();
}
}
Modified: trunk/examples/jms/dead-letter/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/dead-letter/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/dead-letter/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/durable-subscription/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/durable-subscription/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/durable-subscription/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/expiry/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/expiry/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/expiry/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/http-transport/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/http-transport/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/http-transport/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/jmx/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/jmx/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/jmx/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/large-message/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/large-message/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/large-message/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/management/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/management/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/management/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/paging/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/paging/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/paging/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/queue/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/queue/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/queue/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/queue-requestor/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/queue-requestor/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/queue-requestor/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/queue-selector/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/queue-selector/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/queue-selector/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/request-reply/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/request-reply/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/request-reply/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/scheduled-message/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/scheduled-message/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/scheduled-message/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/temp-queue/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/temp-queue/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/temp-queue/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/topic/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/topic/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/topic/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/topic-selector-example1/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/topic-selector-example1/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/topic-selector-example1/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/topic-selector-example2/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/topic-selector-example2/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/topic-selector-example2/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/examples/jms/transactional/server0/jbm-standalone-beans.xml
===================================================================
--- trunk/examples/jms/transactional/server0/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/examples/jms/transactional/server0/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/src/config/jbm-cluster-standalone-beans.xml
===================================================================
--- trunk/src/config/jbm-cluster-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/config/jbm-cluster-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -86,15 +86,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/src/config/jbm-standalone-beans.xml
===================================================================
--- trunk/src/config/jbm-standalone-beans.xml 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/config/jbm-standalone-beans.xml 2009-04-09 11:51:33 UTC (rev 6373)
@@ -93,15 +93,6 @@
<inject bean="MessagingServer" property="serverManagement"/>
</parameter>
<parameter>
- <inject bean="MessagingServer" property="postOffice"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="storageManager"/>
- </parameter>
- <parameter>
- <inject bean="MessagingServer" property="addressSettingsRepository"/>
- </parameter>
- <parameter>
<inject bean="JMSManagementService"/>
</parameter>
</constructor>
Modified: trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -137,12 +137,16 @@
@Parameter(name = "messageID", desc = "A message ID") long messageID)
throws Exception;
+ int sendMessagesToDeadLetterAddress(String filterStr) throws Exception;
+
@Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = ACTION)
boolean changeMessagePriority(
@Parameter(name = "messageID", desc = "A message ID") long messageID,
@Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority)
throws Exception;
+ int changeMessagesPriority(String filter, int newPriority) throws Exception;
+
CompositeData listMessageCounter() throws Exception;
void resetMessageCounter() throws Exception;
@@ -153,4 +157,6 @@
String listMessageCounterHistoryAsHTML() throws Exception;
+
+
}
Modified: trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -224,15 +224,16 @@
public synchronized void registerQueue(final Queue queue, final SimpleString address, final StorageManager storageManager) throws Exception
{
+ QueueControl queueControl = new QueueControl(queue, address.toString(), postOffice, addressSettingsRepository);
MessageCounter counter = new MessageCounter(queue.getName().toString(),
null,
- queue,
+ queueControl,
false,
queue.isDurable(),
messageCounterManager.getMaxDayCount());
+ queueControl.setMessageCounter(counter);
messageCounterManager.registerMessageCounter(queue.getName().toString(), counter);
ObjectName objectName = ObjectNames.getQueueObjectName(address, queue.getName());
- QueueControl queueControl = new QueueControl(queue, address.toString(), postOffice, addressSettingsRepository, counter);
registerInJMX(objectName, new ReplicationAwareQueueControlWrapper(queueControl, replicationInvoker));
registerInRegistry(ResourceNames.CORE_QUEUE + queue.getName(), queueControl);
Modified: trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -65,7 +65,7 @@
private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
- private final MessageCounter counter;
+ private MessageCounter counter;
// Static --------------------------------------------------------
@@ -74,18 +74,21 @@
public QueueControl(final Queue queue,
final String address,
final PostOffice postOffice,
- final HierarchicalRepository<AddressSettings> addressSettingsRepository,
- final MessageCounter counter)
+ final HierarchicalRepository<AddressSettings> addressSettingsRepository)
{
this.queue = queue;
this.address = address;
this.postOffice = postOffice;
this.addressSettingsRepository = addressSettingsRepository;
- this.counter = counter;
}
// Public --------------------------------------------------------
+ public void setMessageCounter(MessageCounter counter)
+ {
+ this.counter = counter;
+ }
+
// QueueControlMBean implementation ------------------------------
public String getName()
@@ -355,11 +358,33 @@
return moveMatchingMessages(null, otherQueueName);
}
+ public int sendMessagesToDeadLetterAddress(String filterStr) throws Exception
+ {
+ TabularData messages = listMessages(filterStr);
+ MessageInfo[] infos = MessageInfo.from(messages);
+ for (MessageInfo messageInfo : infos)
+ {
+ sendMessageToDeadLetterAddress(messageInfo.getID());
+ }
+ return infos.length;
+ }
+
public boolean sendMessageToDeadLetterAddress(final long messageID) throws Exception
{
return queue.sendMessageToDeadLetterAddress(messageID);
}
+ public int changeMessagesPriority(String filter, int newPriority) throws Exception
+ {
+ TabularData messages = listMessages(filter);
+ MessageInfo[] infos = MessageInfo.from(messages);
+ for (MessageInfo messageInfo : infos)
+ {
+ changeMessagePriority(messageInfo.getID(), newPriority);
+ }
+ return infos.length;
+ }
+
public boolean changeMessagePriority(final long messageID, final int newPriority) throws Exception
{
if (newPriority < 0 || newPriority > 9)
@@ -395,6 +420,7 @@
return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
}
+
// Package protected ---------------------------------------------
// Protected -----------------------------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareQueueControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareQueueControlWrapper.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareQueueControlWrapper.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -190,6 +190,11 @@
{
return (Boolean)replicationAwareInvoke("changeMessagePriority", messageID, newPriority);
}
+
+ public int changeMessagesPriority(String filter, int newPriority) throws Exception
+ {
+ return (Integer)replicationAwareInvoke("changeMessagesPriority", filter, newPriority);
+ }
public boolean expireMessage(final long messageID) throws Exception
{
@@ -235,6 +240,11 @@
{
return (Boolean)replicationAwareInvoke("sendMessageToDeadLetterAddress", messageID);
}
+
+ public int sendMessagesToDeadLetterAddress(String filterStr) throws Exception
+ {
+ return (Integer)replicationAwareInvoke("sendMessagesToDeadLetterAddress", filterStr);
+ }
// StandardMBean overrides ---------------------------------------
Modified: trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -27,7 +27,7 @@
import java.util.GregorianCalendar;
import java.util.List;
-import org.jboss.messaging.core.server.Queue;
+import org.jboss.messaging.core.management.QueueControlMBean;
/**
* This class stores message count informations for a given queue
@@ -59,7 +59,7 @@
private boolean destDurable;
// destination queue
- private Queue destQueue;
+ private QueueControlMBean destQueue;
// counter
private int countTotal;
@@ -93,7 +93,7 @@
* @param durable durable subsciption flag
* @param daycountmax max message history day count
*/
- public MessageCounter(String name, String subscription, Queue queue, boolean topic, boolean durable, int daycountmax)
+ public MessageCounter(String name, String subscription, QueueControlMBean queue, boolean topic, boolean durable, int daycountmax)
{
// store destination related information
destName = name;
Modified: trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -22,19 +22,24 @@
package org.jboss.messaging.jms.server.impl;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.NotificationBroadcasterSupport;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NameNotFoundException;
+import javax.naming.NamingException;
+
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.management.MessagingServerControlMBean;
import org.jboss.messaging.core.management.impl.MessagingServerControl;
import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
-import org.jboss.messaging.core.persistence.StorageManager;
-import org.jboss.messaging.core.postoffice.Binding;
-import org.jboss.messaging.core.postoffice.PostOffice;
import org.jboss.messaging.core.server.MessagingServer;
-import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
@@ -43,16 +48,6 @@
import org.jboss.messaging.jms.server.management.impl.JMSManagementServiceImpl;
import org.jboss.messaging.utils.Pair;
-import javax.management.NotificationBroadcasterSupport;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
-import javax.naming.NamingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
/**
* A Deployer used to create and add to JNDI queues, topics and connection
* factories. Typically this would only be used in an app server env.
@@ -79,12 +74,6 @@
private final MessagingServerControlMBean messagingServer;
- private final PostOffice postOffice;
-
- private final StorageManager storageManager;
-
- private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
-
private final JMSManagementService managementService;
public static JMSServerManagerImpl newJMSServerManagerImpl(final MessagingServer server) throws Exception
@@ -100,22 +89,13 @@
server.getQueueFactory());
JMSManagementService jmsManagementService = new JMSManagementServiceImpl(server.getManagementService());
return new JMSServerManagerImpl(control,
- server.getPostOffice(),
- server.getStorageManager(),
- server.getAddressSettingsRepository(),
jmsManagementService);
}
public JMSServerManagerImpl(final MessagingServerControlMBean server,
- final PostOffice postOffice,
- final StorageManager storageManager,
- final HierarchicalRepository<AddressSettings> addressSettingsRepository,
final JMSManagementService managementService)
{
messagingServer = server;
- this.postOffice = postOffice;
- this.storageManager = storageManager;
- this.addressSettingsRepository = addressSettingsRepository;
this.managementService = managementService;
}
@@ -164,13 +144,8 @@
{
addToDestinationBindings(queueName, jndiBinding);
}
- Binding binding = postOffice.getBinding(jBossQueue.getSimpleAddress());
managementService.registerQueue(jBossQueue,
- (Queue)binding.getBindable(),
- jndiBinding,
- postOffice,
- storageManager,
- addressSettingsRepository);
+ jndiBinding);
return added;
}
@@ -185,7 +160,7 @@
{
addToDestinationBindings(topicName, jndiBinding);
}
- managementService.registerTopic(jBossTopic, jndiBinding, postOffice, storageManager, addressSettingsRepository);
+ managementService.registerTopic(jBossTopic, jndiBinding);
return added;
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -24,11 +24,6 @@
import java.util.List;
-import org.jboss.messaging.core.persistence.StorageManager;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
@@ -47,19 +42,12 @@
void unregisterJMSServer() throws Exception;
void registerQueue(JBossQueue queue,
- Queue coreQueue,
- String jndiBinding,
- PostOffice postOffice,
- StorageManager storageManager,
- HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception;
+ String jndiBinding) throws Exception;
void unregisterQueue(String name) throws Exception;
void registerTopic(JBossTopic topic,
- String jndiBinding,
- PostOffice postOffice,
- StorageManager storageManager,
- HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception;
+ String jndiBinding) throws Exception;
void unregisterTopic(String name) throws Exception;
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSMessageInfo.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSMessageInfo.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSMessageInfo.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -39,6 +39,7 @@
import javax.management.openmbean.TabularType;
import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.management.MessageInfo;
import org.jboss.messaging.core.management.PropertiesInfo;
import org.jboss.messaging.core.server.ServerMessage;
import org.jboss.messaging.jms.client.JBossMessage;
@@ -57,30 +58,59 @@
private static final Logger log = Logger.getLogger(JMSMessageInfo.class);
public static final CompositeType TYPE;
+
private static final String MESSAGE_TYPE_NAME = "JMSMessageInfo";
+
private static final String MESSAGE_TABULAR_TYPE_NAME = "JMSMessageTabularInfo";
+
private static final String[] ITEM_NAMES = new String[] { "JMSMessageID",
- "JMSCorrelationID", "JMSDeliveryMode", "JMSPriority", "JMSReplyTo",
- "JMSTimestamp", "JMSType", "expiration", "properties" };
- private static final String[] ITEM_DESCRIPTIONS = new String[] {
- "Message ID", "Correlation ID", "Delivery Mode", "Priority",
- "Reply To", "Timestamp", "JMS Type", "Expiration", "Properties" };
+ "JMSCorrelationID",
+ "JMSDeliveryMode",
+ "JMSPriority",
+ "JMSReplyTo",
+ "JMSTimestamp",
+ "JMSType",
+ "expiration",
+ "properties" };
+
+ private static final String[] ITEM_DESCRIPTIONS = new String[] { "Message ID",
+ "Correlation ID",
+ "Delivery Mode",
+ "Priority",
+ "Reply To",
+ "Timestamp",
+ "JMS Type",
+ "Expiration",
+ "Properties" };
+
private static final OpenType[] TYPES;
+
private static final TabularType TABULAR_TYPE;
static
{
try
{
- TYPES = new OpenType[] { STRING, STRING, STRING, INTEGER, STRING,
- LONG, STRING, LONG, PropertiesInfo.TABULAR_TYPE };
+ TYPES = new OpenType[] { STRING,
+ STRING,
+ STRING,
+ INTEGER,
+ STRING,
+ LONG,
+ STRING,
+ LONG,
+ PropertiesInfo.TABULAR_TYPE };
TYPE = new CompositeType(MESSAGE_TYPE_NAME,
- "Information for a JMS Message", ITEM_NAMES, ITEM_DESCRIPTIONS,
- TYPES);
+ "Information for a JMS Message",
+ ITEM_NAMES,
+ ITEM_DESCRIPTIONS,
+ TYPES);
TABULAR_TYPE = new TabularType(MESSAGE_TABULAR_TYPE_NAME,
- "Information for tabular JMSMessageInfo", TYPE,
- new String[] { "JMSMessageID" });
- } catch (OpenDataException e)
+ "Information for tabular JMSMessageInfo",
+ TYPE,
+ new String[] { "JMSMessageID" });
+ }
+ catch (OpenDataException e)
{
throw new IllegalStateException(e);
}
@@ -89,19 +119,26 @@
// Attributes ----------------------------------------------------
private final String messageID;
+
private final String correlationID;
+
private final String deliveryMode;
+
private final int priority;
+
private final String replyTo;
+
private final long timestamp;
+
private final long expiration;
+
private final String jmsType;
+
private PropertiesInfo properties;
// Static --------------------------------------------------------
- public static TabularData toTabularData(JMSMessageInfo[] infos)
- throws OpenDataException
+ public static TabularData toTabularData(JMSMessageInfo[] infos) throws OpenDataException
{
TabularData data = new TabularDataSupport(TABULAR_TYPE);
for (JMSMessageInfo messageInfo : infos)
@@ -123,27 +160,26 @@
public static JMSMessageInfo fromServerMessage(ServerMessage message)
{
- String messageID = message.getProperty(JBossMessage.JBM_MESSAGE_ID)
- .toString();
- SimpleString simpleCorrelationID = (SimpleString) message
- .getProperty(JBossMessage.CORRELATIONID_HEADER_NAME);
- String correlationID = (simpleCorrelationID == null) ? null
- : simpleCorrelationID.toString();
- SimpleString simpleJMSType = (SimpleString) message
- .getProperty(JBossMessage.TYPE_HEADER_NAME);
- String jmsType = (simpleJMSType == null) ? null : simpleJMSType
- .toString();
- String deliveryMode = message.isDurable() ? "PERSISTENT"
- : "NON_PERSISTENT";
+ String messageID = message.getProperty(JBossMessage.JBM_MESSAGE_ID).toString();
+ SimpleString simpleCorrelationID = (SimpleString)message.getProperty(JBossMessage.CORRELATIONID_HEADER_NAME);
+ String correlationID = (simpleCorrelationID == null) ? null : simpleCorrelationID.toString();
+ SimpleString simpleJMSType = (SimpleString)message.getProperty(JBossMessage.TYPE_HEADER_NAME);
+ String jmsType = (simpleJMSType == null) ? null : simpleJMSType.toString();
+ String deliveryMode = message.isDurable() ? "PERSISTENT" : "NON_PERSISTENT";
int priority = message.getPriority();
- SimpleString replyAddress = (SimpleString) message
- .getProperty(JBossMessage.REPLYTO_HEADER_NAME);
+ SimpleString replyAddress = (SimpleString)message.getProperty(JBossMessage.REPLYTO_HEADER_NAME);
String replyTo = (replyAddress == null) ? null : replyAddress.toString();
long timestamp = message.getTimestamp();
long expiration = message.getExpiration();
- JMSMessageInfo info = new JMSMessageInfo(messageID, correlationID,
- deliveryMode, priority, replyTo, timestamp, expiration, jmsType);
+ JMSMessageInfo info = new JMSMessageInfo(messageID,
+ correlationID,
+ deliveryMode,
+ priority,
+ replyTo,
+ timestamp,
+ expiration,
+ jmsType);
for (SimpleString key : message.getPropertyNames())
{
info.putProperty(key.toString(), message.getProperty(key).toString());
@@ -151,11 +187,45 @@
return info;
}
+ public static JMSMessageInfo fromCoreMessage(MessageInfo coreInfo)
+ {
+ String messageID = coreInfo.getProperties().get(JBossMessage.JBM_MESSAGE_ID.toString());
+ String simpleCorrelationID = coreInfo.getProperties().get(JBossMessage.CORRELATIONID_HEADER_NAME.toString());
+ String correlationID = (simpleCorrelationID == null) ? null : simpleCorrelationID.toString();
+ String simpleJMSType = coreInfo.getProperties().get(JBossMessage.TYPE_HEADER_NAME.toString());
+ String jmsType = (simpleJMSType == null) ? null : simpleJMSType.toString();
+ String deliveryMode = coreInfo.isDurable() ? "PERSISTENT" : "NON_PERSISTENT";
+ int priority = coreInfo.getPriority();
+ String replyAddress = coreInfo.getProperties().get(JBossMessage.REPLYTO_HEADER_NAME.toString());
+ String replyTo = (replyAddress == null) ? null : replyAddress.toString();
+ long timestamp = coreInfo.getTimestamp();
+ long expiration = coreInfo.getExpiration();
+
+ JMSMessageInfo info = new JMSMessageInfo(messageID,
+ correlationID,
+ deliveryMode,
+ priority,
+ replyTo,
+ timestamp,
+ expiration,
+ jmsType);
+ for (String key : coreInfo.getProperties().keySet())
+ {
+ info.putProperty(key.toString(), coreInfo.getProperties().get(key));
+ }
+ return info;
+ }
+
// Constructors --------------------------------------------------
- public JMSMessageInfo(final String messageID, final String correlationID,
- final String deliveryMode, final int priority, final String replyTo,
- final long timestamp, final long expiration, final String jmsType)
+ public JMSMessageInfo(final String messageID,
+ final String correlationID,
+ final String deliveryMode,
+ final int priority,
+ final String replyTo,
+ final long timestamp,
+ final long expiration,
+ final String jmsType)
{
this.messageID = messageID;
this.correlationID = correlationID;
@@ -224,10 +294,17 @@
{
try
{
- return new CompositeDataSupport(TYPE, ITEM_NAMES, new Object[] {
- messageID, correlationID, deliveryMode, priority, replyTo,
- timestamp, jmsType, expiration, properties.toTabularData() });
- } catch (OpenDataException e)
+ return new CompositeDataSupport(TYPE, ITEM_NAMES, new Object[] { messageID,
+ correlationID,
+ deliveryMode,
+ priority,
+ replyTo,
+ timestamp,
+ jmsType,
+ expiration,
+ properties.toTabularData() });
+ }
+ catch (OpenDataException e)
{
log.error("Exception when converting a JMS Message to a CompositeData", e);
return null;
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -27,16 +27,13 @@
import javax.management.ObjectName;
+import org.jboss.messaging.core.management.AddressControlMBean;
import org.jboss.messaging.core.management.ManagementService;
import org.jboss.messaging.core.management.ObjectNames;
+import org.jboss.messaging.core.management.QueueControlMBean;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.messagecounter.MessageCounter;
import org.jboss.messaging.core.messagecounter.MessageCounterManager;
-import org.jboss.messaging.core.persistence.StorageManager;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
@@ -90,26 +87,21 @@
}
public synchronized void registerQueue(final JBossQueue queue,
- final Queue coreQueue,
- final String jndiBinding,
- final PostOffice postOffice,
- final StorageManager storageManager,
- HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception
+ final String jndiBinding) throws Exception
{
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue.getAddress());
MessageCounterManager messageCounterManager = managementService.getMessageCounterManager();
MessageCounter counter = new MessageCounter(queue.getName(),
null,
- coreQueue,
+ coreQueueControl,
false,
- coreQueue.isDurable(),
+ coreQueueControl.isDurable(),
messageCounterManager.getMaxDayCount());
messageCounterManager.registerMessageCounter(queue.getName(), counter);
ObjectName objectName = ObjectNames.getJMSQueueObjectName(queue.getQueueName());
JMSQueueControl control = new JMSQueueControl(queue,
- coreQueue,
+ coreQueueControl,
jndiBinding,
- postOffice,
- addressSettingsRepository,
counter);
managementService.registerInJMX(objectName,
new ReplicationAwareJMSQueueControlWrapper(control,
@@ -125,13 +117,11 @@
}
public synchronized void registerTopic(final JBossTopic topic,
- final String jndiBinding,
- final PostOffice postOffice,
- final StorageManager storageManager,
- final HierarchicalRepository<AddressSettings> addressSettingsRepository) throws Exception
+ final String jndiBinding) throws Exception
{
ObjectName objectName = ObjectNames.getJMSTopicObjectName(topic.getTopicName());
- TopicControl control = new TopicControl(topic, jndiBinding, postOffice);
+ AddressControlMBean addressControl = (AddressControlMBean)managementService.getResource(ResourceNames.CORE_ADDRESS + topic.getAddress());
+ TopicControl control = new TopicControl(topic, addressControl, jndiBinding, managementService);
managementService.registerInJMX(objectName, new ReplicationAwareTopicControlWrapper(control,
managementService.getReplicationOperationInvoker()));
managementService.registerInRegistry(ResourceNames.JMS_TOPIC + topic.getTopicName(), control);
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -29,25 +29,17 @@
import javax.management.openmbean.TabularData;
import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.filter.Filter;
-import org.jboss.messaging.core.filter.impl.FilterImpl;
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.management.MessageCounterInfo;
+import org.jboss.messaging.core.management.MessageInfo;
+import org.jboss.messaging.core.management.QueueControlMBean;
import org.jboss.messaging.core.messagecounter.MessageCounter;
import org.jboss.messaging.core.messagecounter.impl.MessageCounterHelper;
-import org.jboss.messaging.core.postoffice.Binding;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.server.MessageReference;
-import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.server.ServerMessage;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.client.JBossMessage;
import org.jboss.messaging.jms.client.SelectorTranslator;
import org.jboss.messaging.jms.server.management.JMSMessageInfo;
import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.utils.SimpleString;
/**
* @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
@@ -64,44 +56,35 @@
// Attributes ----------------------------------------------------
private final JBossQueue managedQueue;
+
+ private final QueueControlMBean coreQueueControl;
- private final Queue coreQueue;
-
private final String binding;
- private final PostOffice postOffice;
-
- private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
-
private final MessageCounter counter;
// Static --------------------------------------------------------
- public static Filter createFilterFromJMSSelector(final String selectorStr) throws MessagingException
+ public static String createFilterFromJMSSelector(final String selectorStr) throws MessagingException
{
- String filterStr = (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
- return FilterImpl.createFilter(filterStr);
+ return (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
}
- private static Filter createFilterForJMSMessageID(String jmsMessageID) throws Exception
+ private static String createFilterForJMSMessageID(String jmsMessageID) throws Exception
{
- return new FilterImpl(new SimpleString(JBossMessage.JBM_MESSAGE_ID + " = '" + jmsMessageID + "'"));
+ return JBossMessage.JBM_MESSAGE_ID + " = '" + jmsMessageID + "'";
}
// Constructors --------------------------------------------------
- public JMSQueueControl(final JBossQueue queue,
- final Queue coreQueue,
+ public JMSQueueControl(final JBossQueue managedQueue,
+ final QueueControlMBean coreQueueControl,
final String jndiBinding,
- final PostOffice postOffice,
- final HierarchicalRepository<AddressSettings> addressSettingsRepository,
final MessageCounter counter)
{
- this.managedQueue = queue;
- this.coreQueue = coreQueue;
+ this.managedQueue = managedQueue;
+ this.coreQueueControl = coreQueueControl;
this.binding = jndiBinding;
- this.postOffice = postOffice;
- this.addressSettingsRepository = addressSettingsRepository;
this.counter = counter;
}
@@ -126,32 +109,32 @@
public int getMessageCount()
{
- return coreQueue.getMessageCount();
+ return coreQueueControl.getMessageCount();
}
public int getMessagesAdded()
{
- return coreQueue.getMessagesAdded();
+ return coreQueueControl.getMessagesAdded();
}
public int getConsumerCount()
{
- return coreQueue.getConsumerCount();
+ return coreQueueControl.getConsumerCount();
}
public int getDeliveringCount()
{
- return coreQueue.getDeliveringCount();
+ return coreQueueControl.getDeliveringCount();
}
public long getScheduledCount()
{
- return coreQueue.getScheduledCount();
+ return coreQueueControl.getScheduledCount();
}
public boolean isDurable()
{
- return coreQueue.isDurable();
+ return coreQueueControl.isDurable();
}
public String getJNDIBinding()
@@ -161,77 +144,44 @@
public String getDeadLetterAddress()
{
- AddressSettings addressSettings = addressSettingsRepository.getMatch(getAddress());
- if (addressSettings != null && addressSettings.getDeadLetterAddress() != null)
- {
- return addressSettings.getDeadLetterAddress().toString();
- }
- else
- {
- return null;
- }
+ return coreQueueControl.getDeadLetterAddress();
}
public void setDeadLetterAddress(String deadLetterAddress) throws Exception
{
- AddressSettings addressSettings = addressSettingsRepository.getMatch(getAddress());
-
- if (deadLetterAddress != null)
- {
- addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
- }
+ coreQueueControl.setDeadLetterAddress(deadLetterAddress);
}
public String getExpiryAddress()
{
- AddressSettings addressSettings = addressSettingsRepository.getMatch(getAddress());
- if (addressSettings != null && addressSettings.getExpiryAddress() != null)
- {
- return addressSettings.getExpiryAddress().toString();
- }
- else
- {
- return null;
- }
+ return coreQueueControl.getExpiryAddress();
}
- public void setExpiryAddress(String expiryQueueName)
+ public void setExpiryAddress(String expiryAddres) throws Exception
{
- AddressSettings addressSettings = addressSettingsRepository.getMatch(getAddress());
-
- if (expiryQueueName != null)
- {
- addressSettings.setExpiryAddress(new SimpleString(expiryQueueName));
- }
+ coreQueueControl.setExpiryAddress(expiryAddres);
}
public boolean removeMessage(final String messageID) throws Exception
{
- Filter filter = createFilterForJMSMessageID(messageID);
- List<MessageReference> refs = coreQueue.list(filter);
- if (refs.size() != 1)
+ String filter = createFilterForJMSMessageID(messageID);
+ int removed = coreQueueControl.removeMatchingMessages(filter);
+ if (removed != 1)
{
throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
}
- return coreQueue.deleteReference(refs.get(0).getMessage().getMessageID());
+ return true;
}
public int removeMatchingMessages(String filterStr) throws Exception
{
- try
- {
- Filter filter = createFilterFromJMSSelector(filterStr);
- return coreQueue.deleteMatchingReferences(filter);
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.removeMatchingMessages(filter);
}
public int removeAllMessages() throws Exception
{
- return coreQueue.deleteAllReferences();
+ return coreQueueControl.removeAllMessages();
}
public TabularData listAllMessages() throws Exception
@@ -243,14 +193,13 @@
{
try
{
- Filter filter = createFilterFromJMSSelector(filterStr);
-
- List<MessageReference> messageRefs = coreQueue.list(filter);
- List<JMSMessageInfo> infos = new ArrayList<JMSMessageInfo>(messageRefs.size());
- for (MessageReference messageRef : messageRefs)
+ String filter = createFilterFromJMSSelector(filterStr);
+ TabularData coreMessages = coreQueueControl.listMessages(filter);
+ List<JMSMessageInfo> infos = new ArrayList<JMSMessageInfo>(coreMessages.size());
+ MessageInfo[] coreMessageInfos = MessageInfo.from(coreMessages);
+ for (MessageInfo messageInfo : coreMessageInfos)
{
- ServerMessage message = messageRef.getMessage();
- JMSMessageInfo info = JMSMessageInfo.fromServerMessage(message);
+ JMSMessageInfo info = JMSMessageInfo.fromCoreMessage(messageInfo);
infos.add(info);
}
return JMSMessageInfo.toTabularData(infos);
@@ -263,91 +212,67 @@
public int countMessages(final String filterStr) throws Exception
{
- Filter filter = createFilterFromJMSSelector(filterStr);
- List<MessageReference> messageRefs = coreQueue.list(filter);
- return messageRefs.size();
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.countMessages(filter);
}
public boolean expireMessage(final String messageID) throws Exception
{
- Filter filter = createFilterForJMSMessageID(messageID);
- List<MessageReference> refs = coreQueue.list(filter);
- if (refs.size() != 1)
+ String filter = createFilterForJMSMessageID(messageID);
+ int expired = coreQueueControl.expireMessages(filter);
+ if (expired != 1)
{
throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
}
- return coreQueue.expireReference(refs.get(0).getMessage().getMessageID());
+ return true;
}
public int expireMessages(final String filterStr) throws Exception
{
- try
- {
- Filter filter = createFilterFromJMSSelector(filterStr);
- return coreQueue.expireReferences(filter);
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.expireMessages(filter);
}
public boolean sendMessageToDLQ(final String messageID) throws Exception
{
- Filter filter = createFilterForJMSMessageID(messageID);
- List<MessageReference> refs = coreQueue.list(filter);
- if (refs.size() != 1)
+ String filter = createFilterForJMSMessageID(messageID);
+ int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+ if (dead != 1)
{
throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
}
- return coreQueue.sendMessageToDeadLetterAddress(refs.get(0).getMessage().getMessageID());
+ return true;
}
public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
{
- if (newPriority < 0 || newPriority > 9)
+ String filter = createFilterForJMSMessageID(messageID);
+ int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
+ if (changed != 1)
{
- throw new IllegalArgumentException("invalid newPriority value: " + newPriority +
- ". It must be between 0 and 9 (both included)");
- }
- Filter filter = createFilterForJMSMessageID(messageID);
- List<MessageReference> refs = coreQueue.list(filter);
- if (refs.size() != 1)
- {
throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
}
- return coreQueue.changeReferencePriority(refs.get(0).getMessage().getMessageID(), (byte)newPriority);
+ return true;
}
public boolean moveMessage(String messageID, String otherQueueName) throws Exception
{
+ String filter = createFilterForJMSMessageID(messageID);
JBossQueue otherQueue = new JBossQueue(otherQueueName);
- Binding binding = postOffice.getBinding(otherQueue.getSimpleAddress());
- if (binding == null)
+ int moved = coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
+ if (moved != 1)
{
- throw new IllegalArgumentException("No queue found for " + otherQueueName);
- }
- Filter filter = createFilterForJMSMessageID(messageID);
- List<MessageReference> refs = coreQueue.list(filter);
- if (refs.size() != 1)
- {
throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
}
-
- return coreQueue.moveReference(refs.get(0).getMessage().getMessageID(), binding.getAddress());
+
+ return true;
}
public int moveMatchingMessages(String filterStr, String otherQueueName) throws Exception
{
+ String filter = createFilterFromJMSSelector(filterStr);
JBossQueue otherQueue = new JBossQueue(otherQueueName);
- Binding otherBinding = postOffice.getBinding(otherQueue.getSimpleAddress());
- if (otherBinding == null)
- {
- throw new IllegalArgumentException("No queue found for " + otherQueueName);
- }
-
- Filter filter = createFilterFromJMSSelector(filterStr);
- return coreQueue.moveReferences(filter, otherBinding.getAddress());
+ return coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
}
public int moveAllMessages(String otherQueueName) throws Exception
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -28,22 +28,20 @@
import javax.management.openmbean.TabularData;
-import org.jboss.messaging.core.filter.Filter;
-import org.jboss.messaging.core.filter.impl.FilterImpl;
+import org.jboss.messaging.core.exception.MessagingException;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.postoffice.Binding;
-import org.jboss.messaging.core.postoffice.BindingType;
-import org.jboss.messaging.core.postoffice.Bindings;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.server.MessageReference;
-import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.server.ServerMessage;
+import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.ManagementService;
+import org.jboss.messaging.core.management.MessageInfo;
+import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.jms.JBossTopic;
+import org.jboss.messaging.jms.client.SelectorTranslator;
import org.jboss.messaging.jms.server.management.JMSMessageInfo;
import org.jboss.messaging.jms.server.management.SubscriptionInfo;
import org.jboss.messaging.jms.server.management.TopicControlMBean;
import org.jboss.messaging.utils.Pair;
-import org.jboss.messaging.utils.SimpleString;
/**
* @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
@@ -63,19 +61,28 @@
private final String binding;
- private final PostOffice postOffice;
+ private AddressControlMBean addressControl;
+ private ManagementService managementService;
+
// Static --------------------------------------------------------
+ public static String createFilterFromJMSSelector(final String selectorStr) throws MessagingException
+ {
+ return (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
+ }
+
// Constructors --------------------------------------------------
public TopicControl(final JBossTopic topic,
+ final AddressControlMBean addressControl,
final String jndiBinding,
- final PostOffice postOffice)
+ final ManagementService managementService)
{
this.managedTopic = topic;
+ this.addressControl = addressControl;
this.binding = jndiBinding;
- this.postOffice = postOffice;
+ this.managementService = managementService;
}
// TopicControlMBean implementation ------------------------------
@@ -147,20 +154,17 @@
public TabularData listMessagesForSubscription(final String queueName) throws Exception
{
- SimpleString sAddress = new SimpleString(queueName);
- Binding binding = postOffice.getBinding(sAddress);
- if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
{
- throw new IllegalArgumentException("No queue with name " + sAddress);
+ throw new IllegalArgumentException("No subscriptions with name " + queueName);
}
- Queue queue = (Queue)binding.getBindable();
- List<MessageReference> messageRefs = queue.list(null);
- List<JMSMessageInfo> infos = new ArrayList<JMSMessageInfo>(messageRefs.size());
-
- for (MessageReference messageRef : messageRefs)
+ TabularData coreMessages = coreQueueControl.listAllMessages();
+ List<JMSMessageInfo> infos = new ArrayList<JMSMessageInfo>(coreMessages.size());
+ MessageInfo[] coreMessageInfos = MessageInfo.from(coreMessages);
+ for (MessageInfo messageInfo : coreMessageInfos)
{
- ServerMessage message = messageRef.getMessage();
- JMSMessageInfo info = JMSMessageInfo.fromServerMessage(message);
+ JMSMessageInfo info = JMSMessageInfo.fromCoreMessage(messageInfo);
infos.add(info);
}
return JMSMessageInfo.toTabularData(infos);
@@ -169,30 +173,23 @@
public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
{
String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- SimpleString sAddress = new SimpleString(queueName);
- Binding binding = postOffice.getBinding(sAddress);
- if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
{
- throw new IllegalArgumentException("No queue with name " + sAddress);
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
}
- Queue queue = (Queue)binding.getBindable();
- Filter filter = FilterImpl.createFilter(filterStr);
- List<MessageReference> messageRefs = queue.list(filter);
- return messageRefs.size();
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.listMessages(filter).size();
}
public int removeAllMessages() throws Exception
{
int count = 0;
- Bindings bindings = postOffice.getBindingsForAddress(managedTopic.getSimpleAddress());
-
- for (Binding binding : bindings.getBindings())
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
{
- if (binding.getType() == BindingType.LOCAL_QUEUE)
- {
- Queue queue = (Queue)binding.getBindable();
- count += queue.deleteAllReferences();
- }
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+ count += coreQueueControl.removeAllMessages();
}
return count;
@@ -201,34 +198,22 @@
public void dropDurableSubscription(String clientID, String subscriptionName) throws Exception
{
String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- Binding binding = postOffice.getBinding(new SimpleString(queueName));
-
- if (binding == null || binding.getType() != BindingType.LOCAL_QUEUE)
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
{
- throw new IllegalArgumentException("No durable subscription for clientID=" + clientID +
- ", subcription=" +
- subscriptionName);
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
}
-
- Queue queue = (Queue)binding.getBindable();
-
- queue.deleteAllReferences();
-
- postOffice.removeBinding(queue.getName());
+ MessagingServerControlMBean serverControl = (MessagingServerControlMBean)managementService.getResource(ResourceNames.CORE_SERVER);
+ serverControl.destroyQueue(queueName);
}
public void dropAllSubscriptions() throws Exception
{
- Bindings bindings = postOffice.getBindingsForAddress(managedTopic.getSimpleAddress());
-
- for (Binding binding : bindings.getBindings())
+ MessagingServerControlMBean serverControl = (MessagingServerControlMBean)managementService.getResource(ResourceNames.CORE_SERVER);
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
{
- if (binding.getType() == BindingType.LOCAL_QUEUE)
- {
- Queue queue = (Queue)binding.getBindable();
- queue.deleteAllReferences();
- postOffice.removeBinding(queue.getName());
- }
+ serverControl.destroyQueue(queue);
}
}
@@ -240,10 +225,10 @@
private SubscriptionInfo[] listSubscribersInfos(final DurabilityType durability)
{
- List<Queue> queues = getQueues(durability);
+ List<QueueControlMBean> queues = getQueues(durability);
List<SubscriptionInfo> subInfos = new ArrayList<SubscriptionInfo>(queues.size());
- for (Queue queue : queues)
+ for (QueueControlMBean queue : queues)
{
String clientID = null;
String subName = null;
@@ -255,8 +240,8 @@
subName = pair.b;
}
- String filter = queue.getFilter() != null ? queue.getFilter().getFilterString().toString() : null;
- SubscriptionInfo info = new SubscriptionInfo(queue.getName().toString(),
+ String filter = queue.getFilter() != null ? queue.getFilter() : null;
+ SubscriptionInfo info = new SubscriptionInfo(queue.getName(),
clientID,
subName,
queue.isDurable(),
@@ -269,35 +254,32 @@
private int getMessageCount(final DurabilityType durability)
{
- List<Queue> queues = getQueues(durability);
+ List<QueueControlMBean> queues = getQueues(durability);
int count = 0;
- for (Queue queue : queues)
+ for (QueueControlMBean queue : queues)
{
count += queue.getMessageCount();
}
return count;
}
- private List<Queue> getQueues(final DurabilityType durability)
+ private List<QueueControlMBean> getQueues(final DurabilityType durability)
{
try
{
- Bindings bindings = postOffice.getBindingsForAddress(managedTopic.getSimpleAddress());
- List<Queue> matchingQueues = new ArrayList<Queue>();
-
- for (Binding binding : bindings.getBindings())
+ List<QueueControlMBean> matchingQueues = new ArrayList<QueueControlMBean>();
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
{
- if (binding.getType() == BindingType.LOCAL_QUEUE)
+ QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+
+ //Ignore the "special" subscription
+ if (!coreQueueControl.getName().equals(addressControl.getAddress()))
{
- Queue queue = (Queue)binding.getBindable();
- //Ignore the "special" subscription
- if (!binding.getUniqueName().equals(binding.getAddress()))
+ if (durability == DurabilityType.ALL || (durability == DurabilityType.DURABLE && coreQueueControl.isDurable()) ||
+ (durability == DurabilityType.NON_DURABLE && !coreQueueControl.isDurable()))
{
- if (durability == DurabilityType.ALL || (durability == DurabilityType.DURABLE && queue.isDurable()) ||
- (durability == DurabilityType.NON_DURABLE && !queue.isDurable()))
- {
- matchingQueues.add(queue);
- }
+ matchingQueues.add(coreQueueControl);
}
}
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java 2009-04-08 18:30:19 UTC (rev 6372)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java 2009-04-09 11:51:33 UTC (rev 6373)
@@ -64,6 +64,11 @@
return (Boolean)proxy.invokeOperation("changeMessagePriority", messageID, newPriority);
}
+ public int changeMessagesPriority(String filter, int newPriority) throws Exception
+ {
+ return (Integer)proxy.invokeOperation("changeMessagePriority", filter, newPriority);
+ }
+
public int countMessages(String filter) throws Exception
{
return (Integer)proxy.invokeOperation("countMessages", filter);
@@ -223,6 +228,11 @@
{
return (Boolean)proxy.invokeOperation("sendMessageToDeadLetterAddress", messageID);
}
+
+ public int sendMessagesToDeadLetterAddress(String filterStr) throws Exception
+ {
+ return (Integer)proxy.invokeOperation("sendMessagesToDeadLetterAddress", filterStr);
+ }
public void setDeadLetterAddress(String deadLetterAddress) throws Exception
{
More information about the jboss-cvs-commits
mailing list