[jboss-cvs] JBoss Messaging SVN: r7294 - in trunk: examples/jms/client-kickoff/src/org/jboss/jms/example and 20 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jun 10 10:30:05 EDT 2009
Author: jmesnil
Date: 2009-06-10 10:30:03 -0400 (Wed, 10 Jun 2009)
New Revision: 7294
Added:
trunk/src/main/org/jboss/messaging/core/management/AcceptorControl.java
trunk/src/main/org/jboss/messaging/core/management/AddressControl.java
trunk/src/main/org/jboss/messaging/core/management/BridgeControl.java
trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControl.java
trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControl.java
trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControl.java
trunk/src/main/org/jboss/messaging/core/management/DivertControl.java
trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java
trunk/src/main/org/jboss/messaging/core/management/QueueControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/AddressControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/DivertControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControlImpl.java
trunk/src/main/org/jboss/messaging/core/management/impl/QueueControlImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControlImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControlImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControlImpl.java
Removed:
trunk/src/main/org/jboss/messaging/core/management/AcceptorControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/AddressControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/BridgeControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/DivertControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java
trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/AddressControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/DivertControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java
Modified:
trunk/docs/user-manual/en/configuration-index.xml
trunk/docs/user-manual/en/management.xml
trunk/examples/jms/client-kickoff/src/org/jboss/jms/example/ClientKickoffExample.java
trunk/examples/jms/jmx/src/org/jboss/jms/example/JMXExample.java
trunk/examples/jms/message-counters/src/org/jboss/jms/example/MessageCounterExample.java
trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java
trunk/src/main/org/jboss/messaging/core/management/ManagementService.java
trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareAddressControlWrapper.java
trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.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/core/server/MessagingServer.java
trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java
trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSQueueControlWrapper.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareTopicControlWrapper.java
trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
trunk/tests/src/org/jboss/messaging/tests/integration/client/HeuristicXATest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/bridge/BridgeTestBase.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSServerControlWrapperTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControl2Test.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/TopicControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/BridgeControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.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/management/QueueControlTest.java
trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java
Log:
JBMESSAGING-1603: Rename resource MBeans and controls
* renamed management interfaces XXXControlMBean to XXXControl
& their implementation to XXXControlImpl
* removed remaining StandardMBean dependency from the management objects.
JMX MBeans are defined in management.jmx.impl package only
* updated doc
Modified: trunk/docs/user-manual/en/configuration-index.xml
===================================================================
--- trunk/docs/user-manual/en/configuration-index.xml 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/docs/user-manual/en/configuration-index.xml 2009-06-10 14:30:03 UTC (rev 7294)
@@ -201,6 +201,14 @@
</row>
<row>
<entry><link linkend="management.replication"
+ >management-cluster-user</link></entry>
+ <entry>String</entry>
+ <entry>the user used to for replicating management operations
+ between clustered nodes</entry>
+ <entry>JBM.MANAGEMENT.ADMIN.USER</entry>
+ </row>
+ <row>
+ <entry><link linkend="management.replication"
>management-cluster-password</link></entry>
<entry>String</entry>
<entry>the password used to for replicating management operations
Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/docs/user-manual/en/management.xml 2009-06-10 14:30:03 UTC (rev 7294)
@@ -56,7 +56,7 @@
<para>Core queues can be created or destroyed using the management operations
<literal>createQueue()</literal> or <literal>deployQueue()</literal> or
<literal>destroyQueue()</literal>)on the <literal
- >MessagingServerControlMBean</literal> (with the ObjectName <literal
+ >MessagingServerControl</literal> (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Server</literal> or the resource name
<literal>core.server</literal>)</para>
<para><literal>createQueue</literal> will fail if the queue already exists while
@@ -93,7 +93,7 @@
</listitem>
<listitem>
<para>Retrieving the server configuration and attributes</para>
- <para>The <literal>MessagingServerControlMBean</literal> exposes JBoss Messaging
+ <para>The <literal>MessagingServerControl</literal> exposes JBoss Messaging
server configuration through all its attributes (e.g. <literal
>getVersion()</literal> method to retrieve the server's version,
etc.)</para>
@@ -102,7 +102,7 @@
</section>
<section>
<title>Core Address Management</title>
- <para>Core addresses can be managed using the <literal>AddressControlMBean</literal>
+ <para>Core addresses can be managed using the <literal>AddressControl</literal>
class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Address,name="<the address
name>"</literal> or the resource name <literal>core.address.<the address
@@ -120,7 +120,7 @@
<section>
<title>Core Queue Management</title>
<para>The bulk of the core management API deals with core queues. The <literal
- >QueueControlMBean</literal> class defines the Core queue management operations
+ >QueueControl</literal> class defines the Core queue management operations
(with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Queue,address="<the bound
address>",name="<the queue name>"</literal> or the resource name <literal
@@ -180,7 +180,7 @@
</listitem>
<listitem>
<para>Retrieving the queue attributes</para>
- <para>The <literal>QueueControlMBean</literal> exposes Core queue settings through
+ <para>The <literal>QueueControl</literal> exposes Core queue settings through
its attributes (e.g. <literal>getFilter()</literal> to retrieve the queue's
filter if it was created with one, <literal>isDurable()</literal> to know
wether the queue is durable or not, etc.)</para>
@@ -198,69 +198,69 @@
<para>Acceptors</para>
<para>They can be started or stopped using the <literal>start()</literal> or.
<literal>stop()</literal> method on the <literal
- >AcceptorControlMBean</literal> class (with the ObjectName <literal
+ >AcceptorControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Acceptor,name="<the acceptor
name>"</literal> or the resource name <literal>core.acceptor.<the
address name></literal>). The acceptors parameters can be retrieved using
- the <literal>AcceptorControlMBean</literal> attributes (see <xref
+ the <literal>AcceptorControl</literal> attributes (see <xref
linkend="configuring-transports.acceptors"/>)</para>
</listitem>
<listitem>
<para>Diverts</para>
<para>They can be started or stopped using the <literal>start()</literal> or
<literal>stop()</literal> method on the <literal
- >DivertControlMBean</literal> class (with the ObjectName <literal
+ >DivertControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Divert,name=<the divert
name></literal> or the resource name <literal>core.divert.<the divert
name></literal>). Diverts parameters can be retrieved using the <literal
- >DivertControlMBean</literal> attributes (see <xref linkend="diverts"
+ >DivertControl</literal> attributes (see <xref linkend="diverts"
/>)</para>
</listitem>
<listitem>
<para>Bridges</para>
<para>They can be started or stopped using the <literal>start()</literal> (resp.
<literal>stop()</literal>) method on the <literal
- >BridgeControlMBean</literal> class (with the ObjectName <literal
+ >BridgeControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=Bridge,name="<the bridge
name>"</literal> or the resource name <literal>core.bridge.<the bridge
name></literal>). Bridges parameters can be retrieved using the <literal
- >BridgeControlMBean</literal> attributes (see <xref linkend="core-bridges"
+ >BridgeControl</literal> attributes (see <xref linkend="core-bridges"
/>)</para>
</listitem>
<listitem>
<para>Broadcast groups</para>
<para>They can be started or stopped using the <literal>start()</literal> or
<literal>stop()</literal> method on the <literal
- >BroadcastGroupControlMBean</literal> class (with the ObjectName <literal
+ >BroadcastGroupControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=BroadcastGroup,name="<the broadcast
group name>"</literal> or the resource name <literal
>core.broadcastgroup.<the broadcast group name></literal>). Broadcast
groups parameters can be retrieved using the <literal
- >BroadcastGroupControlMBean</literal> attributes (see <xref
+ >BroadcastGroupControl</literal> attributes (see <xref
linkend="clusters.broadcast-groups"/>)</para>
</listitem>
<listitem>
<para>Discovery groups</para>
<para>They can be started or stopped using the <literal>start()</literal> or
<literal>stop()</literal> method on the <literal
- >DiscoveryGroupControlMBean</literal> class (with the ObjectName <literal
+ >DiscoveryGroupControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=DiscoveryGroup,name="<the discovery
group name>"</literal> or the resource name <literal
>core.discovery.<the discovery group name></literal>). Discovery
groups parameters can be retrieved using the <literal
- >DiscoveryGroupControlMBean</literal> attributes (see <xref
+ >DiscoveryGroupControl</literal> attributes (see <xref
linkend="clusters.discovery-groups"/>)</para>
</listitem>
<listitem>
<para>Cluster connections</para>
<para>They can be started or stopped using the <literal>start()</literal> or
<literal>stop()</literal> method on the <literal
- >ClusterConnectionControlMBean</literal> class (with the ObjectName <literal
+ >ClusterConnectionControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=Core,type=ClusterConnection,name="<the
cluster connection name>"</literal> or the resource name <literal
>core.clusterconnection.<the cluster connection name></literal>).
Cluster connections parameters can be retrieved using the <literal
- >ClusterConnectionControlMBean</literal> attributes (see <xref
+ >ClusterConnectionControl</literal> attributes (see <xref
linkend="clusters.cluster-connections"/>)</para>
</listitem>
</itemizedlist>
@@ -273,7 +273,7 @@
<section>
<title>JMS Server Management</title>
<para>JMS Resources (connection factories and destinations) can be created using the
- <literal>JMSServerControlMBean</literal> class (with the ObjectName <literal
+ <literal>JMSServerControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=JMS,type=Server</literal> or the resource name
<literal>jms.server</literal>).</para>
<itemizedlist>
@@ -312,14 +312,14 @@
<section>
<title>JMS ConnectionFactory Management</title>
<para>JMS Connection Factories can be managed using the <literal
- >ConnectionFactoryControlMBean</literal> class (with the ObjectName <literal
+ >ConnectionFactoryControl</literal> class (with the ObjectName <literal
>org.jboss.messaging:module=JMS,type=ConnectionFactory,name="<the connection
factory name>"</literal> or the resource name <literal
>jms.connectionfactory.<the connection factory name></literal>).</para>
<itemizedlist>
<listitem>
<para>Retrieving connection factory attributes</para>
- <para>The <literal>ConnectionFactoryControlMBean</literal> exposes JMS
+ <para>The <literal>ConnectionFactoryControl</literal> exposes JMS
ConnectionFactory configuration through its attributes (e.g. <literal
>getConsumerWindowSize()</literal> to retrieve the consumer window size for
flow control, <literal>isBlockOnNonPersistentSend()</literal> to know wether
@@ -330,7 +330,7 @@
</section>
<section>
<title>JMS Queue Management</title>
- <para>JMS queues can be managed using the <literal>JMSQueueControlMBean</literal> class
+ <para>JMS queues can be managed using the <literal>JMSQueueControl</literal> class
(with the ObjectName <literal>org.jboss.messaging:module=JMS,type=Queue,name="<the
queue name>"</literal> or the resource name <literal>jms.queue.<the queue
name></literal>). </para>
@@ -386,7 +386,7 @@
</listitem>
<listitem>
<para>Retrieving the queue attributes</para>
- <para>The <literal>JMSQueueControlMBean</literal> exposes JMS queue settings
+ <para>The <literal>JMSQueueControl</literal> exposes JMS queue settings
through its attributes (e.g. <literal>isTemporary()</literal> to know wether
the queue is temporary or not, <literal>isDurable()</literal> to know wether
the queue is durable or not, etc.)</para>
@@ -395,7 +395,7 @@
</section>
<section>
<title>JMS Topic Management</title>
- <para>JMS Topics can be managed using the <literal>TopicControlMBean</literal> class
+ <para>JMS Topics can be managed using the <literal>TopicControl</literal> class
(with the ObjectName <literal>org.jboss.messaging:module=JMS,type=Topic,name="<the
topic name>"</literal> or the resource name <literal>jms.topic.<the topic
name></literal>).</para>
@@ -441,7 +441,7 @@
</programlisting>
<para>and the MBean is:</para>
<programlisting>
- org.jboss.messaging.jms.server.management.JMSQueueControlMBean
+ org.jboss.messaging.jms.server.management.JMSQueueControl
</programlisting>
<para>The MBean's <literal>ObjectName</literal> are built using the helper class <literal
>org.jboss.messaging.core.management.ObjectNames</literal>. You can also use <literal
@@ -632,7 +632,7 @@
</section>
</section>
<section id="management.replication">
- <title>Management Cluster Password</title>
+ <title>Management Cluster Credentials</title>
<para>JBoss Messaging allows <emphasis>replication</emphasis> of a live server to a backup
server. This impacts management as resources created on the live server (e.g. a core
address) must also be created on the backup server. Otherwise, when failover occurs, the
@@ -646,15 +646,16 @@
created on the backup server.</para>
<para>If core or JMS messages are used to invoke management operations, replication is handled
automatically by JBoss Messaging.</para>
- <para>To allow this management replication with JMX, JBoss Messaging defines a
- <emphasis>management cluster password</emphasis>: this special password <emphasis>must
+ <para>To allow this management replication with JMX, JBoss Messaging defines
+ <emphasis>management cluster credentials</emphasis>: this special user/password <emphasis>must
be shared by all nodes</emphasis>. To configure it, change the value in <literal
>jbm-configuration.xml</literal>:</para>
<programlisting>
+ <management-cluster-user>JBM.MANAGEMENT.ADMIN.USER</management-cluster-user>
<management-cluster-password>CHANGE ME!!</management-cluster-password>
</programlisting>
- <para>By default, its value is <literal>CHANGE ME!!</literal>. It is strongly suggested to
- change it to a safer value. If you don't change it from the default JBoss Messaging will
+ <para>It is strongly suggested to
+ change these values from their default. If they are not changed from the default, JBoss Messaging will
detect this and pester you with a warning on every start-up.</para>
<para>JBoss Messaging internally uses Core messages to replicate management operations between
the live and backup server when JMX is used. By default, there is a timeout of 5s (5000ms)
@@ -838,9 +839,9 @@
<programlisting>
// retrieve a connection to JBoss Messaging's MBeanServer
MBeanServerConnection mbsc = ...
-JMSQueueControlMBean queueControl = (JMSQueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+JMSQueueControlMBean queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
on,
-JMSQueueControlMBean.class,
+JMSQueueControl.class,
false);
// message counters are retrieved as a JSON String
String counters = queueControl.listMessageCounter();
Modified: trunk/examples/jms/client-kickoff/src/org/jboss/jms/example/ClientKickoffExample.java
===================================================================
--- trunk/examples/jms/client-kickoff/src/org/jboss/jms/example/ClientKickoffExample.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/examples/jms/client-kickoff/src/org/jboss/jms/example/ClientKickoffExample.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -22,7 +22,7 @@
package org.jboss.jms.example;
import org.jboss.common.example.JBMExample;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ObjectNames;
import javax.jms.ExceptionListener;
@@ -85,9 +85,9 @@
ObjectName on = ObjectNames.getMessagingServerObjectName();
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, String>());
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
- MessagingServerControlMBean serverControl = (MessagingServerControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+ MessagingServerControl serverControl = (MessagingServerControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
on,
- MessagingServerControlMBean.class,
+ MessagingServerControl.class,
false);
// Step 7. List the remote address connected to the server
Modified: trunk/examples/jms/jmx/src/org/jboss/jms/example/JMXExample.java
===================================================================
--- trunk/examples/jms/jmx/src/org/jboss/jms/example/JMXExample.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/examples/jms/jmx/src/org/jboss/jms/example/JMXExample.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -23,7 +23,7 @@
import org.jboss.common.example.JBMExample;
import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@@ -97,9 +97,9 @@
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
// Step 12. Create a JMSQueueControlMBean proxy to manage the queue on the server
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+ JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
on,
- JMSQueueControlMBean.class,
+ JMSQueueControl.class,
false);
// Step 13. Display the number of messages in the queue
System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
Modified: trunk/examples/jms/message-counters/src/org/jboss/jms/example/MessageCounterExample.java
===================================================================
--- trunk/examples/jms/message-counters/src/org/jboss/jms/example/MessageCounterExample.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/examples/jms/message-counters/src/org/jboss/jms/example/MessageCounterExample.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -24,7 +24,7 @@
import org.jboss.common.example.JBMExample;
import org.jboss.messaging.core.management.MessageCounterInfo;
import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
import javax.jms.MessageConsumer;
import javax.jms.MessageProducer;
@@ -91,9 +91,9 @@
ObjectName on = ObjectNames.getJMSQueueObjectName(queue.getQueueName());
JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap());
MBeanServerConnection mbsc = connector.getMBeanServerConnection();
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)MBeanServerInvocationHandler.newProxyInstance(mbsc,
+ JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
on,
- JMSQueueControlMBean.class,
+ JMSQueueControl.class,
false);
// Step 8. List the message counters and convert them to MessageCounterInfo data structure.
Modified: trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/deployers/impl/QueueDeployer.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -24,7 +24,7 @@
import org.jboss.messaging.core.config.cluster.QueueConfiguration;
import org.jboss.messaging.core.deployers.DeploymentManager;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
@@ -37,9 +37,9 @@
*/
public class QueueDeployer extends XmlDeployer
{
- private final MessagingServerControlMBean serverControl;
+ private final MessagingServerControl serverControl;
- public QueueDeployer(final DeploymentManager deploymentManager, final MessagingServerControlMBean serverControl)
+ public QueueDeployer(final DeploymentManager deploymentManager, final MessagingServerControl serverControl)
{
super(deploymentManager);
Copied: trunk/src/main/org/jboss/messaging/core/management/AcceptorControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/AcceptorControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/AcceptorControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/AcceptorControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,44 @@
+/*
+ * 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.core.management;
+
+import java.util.Map;
+
+/**
+ * A AcceptorMBean
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ */
+public interface AcceptorControl extends MessagingComponentControlMBean
+{
+ void pause() throws Exception;
+
+ void resume() throws Exception;
+
+ String getName();
+
+ String getFactoryClassName();
+
+ Map<String, Object> getParameters();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/AcceptorControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/AcceptorControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/AcceptorControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,44 +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.core.management;
-
-import java.util.Map;
-
-/**
- * A AcceptorMBean
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- */
-public interface AcceptorControlMBean extends MessagingComponentControlMBean
-{
- void pause() throws Exception;
-
- void resume() throws Exception;
-
- String getName();
-
- String getFactoryClassName();
-
- Map<String, Object> getParameters();
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/AddressControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/AddressControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/AddressControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/AddressControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management;
+
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface AddressControl
+{
+ // Attributes ----------------------------------------------------
+
+ String getAddress();
+
+ Object[] getRoles() throws Exception;
+
+ String[] getQueueNames() throws Exception;
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "Add a Role to this address")
+ void addRole(
+ @Parameter(name = "name", desc = "Name of the role to add") String name,
+ @Parameter(name = "send", desc = "Can the user send to an address?") boolean send,
+ @Parameter(name = "consume", desc = "Can the user consume from this address?") boolean consume,
+ @Parameter(name = "createDurableQueue", desc = "Can the user create a durable queue?") boolean createDurableQueue,
+ @Parameter(name = "deleteDurableQueue", desc = "Can the user delete a durable queue?") boolean deleteDurableQueue,
+ @Parameter(name = "createNonDurableQueue", desc = "Can the user create a temp queue?") boolean createNonDurableQueue,
+ @Parameter(name = "deleteNonDurableQueue", desc = "Can the user delete a temp queue?") boolean deleteNonDurableQueue,
+ @Parameter(name = "manage", desc = "Can the user send management messages?") boolean manage)
+ throws Exception;
+
+ @Operation(desc = "Remove a Role from this address")
+ void removeRole(
+ @Parameter(name = "name", desc = "Name of the role to remove") String name)
+ throws Exception;
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/AddressControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/AddressControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/AddressControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,60 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management;
-
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface AddressControlMBean
-{
- // Attributes ----------------------------------------------------
-
- String getAddress();
-
- Object[] getRoles() throws Exception;
-
- String[] getQueueNames() throws Exception;
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "Add a Role to this address")
- void addRole(
- @Parameter(name = "name", desc = "Name of the role to add") String name,
- @Parameter(name = "send", desc = "Can the user send to an address?") boolean send,
- @Parameter(name = "consume", desc = "Can the user consume from this address?") boolean consume,
- @Parameter(name = "createDurableQueue", desc = "Can the user create a durable queue?") boolean createDurableQueue,
- @Parameter(name = "deleteDurableQueue", desc = "Can the user delete a durable queue?") boolean deleteDurableQueue,
- @Parameter(name = "createNonDurableQueue", desc = "Can the user create a temp queue?") boolean createNonDurableQueue,
- @Parameter(name = "deleteNonDurableQueue", desc = "Can the user delete a temp queue?") boolean deleteNonDurableQueue,
- @Parameter(name = "manage", desc = "Can the user send management messages?") boolean manage)
- throws Exception;
-
- @Operation(desc = "Remove a Role from this address")
- void removeRole(
- @Parameter(name = "name", desc = "Name of the role to remove") String name)
- throws Exception;
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/BridgeControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/BridgeControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/BridgeControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/BridgeControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,57 @@
+/*
+ * 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.core.management;
+
+
+/**
+ * A BridgeControlMBean
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ */
+public interface BridgeControl extends MessagingComponentControlMBean
+{
+ String getName();
+
+ String getQueueName();
+
+ String getForwardingAddress();
+
+ String getFilterString();
+
+ String getTransformerClassName();
+
+ String[] getConnectorPair() throws Exception;
+
+ String getDiscoveryGroupName();
+
+ long getRetryInterval();
+
+ double getRetryIntervalMultiplier();
+
+ int getReconnectAttempts();
+
+ boolean isFailoverOnServerShutdown();
+
+ boolean isUseDuplicateDetection();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/BridgeControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/BridgeControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/BridgeControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,57 +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.core.management;
-
-
-/**
- * A BridgeControlMBean
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- */
-public interface BridgeControlMBean extends MessagingComponentControlMBean
-{
- String getName();
-
- String getQueueName();
-
- String getForwardingAddress();
-
- String getFilterString();
-
- String getTransformerClassName();
-
- String[] getConnectorPair() throws Exception;
-
- String getDiscoveryGroupName();
-
- long getRetryInterval();
-
- double getRetryIntervalMultiplier();
-
- int getReconnectAttempts();
-
- boolean isFailoverOnServerShutdown();
-
- boolean isUseDuplicateDetection();
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,45 @@
+/*
+ * 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.core.management;
+
+
+/**
+ * A BroadcastGroupControlMBean
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ */
+public interface BroadcastGroupControl extends MessagingComponentControlMBean
+{
+ String getName();
+
+ int getLocalBindPort();
+
+ String getGroupAddress();
+
+ int getGroupPort();
+
+ long getBroadcastPeriod();
+
+ Object[] getConnectorPairs();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/BroadcastGroupControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,45 +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.core.management;
-
-
-/**
- * A BroadcastGroupControlMBean
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- */
-public interface BroadcastGroupControlMBean extends MessagingComponentControlMBean
-{
- String getName();
-
- int getLocalBindPort();
-
- String getGroupAddress();
-
- int getGroupPort();
-
- long getBroadcastPeriod();
-
- Object[] getConnectorPairs();
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,49 @@
+/*
+ * 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.core.management;
+
+
+/**
+ * A ClusterConnectionControlMBean
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ */
+public interface ClusterConnectionControl extends MessagingComponentControlMBean
+{
+ String getName();
+
+ String getAddress();
+
+ boolean isDuplicateDetection();
+
+ boolean isForwardWhenNoConsumers();
+
+ int getMaxHops();
+
+ Object[] getStaticConnectorNamePairs();
+
+ String getDiscoveryGroupName();
+
+ long getRetryInterval();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/ClusterConnectionControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,49 +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.core.management;
-
-
-/**
- * A ClusterConnectionControlMBean
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- */
-public interface ClusterConnectionControlMBean extends MessagingComponentControlMBean
-{
- String getName();
-
- String getAddress();
-
- boolean isDuplicateDetection();
-
- boolean isForwardWhenNoConsumers();
-
- int getMaxHops();
-
- Object[] getStaticConnectorNamePairs();
-
- String getDiscoveryGroupName();
-
- long getRetryInterval();
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,40 @@
+/*
+ * 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.core.management;
+
+/**
+ * A DiscoveryGroupControlMBean
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ */
+public interface DiscoveryGroupControl extends MessagingComponentControlMBean
+{
+ String getName();
+
+ String getGroupAddress();
+
+ int getGroupPort();
+
+ long getRefreshTimeout();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/DiscoveryGroupControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,40 +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.core.management;
-
-/**
- * A DiscoveryGroupControlMBean
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- */
-public interface DiscoveryGroupControlMBean extends MessagingComponentControlMBean
-{
- String getName();
-
- String getGroupAddress();
-
- int getGroupPort();
-
- long getRefreshTimeout();
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/DivertControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/DivertControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/DivertControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/DivertControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management;
+
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface DivertControl
+{
+ String getFilter();
+
+ boolean isExclusive();
+
+ String getUniqueName();
+
+ String getRoutingName();
+
+ String getAddress();
+
+ String getForwardingAddress();
+
+ String getTransformerClassName();
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/DivertControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/DivertControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/DivertControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,47 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management;
-
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface DivertControlMBean
-{
- String getFilter();
-
- boolean isExclusive();
-
- String getUniqueName();
-
- String getRoutingName();
-
- String getAddress();
-
- String getForwardingAddress();
-
- String getTransformerClassName();
-}
Modified: trunk/src/main/org/jboss/messaging/core/management/ManagementService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/ManagementService.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/ManagementService.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -34,7 +34,7 @@
import org.jboss.messaging.core.config.cluster.ClusterConnectionConfiguration;
import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
import org.jboss.messaging.core.config.cluster.DivertConfiguration;
-import org.jboss.messaging.core.management.impl.MessagingServerControl;
+import org.jboss.messaging.core.management.impl.MessagingServerControlImpl;
import org.jboss.messaging.core.messagecounter.MessageCounterManager;
import org.jboss.messaging.core.persistence.StorageManager;
import org.jboss.messaging.core.postoffice.PostOffice;
@@ -79,7 +79,7 @@
// Resource Registration
- MessagingServerControl registerServer(PostOffice postOffice,
+ MessagingServerControlImpl registerServer(PostOffice postOffice,
StorageManager storageManager,
Configuration configuration,
HierarchicalRepository<AddressSettings> addressSettingsRepository,
Copied: trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/MessagingServerControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,201 @@
+/*
+ * 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.core.management;
+
+import org.jboss.messaging.core.config.Configuration;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+import static javax.management.MBeanOperationInfo.INFO;
+
+/**
+ * This interface describes the core management interface exposed by the server
+ */
+public interface MessagingServerControl
+{
+ // Attributes ----------------------------------------------------
+
+ public String getBackupConnectorName();
+
+ String getVersion();
+
+ int getConnectionCount();
+
+ boolean isStarted();
+
+ String[] getInterceptorClassNames();
+
+ boolean isClustered();
+
+ int getScheduledThreadPoolMaxSize();
+
+ int getThreadPoolMaxSize();
+
+ long getSecurityInvalidationInterval();
+
+ boolean isSecurityEnabled();
+
+ String getBindingsDirectory();
+
+ String getJournalDirectory();
+
+ String getJournalType();
+
+ boolean isJournalSyncTransactional();
+
+ boolean isJournalSyncNonTransactional();
+
+ int getJournalFileSize();
+
+ int getJournalMinFiles();
+
+ int getJournalMaxAIO();
+
+ boolean isCreateBindingsDir();
+
+ boolean isCreateJournalDir();
+
+ Configuration getConfiguration();
+
+ boolean isMessageCounterEnabled();
+
+ int getMessageCounterMaxDayCount();
+
+ void setMessageCounterMaxDayCount(int count) throws Exception;
+
+ long getMessageCounterSamplePeriod();
+
+ void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
+
+ public boolean isBackup();
+
+ int getAIOBufferSize();
+
+ int getAIOBufferTimeout();
+
+ public long getPagingMaxGlobalSizeBytes();
+
+ public String getPagingDirectory();
+
+ boolean isPersistDeliveryCountBeforeDelivery();
+
+ long getQueueActivationTimeout();
+
+ long getConnectionTTLOverride();
+
+ String getManagementAddress();
+
+ String getManagementNotificationAddress();
+
+ long getManagementRequestTimeout();
+
+ int getIDCacheSize();
+
+ boolean isPersistIDCache();
+
+ int getGlobalPageSize();
+
+ String getLargeMessagesDirectory();
+
+ boolean isWildcardRoutingEnabled();
+
+ long getTransactionTimeout();
+
+ long getTransactionTimeoutScanPeriod();
+
+ long getMessageExpiryScanPeriod();
+
+ long getMessageExpiryThreadPriority();
+
+ Object[] getConnectors() throws Exception;
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "Create a queue with the specified address", impact = ACTION)
+ void createQueue(@Parameter(name = "address", desc = "Address of the queue")
+ String address, @Parameter(name = "name", desc = "Name of the queue")
+ String name) throws Exception;
+
+ @Operation(desc = "Create a queue", impact = ACTION)
+ void createQueue(@Parameter(name = "address", desc = "Address of the queue")
+ String address, @Parameter(name = "name", desc = "Name of the queue")
+ String name, @Parameter(name = "filter", desc = "Filter of the queue")
+ String filter, @Parameter(name = "durable", desc = "Is the queue durable?")
+ boolean durable) throws Exception;
+
+ @Operation(desc = "Deploy a queue", impact = ACTION)
+ void deployQueue(@Parameter(name = "address", desc = "Address of the queue")
+ String address, @Parameter(name = "name", desc = "Name of the queue")
+ String name, String filterString) throws Exception;
+
+ @Operation(desc = "Deploy a queue", impact = ACTION)
+ void deployQueue(@Parameter(name = "address", desc = "Address of the queue")
+ String address, @Parameter(name = "name", desc = "Name of the queue")
+ String name, @Parameter(name = "filter", desc = "Filter of the queue")
+ String filter, @Parameter(name = "durable", desc = "Is the queue durable?")
+ boolean durable) throws Exception;
+
+ @Operation(desc = "Destroy a queue", impact = ACTION)
+ void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy")
+ String name) throws Exception;
+
+ void enableMessageCounters() throws Exception;
+
+ void disableMessageCounters() throws Exception;
+
+ void resetAllMessageCounters() throws Exception;
+
+ void resetAllMessageCounterHistories() throws Exception;
+
+ @Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
+ public String[] listPreparedTransactions() throws Exception;
+
+ @Operation(desc = "Commit a prepared transaction")
+ boolean commitPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64")
+ String transactionAsBase64) throws Exception;
+
+ @Operation(desc = "Rollback a prepared transaction")
+ boolean rollbackPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64")
+ String transactionAsBase64) throws Exception;
+
+ @Operation(desc = "List the client addresses", impact = INFO)
+ String[] listRemoteAddresses() throws Exception;
+
+ @Operation(desc = "List the client addresses which match the given IP Address", impact = INFO)
+ String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress")
+ String ipAddress) throws Exception;
+
+ @Operation(desc = "Closes all the connections for the given IP Address", impact = INFO)
+ boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress")
+ String ipAddress) throws Exception;
+
+ @Operation(desc = "List all the connection IDs", impact = INFO)
+ String[] listConnectionIDs() throws Exception;
+
+ @Operation(desc = "List the sessions for the given connectionID", impact = INFO)
+ String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID")
+ String connectionID) throws Exception;
+
+ void sendQueueInfoToQueue(String queueName, String address) throws Exception;
+
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,201 +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.core.management;
-
-import org.jboss.messaging.core.config.Configuration;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-import static javax.management.MBeanOperationInfo.INFO;
-
-/**
- * This interface describes the core management interface exposed by the server
- */
-public interface MessagingServerControlMBean
-{
- // Attributes ----------------------------------------------------
-
- public String getBackupConnectorName();
-
- String getVersion();
-
- int getConnectionCount();
-
- boolean isStarted();
-
- String[] getInterceptorClassNames();
-
- boolean isClustered();
-
- int getScheduledThreadPoolMaxSize();
-
- int getThreadPoolMaxSize();
-
- long getSecurityInvalidationInterval();
-
- boolean isSecurityEnabled();
-
- String getBindingsDirectory();
-
- String getJournalDirectory();
-
- String getJournalType();
-
- boolean isJournalSyncTransactional();
-
- boolean isJournalSyncNonTransactional();
-
- int getJournalFileSize();
-
- int getJournalMinFiles();
-
- int getJournalMaxAIO();
-
- boolean isCreateBindingsDir();
-
- boolean isCreateJournalDir();
-
- Configuration getConfiguration();
-
- boolean isMessageCounterEnabled();
-
- int getMessageCounterMaxDayCount();
-
- void setMessageCounterMaxDayCount(int count) throws Exception;
-
- long getMessageCounterSamplePeriod();
-
- void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
-
- public boolean isBackup();
-
- int getAIOBufferSize();
-
- int getAIOBufferTimeout();
-
- public long getPagingMaxGlobalSizeBytes();
-
- public String getPagingDirectory();
-
- boolean isPersistDeliveryCountBeforeDelivery();
-
- long getQueueActivationTimeout();
-
- long getConnectionTTLOverride();
-
- String getManagementAddress();
-
- String getManagementNotificationAddress();
-
- long getManagementRequestTimeout();
-
- int getIDCacheSize();
-
- boolean isPersistIDCache();
-
- int getGlobalPageSize();
-
- String getLargeMessagesDirectory();
-
- boolean isWildcardRoutingEnabled();
-
- long getTransactionTimeout();
-
- long getTransactionTimeoutScanPeriod();
-
- long getMessageExpiryScanPeriod();
-
- long getMessageExpiryThreadPriority();
-
- Object[] getConnectors() throws Exception;
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "Create a queue with the specified address", impact = ACTION)
- void createQueue(@Parameter(name = "address", desc = "Address of the queue")
- String address, @Parameter(name = "name", desc = "Name of the queue")
- String name) throws Exception;
-
- @Operation(desc = "Create a queue", impact = ACTION)
- void createQueue(@Parameter(name = "address", desc = "Address of the queue")
- String address, @Parameter(name = "name", desc = "Name of the queue")
- String name, @Parameter(name = "filter", desc = "Filter of the queue")
- String filter, @Parameter(name = "durable", desc = "Is the queue durable?")
- boolean durable) throws Exception;
-
- @Operation(desc = "Deploy a queue", impact = ACTION)
- void deployQueue(@Parameter(name = "address", desc = "Address of the queue")
- String address, @Parameter(name = "name", desc = "Name of the queue")
- String name, String filterString) throws Exception;
-
- @Operation(desc = "Deploy a queue", impact = ACTION)
- void deployQueue(@Parameter(name = "address", desc = "Address of the queue")
- String address, @Parameter(name = "name", desc = "Name of the queue")
- String name, @Parameter(name = "filter", desc = "Filter of the queue")
- String filter, @Parameter(name = "durable", desc = "Is the queue durable?")
- boolean durable) throws Exception;
-
- @Operation(desc = "Destroy a queue", impact = ACTION)
- void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy")
- String name) throws Exception;
-
- void enableMessageCounters() throws Exception;
-
- void disableMessageCounters() throws Exception;
-
- void resetAllMessageCounters() throws Exception;
-
- void resetAllMessageCounterHistories() throws Exception;
-
- @Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
- public String[] listPreparedTransactions() throws Exception;
-
- @Operation(desc = "Commit a prepared transaction")
- boolean commitPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64")
- String transactionAsBase64) throws Exception;
-
- @Operation(desc = "Rollback a prepared transaction")
- boolean rollbackPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64")
- String transactionAsBase64) throws Exception;
-
- @Operation(desc = "List the client addresses", impact = INFO)
- String[] listRemoteAddresses() throws Exception;
-
- @Operation(desc = "List the client addresses which match the given IP Address", impact = INFO)
- String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress")
- String ipAddress) throws Exception;
-
- @Operation(desc = "Closes all the connections for the given IP Address", impact = INFO)
- boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress")
- String ipAddress) throws Exception;
-
- @Operation(desc = "List all the connection IDs", impact = INFO)
- String[] listConnectionIDs() throws Exception;
-
- @Operation(desc = "List the sessions for the given connectionID", impact = INFO)
- String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID")
- String connectionID) throws Exception;
-
- void sendQueueInfoToQueue(String queueName, String address) throws Exception;
-
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/QueueControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/QueueControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/QueueControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,146 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+import static javax.management.MBeanOperationInfo.INFO;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface QueueControl
+{
+ // Attributes ----------------------------------------------------
+
+ String getName();
+
+ String getAddress();
+
+ long getPersistenceID();
+
+ boolean isTemporary();
+
+ boolean isDurable();
+
+ String getFilter();
+
+ int getMessageCount();
+
+ long getScheduledCount();
+
+ int getConsumerCount();
+
+ int getDeliveringCount();
+
+ int getMessagesAdded();
+
+ String getExpiryAddress();
+
+ void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue")
+ String expiryAddres) throws Exception;
+
+ String getDeadLetterAddress();
+
+ void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue")
+ String deadLetterAddress) throws Exception;
+
+ boolean isBackup();
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "List the messages scheduled for delivery", impact = INFO)
+ Map<String, Object>[] listScheduledMessages() throws Exception;
+
+ @Operation(desc = "List all the messages in the queue", impact = INFO)
+ Map<String, Object>[] listAllMessages() throws Exception;
+
+ @Operation(desc = "List all the messages in the queue matching the given filter", impact = INFO)
+ Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = INFO)
+ int countMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Remove all the messages from the queue", impact = ACTION)
+ int removeAllMessages() throws Exception;
+
+ @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
+ boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID")
+ long messageID) throws Exception;
+
+ @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = ACTION)
+ int removeMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of expired messages)", impact = ACTION)
+ int expireMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
+ boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID")
+ long messageID) throws Exception;
+
+ @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = ACTION)
+ boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID")
+ long messageID, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to")
+ String otherQueueName) throws Exception;
+
+ @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = ACTION)
+ int moveMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
+ String otherQueueName) throws Exception;
+
+ @Operation(desc = "Move all the messages to another queue (and returns the number of moved messages)", impact = ACTION)
+ int moveAllMessages(@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
+ String otherQueueName) throws Exception;
+
+ @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = ACTION)
+ boolean sendMessageToDeadLetterAddress(@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;
+
+ String listMessageCounter() throws Exception;
+
+ void resetMessageCounter() throws Exception;
+
+ String listMessageCounterAsHTML() throws Exception;
+
+ String listMessageCounterHistory() throws Exception;
+
+ String listMessageCounterHistoryAsHTML() throws Exception;
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/QueueControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,146 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-import static javax.management.MBeanOperationInfo.INFO;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface QueueControlMBean
-{
- // Attributes ----------------------------------------------------
-
- String getName();
-
- String getAddress();
-
- long getPersistenceID();
-
- boolean isTemporary();
-
- boolean isDurable();
-
- String getFilter();
-
- int getMessageCount();
-
- long getScheduledCount();
-
- int getConsumerCount();
-
- int getDeliveringCount();
-
- int getMessagesAdded();
-
- String getExpiryAddress();
-
- void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue")
- String expiryAddres) throws Exception;
-
- String getDeadLetterAddress();
-
- void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue")
- String deadLetterAddress) throws Exception;
-
- boolean isBackup();
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "List the messages scheduled for delivery", impact = INFO)
- Map<String, Object>[] listScheduledMessages() throws Exception;
-
- @Operation(desc = "List all the messages in the queue", impact = INFO)
- Map<String, Object>[] listAllMessages() throws Exception;
-
- @Operation(desc = "List all the messages in the queue matching the given filter", impact = INFO)
- Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = INFO)
- int countMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Remove all the messages from the queue", impact = ACTION)
- int removeAllMessages() throws Exception;
-
- @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
- boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID")
- long messageID) throws Exception;
-
- @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = ACTION)
- int removeMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of expired messages)", impact = ACTION)
- int expireMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
- boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID")
- long messageID) throws Exception;
-
- @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = ACTION)
- boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID")
- long messageID, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to")
- String otherQueueName) throws Exception;
-
- @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = ACTION)
- int moveMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
- String otherQueueName) throws Exception;
-
- @Operation(desc = "Move all the messages to another queue (and returns the number of moved messages)", impact = ACTION)
- int moveAllMessages(@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
- String otherQueueName) throws Exception;
-
- @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = ACTION)
- boolean sendMessageToDeadLetterAddress(@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;
-
- String listMessageCounter() throws Exception;
-
- void resetMessageCounter() throws Exception;
-
- String listMessageCounterAsHTML() throws Exception;
-
- String listMessageCounterHistory() throws Exception;
-
- String listMessageCounterHistoryAsHTML() throws Exception;
-
-}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,111 +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.core.management.impl;
-
-import java.util.Map;
-
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.AcceptorControlMBean;
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-
-/**
- * A AcceptorControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * Created 11 dec. 2008 17:09:04
- */
-public class AcceptorControl implements AcceptorControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final Acceptor acceptor;
-
- private final TransportConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public AcceptorControl(final Acceptor acceptor, final TransportConfiguration configuration)
- {
- this.acceptor = acceptor;
- this.configuration = configuration;
- }
-
- // AcceptorControlMBean implementation ---------------------------
-
- public String getFactoryClassName()
- {
- return configuration.getFactoryClassName();
- }
-
- public String getName()
- {
- return configuration.getName();
- }
-
- public Map<String, Object> getParameters()
- {
- return configuration.getParams();
- }
-
- public boolean isStarted()
- {
- return acceptor.isStarted();
- }
-
- public void start() throws Exception
- {
- acceptor.start();
- }
-
- public void pause()
- {
- acceptor.pause();
- }
-
- public void resume()
- {
- acceptor.resume();
- }
-
- public void stop() throws Exception
- {
- acceptor.stop();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/AcceptorControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,111 @@
+/*
+ * 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.core.management.impl;
+
+import java.util.Map;
+
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.management.AcceptorControl;
+import org.jboss.messaging.core.remoting.spi.Acceptor;
+
+/**
+ * A AcceptorControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * Created 11 dec. 2008 17:09:04
+ */
+public class AcceptorControlImpl implements AcceptorControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final Acceptor acceptor;
+
+ private final TransportConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public AcceptorControlImpl(final Acceptor acceptor, final TransportConfiguration configuration)
+ {
+ this.acceptor = acceptor;
+ this.configuration = configuration;
+ }
+
+ // AcceptorControlMBean implementation ---------------------------
+
+ public String getFactoryClassName()
+ {
+ return configuration.getFactoryClassName();
+ }
+
+ public String getName()
+ {
+ return configuration.getName();
+ }
+
+ public Map<String, Object> getParameters()
+ {
+ return configuration.getParams();
+ }
+
+ public boolean isStarted()
+ {
+ return acceptor.isStarted();
+ }
+
+ public void start() throws Exception
+ {
+ acceptor.start();
+ }
+
+ public void pause()
+ {
+ acceptor.pause();
+ }
+
+ public void resume()
+ {
+ acceptor.resume();
+ }
+
+ public void stop() throws Exception
+ {
+ acceptor.stop();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/AddressControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/AddressControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/AddressControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,176 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management.impl;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.AddressControlMBean;
-import org.jboss.messaging.core.postoffice.Binding;
-import org.jboss.messaging.core.postoffice.Bindings;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.security.CheckType;
-import org.jboss.messaging.core.security.Role;
-import org.jboss.messaging.core.settings.HierarchicalRepository;
-import org.jboss.messaging.utils.SimpleString;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class AddressControl implements AddressControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(AddressControl.class);
-
- // Attributes ----------------------------------------------------
-
- private final SimpleString address;
-
- private final PostOffice postOffice;
-
- private final HierarchicalRepository<Set<Role>> securityRepository;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public AddressControl(final SimpleString address,
- final PostOffice postOffice,
- final HierarchicalRepository<Set<Role>> securityRepository)
- {
- this.address = address;
- this.postOffice = postOffice;
- this.securityRepository = securityRepository;
- }
-
- // Public --------------------------------------------------------
-
- // AddressControlMBean implementation ----------------------------
-
- public String getAddress()
- {
- return address.toString();
- }
-
- public String[] getQueueNames() throws Exception
- {
- try
- {
- Bindings bindings = postOffice.getBindingsForAddress(address);
- String[] queueNames = new String[bindings.getBindings().size()];
- int i = 0;
- for (Binding binding : bindings.getBindings())
- {
- queueNames[i++] = binding.getUniqueName().toString();
- }
- return queueNames;
- }
- catch (Throwable t)
- {
- throw new IllegalStateException(t.getMessage());
- }
- }
-
- public Object[] getRoles() throws Exception
- {
- Set<Role> roles = securityRepository.getMatch(address.toString());
-
- Object[] objRoles = new Object[roles.size()];
-
- int i = 0;
- for (Role role : roles)
- {
- objRoles[i++] = new Object[] { role.getName(),
- CheckType.SEND.hasRole(role),
- CheckType.CONSUME.hasRole(role),
- CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
- CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
- CheckType.MANAGE.hasRole(role) };
- }
- return objRoles;
- }
-
- public synchronized void addRole(final String name,
- final boolean send,
- final boolean consume,
- final boolean createDurableQueue,
- final boolean deleteDurableQueue,
- final boolean createNonDurableQueue,
- final boolean deleteNonDurableQueue,
- final boolean manage) throws Exception
- {
- Set<Role> roles = securityRepository.getMatch(address.toString());
- Role newRole = new Role(name,
- send,
- consume,
- createDurableQueue,
- deleteDurableQueue,
- createNonDurableQueue,
- deleteNonDurableQueue,
- manage);
- boolean added = roles.add(newRole);
- if (!added)
- {
- throw new IllegalArgumentException("Role " + name + " already exists");
- }
- securityRepository.addMatch(address.toString(), roles);
- }
-
- public synchronized void removeRole(final String role) throws Exception
- {
- Set<Role> roles = securityRepository.getMatch(address.toString());
- Iterator<Role> it = roles.iterator();
- boolean removed = false;
- while (it.hasNext())
- {
- Role r = it.next();
- if (r.getName().equals(role))
- {
- it.remove();
- removed = true;
- break;
- }
- }
- if (!removed)
- {
- throw new IllegalArgumentException("Role " + role + " does not exist");
- }
- securityRepository.addMatch(address.toString(), roles);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/AddressControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/AddressControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/AddressControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/AddressControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,176 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management.impl;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.management.AddressControl;
+import org.jboss.messaging.core.postoffice.Binding;
+import org.jboss.messaging.core.postoffice.Bindings;
+import org.jboss.messaging.core.postoffice.PostOffice;
+import org.jboss.messaging.core.security.CheckType;
+import org.jboss.messaging.core.security.Role;
+import org.jboss.messaging.core.settings.HierarchicalRepository;
+import org.jboss.messaging.utils.SimpleString;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class AddressControlImpl implements AddressControl
+{
+
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(AddressControlImpl.class);
+
+ // Attributes ----------------------------------------------------
+
+ private final SimpleString address;
+
+ private final PostOffice postOffice;
+
+ private final HierarchicalRepository<Set<Role>> securityRepository;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public AddressControlImpl(final SimpleString address,
+ final PostOffice postOffice,
+ final HierarchicalRepository<Set<Role>> securityRepository)
+ {
+ this.address = address;
+ this.postOffice = postOffice;
+ this.securityRepository = securityRepository;
+ }
+
+ // Public --------------------------------------------------------
+
+ // AddressControlMBean implementation ----------------------------
+
+ public String getAddress()
+ {
+ return address.toString();
+ }
+
+ public String[] getQueueNames() throws Exception
+ {
+ try
+ {
+ Bindings bindings = postOffice.getBindingsForAddress(address);
+ String[] queueNames = new String[bindings.getBindings().size()];
+ int i = 0;
+ for (Binding binding : bindings.getBindings())
+ {
+ queueNames[i++] = binding.getUniqueName().toString();
+ }
+ return queueNames;
+ }
+ catch (Throwable t)
+ {
+ throw new IllegalStateException(t.getMessage());
+ }
+ }
+
+ public Object[] getRoles() throws Exception
+ {
+ Set<Role> roles = securityRepository.getMatch(address.toString());
+
+ Object[] objRoles = new Object[roles.size()];
+
+ int i = 0;
+ for (Role role : roles)
+ {
+ objRoles[i++] = new Object[] { role.getName(),
+ CheckType.SEND.hasRole(role),
+ CheckType.CONSUME.hasRole(role),
+ CheckType.CREATE_DURABLE_QUEUE.hasRole(role),
+ CheckType.DELETE_DURABLE_QUEUE.hasRole(role),
+ CheckType.CREATE_NON_DURABLE_QUEUE.hasRole(role),
+ CheckType.DELETE_NON_DURABLE_QUEUE.hasRole(role),
+ CheckType.MANAGE.hasRole(role) };
+ }
+ return objRoles;
+ }
+
+ public synchronized void addRole(final String name,
+ final boolean send,
+ final boolean consume,
+ final boolean createDurableQueue,
+ final boolean deleteDurableQueue,
+ final boolean createNonDurableQueue,
+ final boolean deleteNonDurableQueue,
+ final boolean manage) throws Exception
+ {
+ Set<Role> roles = securityRepository.getMatch(address.toString());
+ Role newRole = new Role(name,
+ send,
+ consume,
+ createDurableQueue,
+ deleteDurableQueue,
+ createNonDurableQueue,
+ deleteNonDurableQueue,
+ manage);
+ boolean added = roles.add(newRole);
+ if (!added)
+ {
+ throw new IllegalArgumentException("Role " + name + " already exists");
+ }
+ securityRepository.addMatch(address.toString(), roles);
+ }
+
+ public synchronized void removeRole(final String role) throws Exception
+ {
+ Set<Role> roles = securityRepository.getMatch(address.toString());
+ Iterator<Role> it = roles.iterator();
+ boolean removed = false;
+ while (it.hasNext())
+ {
+ Role r = it.next();
+ if (r.getName().equals(role))
+ {
+ it.remove();
+ removed = true;
+ break;
+ }
+ }
+ if (!removed)
+ {
+ throw new IllegalArgumentException("Role " + role + " does not exist");
+ }
+ securityRepository.addMatch(address.toString(), roles);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,149 +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.core.management.impl;
-
-import org.jboss.messaging.core.config.cluster.BridgeConfiguration;
-import org.jboss.messaging.core.management.BridgeControlMBean;
-import org.jboss.messaging.core.server.cluster.Bridge;
-
-/**
- * A BridgeControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * Created 11 dec. 2008 17:09:04
- */
-public class BridgeControl implements BridgeControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final Bridge bridge;
-
- private final BridgeConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public BridgeControl(final Bridge messageFlow, final BridgeConfiguration configuration)
- {
- this.bridge = messageFlow;
- this.configuration = configuration;
- }
-
- // BridgeControlMBean implementation ---------------------------
-
- public String[] getConnectorPair() throws Exception
- {
- String[] pair = new String[2];
-
- pair[0] = configuration.getConnectorPair().a;
- pair[1] = configuration.getConnectorPair().b != null ? configuration.getConnectorPair().b : null;
-
- return pair;
- }
-
- public String getForwardingAddress()
- {
- return configuration.getForwardingAddress();
- }
-
- public String getQueueName()
- {
- return configuration.getQueueName();
- }
-
- public String getDiscoveryGroupName()
- {
- return configuration.getDiscoveryGroupName();
- }
-
- public String getFilterString()
- {
- return configuration.getFilterString();
- }
-
- public int getReconnectAttempts()
- {
- return configuration.getReconnectAttempts();
- }
-
- public boolean isFailoverOnServerShutdown()
- {
- return configuration.isFailoverOnServerShutdown();
- }
-
- public String getName()
- {
- return configuration.getName();
- }
-
- public long getRetryInterval()
- {
- return configuration.getRetryInterval();
- }
-
- public double getRetryIntervalMultiplier()
- {
- return configuration.getRetryIntervalMultiplier();
- }
-
- public String getTransformerClassName()
- {
- return configuration.getTransformerClassName();
- }
-
- public boolean isStarted()
- {
- return bridge.isStarted();
- }
-
- public boolean isUseDuplicateDetection()
- {
- return configuration.isUseDuplicateDetection();
- }
-
- public void start() throws Exception
- {
- bridge.start();
- }
-
- public void stop() throws Exception
- {
- bridge.stop();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/BridgeControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,149 @@
+/*
+ * 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.core.management.impl;
+
+import org.jboss.messaging.core.config.cluster.BridgeConfiguration;
+import org.jboss.messaging.core.management.BridgeControl;
+import org.jboss.messaging.core.server.cluster.Bridge;
+
+/**
+ * A BridgeControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * Created 11 dec. 2008 17:09:04
+ */
+public class BridgeControlImpl implements BridgeControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final Bridge bridge;
+
+ private final BridgeConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public BridgeControlImpl(final Bridge bridge, final BridgeConfiguration configuration)
+ {
+ this.bridge = bridge;
+ this.configuration = configuration;
+ }
+
+ // BridgeControlMBean implementation ---------------------------
+
+ public String[] getConnectorPair() throws Exception
+ {
+ String[] pair = new String[2];
+
+ pair[0] = configuration.getConnectorPair().a;
+ pair[1] = configuration.getConnectorPair().b != null ? configuration.getConnectorPair().b : null;
+
+ return pair;
+ }
+
+ public String getForwardingAddress()
+ {
+ return configuration.getForwardingAddress();
+ }
+
+ public String getQueueName()
+ {
+ return configuration.getQueueName();
+ }
+
+ public String getDiscoveryGroupName()
+ {
+ return configuration.getDiscoveryGroupName();
+ }
+
+ public String getFilterString()
+ {
+ return configuration.getFilterString();
+ }
+
+ public int getReconnectAttempts()
+ {
+ return configuration.getReconnectAttempts();
+ }
+
+ public boolean isFailoverOnServerShutdown()
+ {
+ return configuration.isFailoverOnServerShutdown();
+ }
+
+ public String getName()
+ {
+ return configuration.getName();
+ }
+
+ public long getRetryInterval()
+ {
+ return configuration.getRetryInterval();
+ }
+
+ public double getRetryIntervalMultiplier()
+ {
+ return configuration.getRetryIntervalMultiplier();
+ }
+
+ public String getTransformerClassName()
+ {
+ return configuration.getTransformerClassName();
+ }
+
+ public boolean isStarted()
+ {
+ return bridge.isStarted();
+ }
+
+ public boolean isUseDuplicateDetection()
+ {
+ return configuration.isUseDuplicateDetection();
+ }
+
+ public void start() throws Exception
+ {
+ bridge.start();
+ }
+
+ public void stop() throws Exception
+ {
+ bridge.stop();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,130 +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.core.management.impl;
-
-import org.jboss.messaging.core.config.cluster.BroadcastGroupConfiguration;
-import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
-import org.jboss.messaging.core.server.cluster.BroadcastGroup;
-import org.jboss.messaging.utils.Pair;
-
-/**
- * A BroadcastGroupControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * Created 11 dec. 2008 17:09:04
- */
-public class BroadcastGroupControl implements BroadcastGroupControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final BroadcastGroup broadcastGroup;
-
- private final BroadcastGroupConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public BroadcastGroupControl(final BroadcastGroup acceptor, final BroadcastGroupConfiguration configuration)
- {
- this.broadcastGroup = acceptor;
- this.configuration = configuration;
- }
-
- // BroadcastGroupControlMBean implementation ---------------------
-
- public String getName()
- {
- return configuration.getName();
- }
-
- public long getBroadcastPeriod()
- {
- return configuration.getBroadcastPeriod();
- }
-
- public Object[] getConnectorPairs()
- {
- Object[] ret = new Object[configuration.getConnectorInfos().size()];
-
- int i = 0;
- for (Pair<String, String> pair: configuration.getConnectorInfos())
- {
- String[] opair = new String[2];
-
- opair[0] = pair.a;
- opair[1] = pair.b != null ? pair.b : null;
-
- ret[i++] = opair;
- }
-
- return ret;
- }
-
- public String getGroupAddress()
- {
- return configuration.getGroupAddress();
- }
-
- public int getGroupPort()
- {
- return configuration.getGroupPort();
- }
-
- public int getLocalBindPort()
- {
- return configuration.getLocalBindPort();
- }
-
- // MessagingComponentControlMBean implementation -----------------
-
- public boolean isStarted()
- {
- return broadcastGroup.isStarted();
- }
-
- public void start() throws Exception
- {
- broadcastGroup.start();
- }
-
- public void stop() throws Exception
- {
- broadcastGroup.stop();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/BroadcastGroupControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,130 @@
+/*
+ * 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.core.management.impl;
+
+import org.jboss.messaging.core.config.cluster.BroadcastGroupConfiguration;
+import org.jboss.messaging.core.management.BroadcastGroupControl;
+import org.jboss.messaging.core.server.cluster.BroadcastGroup;
+import org.jboss.messaging.utils.Pair;
+
+/**
+ * A BroadcastGroupControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * Created 11 dec. 2008 17:09:04
+ */
+public class BroadcastGroupControlImpl implements BroadcastGroupControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final BroadcastGroup broadcastGroup;
+
+ private final BroadcastGroupConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public BroadcastGroupControlImpl(final BroadcastGroup broadcastGroup, final BroadcastGroupConfiguration configuration)
+ {
+ this.broadcastGroup = broadcastGroup;
+ this.configuration = configuration;
+ }
+
+ // BroadcastGroupControlMBean implementation ---------------------
+
+ public String getName()
+ {
+ return configuration.getName();
+ }
+
+ public long getBroadcastPeriod()
+ {
+ return configuration.getBroadcastPeriod();
+ }
+
+ public Object[] getConnectorPairs()
+ {
+ Object[] ret = new Object[configuration.getConnectorInfos().size()];
+
+ int i = 0;
+ for (Pair<String, String> pair: configuration.getConnectorInfos())
+ {
+ String[] opair = new String[2];
+
+ opair[0] = pair.a;
+ opair[1] = pair.b != null ? pair.b : null;
+
+ ret[i++] = opair;
+ }
+
+ return ret;
+ }
+
+ public String getGroupAddress()
+ {
+ return configuration.getGroupAddress();
+ }
+
+ public int getGroupPort()
+ {
+ return configuration.getGroupPort();
+ }
+
+ public int getLocalBindPort()
+ {
+ return configuration.getLocalBindPort();
+ }
+
+ // MessagingComponentControlMBean implementation -----------------
+
+ public boolean isStarted()
+ {
+ return broadcastGroup.isStarted();
+ }
+
+ public void start() throws Exception
+ {
+ broadcastGroup.start();
+ }
+
+ public void stop() throws Exception
+ {
+ broadcastGroup.stop();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,137 +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.core.management.impl;
-
-import org.jboss.messaging.core.config.cluster.ClusterConnectionConfiguration;
-import org.jboss.messaging.core.management.ClusterConnectionControlMBean;
-import org.jboss.messaging.core.server.cluster.ClusterConnection;
-import org.jboss.messaging.utils.Pair;
-
-/**
- * A ClusterConnectionControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- */
-public class ClusterConnectionControl implements ClusterConnectionControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final ClusterConnection clusterConnection;
-
- private final ClusterConnectionConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ClusterConnectionControl(final ClusterConnection clusterConnection,
- ClusterConnectionConfiguration configuration)
- {
- this.clusterConnection = clusterConnection;
- this.configuration = configuration;
- }
-
- // ClusterConnectionControlMBean implementation ---------------------------
-
- public String getAddress()
- {
- return configuration.getAddress();
- }
-
- public String getDiscoveryGroupName()
- {
- return configuration.getDiscoveryGroupName();
- }
-
- public int getMaxHops()
- {
- return configuration.getMaxHops();
- }
-
- public String getName()
- {
- return configuration.getName();
- }
-
- public long getRetryInterval()
- {
- return configuration.getRetryInterval();
- }
-
- public Object[] getStaticConnectorNamePairs()
- {
- Object[] ret = new Object[configuration.getStaticConnectorNamePairs().size()];
-
- int i = 0;
- for (Pair<String, String> pair: configuration.getStaticConnectorNamePairs())
- {
- String[] opair = new String[2];
-
- opair[0] = pair.a;
- opair[1] = pair.b != null ? pair.b : null;
-
- ret[i++] = opair;
- }
-
- return ret;
- }
-
- public boolean isDuplicateDetection()
- {
- return configuration.isDuplicateDetection();
- }
-
- public boolean isForwardWhenNoConsumers()
- {
- return configuration.isForwardWhenNoConsumers();
- }
-
- public boolean isStarted()
- {
- return clusterConnection.isStarted();
- }
-
- public void start() throws Exception
- {
- clusterConnection.start();
- }
-
- public void stop() throws Exception
- {
- clusterConnection.stop();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/ClusterConnectionControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,137 @@
+/*
+ * 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.core.management.impl;
+
+import org.jboss.messaging.core.config.cluster.ClusterConnectionConfiguration;
+import org.jboss.messaging.core.management.ClusterConnectionControl;
+import org.jboss.messaging.core.server.cluster.ClusterConnection;
+import org.jboss.messaging.utils.Pair;
+
+/**
+ * A ClusterConnectionControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ */
+public class ClusterConnectionControlImpl implements ClusterConnectionControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final ClusterConnection clusterConnection;
+
+ private final ClusterConnectionConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ClusterConnectionControlImpl(final ClusterConnection clusterConnection,
+ ClusterConnectionConfiguration configuration)
+ {
+ this.clusterConnection = clusterConnection;
+ this.configuration = configuration;
+ }
+
+ // ClusterConnectionControlMBean implementation ---------------------------
+
+ public String getAddress()
+ {
+ return configuration.getAddress();
+ }
+
+ public String getDiscoveryGroupName()
+ {
+ return configuration.getDiscoveryGroupName();
+ }
+
+ public int getMaxHops()
+ {
+ return configuration.getMaxHops();
+ }
+
+ public String getName()
+ {
+ return configuration.getName();
+ }
+
+ public long getRetryInterval()
+ {
+ return configuration.getRetryInterval();
+ }
+
+ public Object[] getStaticConnectorNamePairs()
+ {
+ Object[] ret = new Object[configuration.getStaticConnectorNamePairs().size()];
+
+ int i = 0;
+ for (Pair<String, String> pair: configuration.getStaticConnectorNamePairs())
+ {
+ String[] opair = new String[2];
+
+ opair[0] = pair.a;
+ opair[1] = pair.b != null ? pair.b : null;
+
+ ret[i++] = opair;
+ }
+
+ return ret;
+ }
+
+ public boolean isDuplicateDetection()
+ {
+ return configuration.isDuplicateDetection();
+ }
+
+ public boolean isForwardWhenNoConsumers()
+ {
+ return configuration.isForwardWhenNoConsumers();
+ }
+
+ public boolean isStarted()
+ {
+ return clusterConnection.isStarted();
+ }
+
+ public void start() throws Exception
+ {
+ clusterConnection.start();
+ }
+
+ public void stop() throws Exception
+ {
+ clusterConnection.stop();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,104 +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.core.management.impl;
-
-import org.jboss.messaging.core.cluster.DiscoveryGroup;
-import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
-import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
-
-/**
- * A AcceptorControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * Created 11 dec. 2008 17:09:04
- */
-public class DiscoveryGroupControl implements DiscoveryGroupControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final DiscoveryGroup discoveryGroup;
-
- private final DiscoveryGroupConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public DiscoveryGroupControl(final DiscoveryGroup acceptor, final DiscoveryGroupConfiguration configuration)
- {
- this.discoveryGroup = acceptor;
- this.configuration = configuration;
- }
-
- // DiscoveryGroupControlMBean implementation ---------------------------
-
- public String getName()
- {
- return configuration.getName();
- }
-
- public String getGroupAddress()
- {
- return configuration.getGroupAddress();
- }
-
- public int getGroupPort()
- {
- return configuration.getGroupPort();
- }
-
- public long getRefreshTimeout()
- {
- return configuration.getRefreshTimeout();
- }
-
- public boolean isStarted()
- {
- return discoveryGroup.isStarted();
- }
-
- public void start() throws Exception
- {
- discoveryGroup.start();
- }
-
- public void stop() throws Exception
- {
- discoveryGroup.stop();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/DiscoveryGroupControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,104 @@
+/*
+ * 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.core.management.impl;
+
+import org.jboss.messaging.core.cluster.DiscoveryGroup;
+import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
+import org.jboss.messaging.core.management.DiscoveryGroupControl;
+
+/**
+ * A AcceptorControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * Created 11 dec. 2008 17:09:04
+ */
+public class DiscoveryGroupControlImpl implements DiscoveryGroupControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final DiscoveryGroup discoveryGroup;
+
+ private final DiscoveryGroupConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public DiscoveryGroupControlImpl(final DiscoveryGroup acceptor, final DiscoveryGroupConfiguration configuration)
+ {
+ this.discoveryGroup = acceptor;
+ this.configuration = configuration;
+ }
+
+ // DiscoveryGroupControlMBean implementation ---------------------------
+
+ public String getName()
+ {
+ return configuration.getName();
+ }
+
+ public String getGroupAddress()
+ {
+ return configuration.getGroupAddress();
+ }
+
+ public int getGroupPort()
+ {
+ return configuration.getGroupPort();
+ }
+
+ public long getRefreshTimeout()
+ {
+ return configuration.getRefreshTimeout();
+ }
+
+ public boolean isStarted()
+ {
+ return discoveryGroup.isStarted();
+ }
+
+ public void start() throws Exception
+ {
+ discoveryGroup.start();
+ }
+
+ public void stop() throws Exception
+ {
+ discoveryGroup.stop();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/DivertControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/DivertControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/DivertControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,104 +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.core.management.impl;
-
-import org.jboss.messaging.core.config.cluster.DivertConfiguration;
-import org.jboss.messaging.core.management.DivertControlMBean;
-import org.jboss.messaging.core.server.Divert;
-
-/**
- * A DivertControl
- *
- * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * Created 11 dec. 2008 17:09:04
- */
-public class DivertControl implements DivertControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final Divert divert;
-
- private final DivertConfiguration configuration;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // DivertControlMBean implementation ---------------------------
-
- public DivertControl(final Divert divert, final DivertConfiguration configuration)
- {
- this.divert = divert;
- this.configuration = configuration;
- }
-
- public String getAddress()
- {
- return configuration.getAddress();
- }
-
- public String getFilter()
- {
- return configuration.getFilterString();
- }
-
- public String getForwardingAddress()
- {
- return configuration.getForwardingAddress();
- }
-
- public String getRoutingName()
- {
- return divert.getRoutingName().toString();
- }
-
- public String getTransformerClassName()
- {
- return configuration.getTransformerClassName();
- }
-
- public String getUniqueName()
- {
- return divert.getUniqueName().toString();
- }
-
- public boolean isExclusive()
- {
- return divert.isExclusive();
- }
-
- // Public --------------------------------------------------------
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/DivertControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/DivertControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/DivertControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/DivertControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,104 @@
+/*
+ * 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.core.management.impl;
+
+import org.jboss.messaging.core.config.cluster.DivertConfiguration;
+import org.jboss.messaging.core.management.DivertControl;
+import org.jboss.messaging.core.server.Divert;
+
+/**
+ * A DivertControl
+ *
+ * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * Created 11 dec. 2008 17:09:04
+ */
+public class DivertControlImpl implements DivertControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final Divert divert;
+
+ private final DivertConfiguration configuration;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ // DivertControlMBean implementation ---------------------------
+
+ public DivertControlImpl(final Divert divert, final DivertConfiguration configuration)
+ {
+ this.divert = divert;
+ this.configuration = configuration;
+ }
+
+ public String getAddress()
+ {
+ return configuration.getAddress();
+ }
+
+ public String getFilter()
+ {
+ return configuration.getFilterString();
+ }
+
+ public String getForwardingAddress()
+ {
+ return configuration.getForwardingAddress();
+ }
+
+ public String getRoutingName()
+ {
+ return divert.getRoutingName().toString();
+ }
+
+ public String getTransformerClassName()
+ {
+ return configuration.getTransformerClassName();
+ }
+
+ public String getUniqueName()
+ {
+ return divert.getUniqueName().toString();
+ }
+
+ public boolean isExclusive()
+ {
+ return divert.isExclusive();
+ }
+
+ // Public --------------------------------------------------------
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+
+}
Modified: trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/ManagementServiceImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -48,12 +48,12 @@
import org.jboss.messaging.core.config.cluster.DivertConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.AcceptorControlMBean;
-import org.jboss.messaging.core.management.BridgeControlMBean;
-import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
-import org.jboss.messaging.core.management.ClusterConnectionControlMBean;
-import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
-import org.jboss.messaging.core.management.DivertControlMBean;
+import org.jboss.messaging.core.management.AcceptorControl;
+import org.jboss.messaging.core.management.BridgeControl;
+import org.jboss.messaging.core.management.BroadcastGroupControl;
+import org.jboss.messaging.core.management.ClusterConnectionControl;
+import org.jboss.messaging.core.management.DiscoveryGroupControl;
+import org.jboss.messaging.core.management.DivertControl;
import org.jboss.messaging.core.management.ManagementService;
import org.jboss.messaging.core.management.Notification;
import org.jboss.messaging.core.management.NotificationListener;
@@ -118,7 +118,7 @@
private HierarchicalRepository<AddressSettings> addressSettingsRepository;
- private MessagingServerControl messagingServerControl;
+ private MessagingServerControlImpl messagingServerControl;
private final MessageCounterManager messageCounterManager;
@@ -192,7 +192,7 @@
return messageCounterManager;
}
- public MessagingServerControl registerServer(final PostOffice postOffice,
+ public MessagingServerControlImpl registerServer(final PostOffice postOffice,
final StorageManager storageManager,
final Configuration configuration,
final HierarchicalRepository<AddressSettings> addressSettingsRepository,
@@ -216,7 +216,7 @@
messagingServer.getSecurityRepository().addMatch(configuration.getManagementAddress().toString(), roles);
messagingServer.getSecurityRepository().addMatch(configuration.getManagementAddress() + ".*", roles);
- messagingServerControl = new MessagingServerControl(postOffice,
+ messagingServerControl = new MessagingServerControlImpl(postOffice,
configuration,
resourceManager,
remotingService,
@@ -241,7 +241,7 @@
public synchronized void registerAddress(final SimpleString address) throws Exception
{
ObjectName objectName = ObjectNames.getAddressObjectName(address);
- AddressControl addressControl = new AddressControl(address, postOffice, securityRepository);
+ AddressControlImpl addressControl = new AddressControlImpl(address, postOffice, securityRepository);
registerInJMX(objectName, new ReplicationAwareAddressControlWrapper(addressControl, replicationInvoker));
@@ -265,7 +265,7 @@
final SimpleString address,
final StorageManager storageManager) throws Exception
{
- QueueControl queueControl = new QueueControl(queue, address.toString(), postOffice, addressSettingsRepository);
+ QueueControlImpl queueControl = new QueueControlImpl(queue, address.toString(), postOffice, addressSettingsRepository);
MessageCounter counter = new MessageCounter(queue.getName().toString(),
null,
queueControl,
@@ -295,8 +295,8 @@
public synchronized void registerDivert(Divert divert, DivertConfiguration config) throws Exception
{
ObjectName objectName = ObjectNames.getDivertObjectName(divert.getUniqueName());
- DivertControlMBean divertControl = new DivertControl(divert, config);
- registerInJMX(objectName, new StandardMBean(divertControl, DivertControlMBean.class));
+ DivertControl divertControl = new DivertControlImpl(divert, config);
+ registerInJMX(objectName, new StandardMBean(divertControl, DivertControl.class));
registerInRegistry(ResourceNames.CORE_DIVERT + config.getName(), divertControl);
if (log.isDebugEnabled())
@@ -315,8 +315,8 @@
public synchronized void registerAcceptor(final Acceptor acceptor, final TransportConfiguration configuration) throws Exception
{
ObjectName objectName = ObjectNames.getAcceptorObjectName(configuration.getName());
- AcceptorControlMBean control = new AcceptorControl(acceptor, configuration);
- registerInJMX(objectName, new StandardMBean(control, AcceptorControlMBean.class));
+ AcceptorControl control = new AcceptorControlImpl(acceptor, configuration);
+ registerInJMX(objectName, new StandardMBean(control, AcceptorControl.class));
registerInRegistry(ResourceNames.CORE_ACCEPTOR + configuration.getName(), control);
}
@@ -331,8 +331,8 @@
BroadcastGroupConfiguration configuration) throws Exception
{
ObjectName objectName = ObjectNames.getBroadcastGroupObjectName(configuration.getName());
- BroadcastGroupControlMBean control = new BroadcastGroupControl(broadcastGroup, configuration);
- registerInJMX(objectName, new StandardMBean(control, BroadcastGroupControlMBean.class));
+ BroadcastGroupControl control = new BroadcastGroupControlImpl(broadcastGroup, configuration);
+ registerInJMX(objectName, new StandardMBean(control, BroadcastGroupControl.class));
registerInRegistry(ResourceNames.CORE_BROADCAST_GROUP + configuration.getName(), control);
}
@@ -347,8 +347,8 @@
DiscoveryGroupConfiguration configuration) throws Exception
{
ObjectName objectName = ObjectNames.getDiscoveryGroupObjectName(configuration.getName());
- DiscoveryGroupControlMBean control = new DiscoveryGroupControl(discoveryGroup, configuration);
- registerInJMX(objectName, new StandardMBean(control, DiscoveryGroupControlMBean.class));
+ DiscoveryGroupControl control = new DiscoveryGroupControlImpl(discoveryGroup, configuration);
+ registerInJMX(objectName, new StandardMBean(control, DiscoveryGroupControl.class));
registerInRegistry(ResourceNames.CORE_DISCOVERY_GROUP + configuration.getName(), control);
}
@@ -362,8 +362,8 @@
public synchronized void registerBridge(Bridge bridge, BridgeConfiguration configuration) throws Exception
{
ObjectName objectName = ObjectNames.getBridgeObjectName(configuration.getName());
- BridgeControlMBean control = new BridgeControl(bridge, configuration);
- registerInJMX(objectName, new StandardMBean(control, BridgeControlMBean.class));
+ BridgeControl control = new BridgeControlImpl(bridge, configuration);
+ registerInJMX(objectName, new StandardMBean(control, BridgeControl.class));
registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
}
@@ -378,8 +378,8 @@
final ClusterConnectionConfiguration configuration) throws Exception
{
ObjectName objectName = ObjectNames.getClusterConnectionObjectName(configuration.getName());
- ClusterConnectionControlMBean control = new ClusterConnectionControl(cluster, configuration);
- registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControlMBean.class));
+ ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, configuration);
+ registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,635 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management.impl;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Map.Entry;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.transaction.xa.Xid;
-
-import org.jboss.messaging.core.config.Configuration;
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
-import org.jboss.messaging.core.management.NotificationType;
-import org.jboss.messaging.core.messagecounter.MessageCounterManager;
-import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
-import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.remoting.RemotingConnection;
-import org.jboss.messaging.core.remoting.server.RemotingService;
-import org.jboss.messaging.core.server.MessagingServer;
-import org.jboss.messaging.core.server.ServerSession;
-import org.jboss.messaging.core.transaction.ResourceManager;
-import org.jboss.messaging.core.transaction.Transaction;
-import org.jboss.messaging.core.transaction.impl.XidImpl;
-import org.jboss.messaging.utils.SimpleString;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class MessagingServerControl implements MessagingServerControlMBean, NotificationEmitter
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(MessagingServerControl.class);
-
- private static DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
-
- // Attributes ----------------------------------------------------
-
- private final PostOffice postOffice;
-
- private final Configuration configuration;
-
- private final ResourceManager resourceManager;
-
- private final RemotingService remotingService;
-
- private final MessagingServer server;
-
- private final MessageCounterManager messageCounterManager;
-
- private final NotificationBroadcasterSupport broadcaster;
-
- private boolean messageCounterEnabled;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public MessagingServerControl(final PostOffice postOffice,
- final Configuration configuration,
- final ResourceManager resourceManager,
- final RemotingService remotingService,
- final MessagingServer messagingServer,
- final MessageCounterManager messageCounterManager,
- final NotificationBroadcasterSupport broadcaster) throws Exception
- {
- this.postOffice = postOffice;
- this.configuration = configuration;
- this.resourceManager = resourceManager;
- this.remotingService = remotingService;
- this.server = messagingServer;
- this.messageCounterManager = messageCounterManager;
- this.broadcaster = broadcaster;
- this.messageCounterEnabled = configuration.isMessageCounterEnabled();
- }
-
- // Public --------------------------------------------------------
-
- public Configuration getConfiguration()
- {
- return configuration;
- }
-
- // MessagingServerControlMBean implementation --------------------
-
- public boolean isStarted()
- {
- return server.isStarted();
- }
-
- public String getVersion()
- {
- return server.getVersion().getFullVersion();
- }
-
- public boolean isBackup()
- {
- return configuration.isBackup();
- }
-
- public String getBackupConnectorName()
- {
- return configuration.getBackupConnectorName();
- }
-
- public String getBindingsDirectory()
- {
- return configuration.getBindingsDirectory();
- }
-
- public String[] getInterceptorClassNames()
- {
- return configuration.getInterceptorClassNames().toArray(new String[configuration.getInterceptorClassNames().size()]);
- }
-
- public int getAIOBufferSize()
- {
- return configuration.getAIOBufferSize();
- }
-
- public int getAIOBufferTimeout()
- {
- return configuration.getAIOBufferTimeout();
- }
-
- public String getJournalDirectory()
- {
- return configuration.getJournalDirectory();
- }
-
- public int getJournalFileSize()
- {
- return configuration.getJournalFileSize();
- }
-
- public int getJournalMaxAIO()
- {
- return configuration.getJournalMaxAIO();
- }
-
- public int getJournalMinFiles()
- {
- return configuration.getJournalMinFiles();
- }
-
- public String getJournalType()
- {
- return configuration.getJournalType().toString();
- }
-
- public long getPagingMaxGlobalSizeBytes()
- {
- return configuration.getPagingMaxGlobalSizeBytes();
- }
-
- public String getPagingDirectory()
- {
- return configuration.getPagingDirectory();
- }
-
- public int getScheduledThreadPoolMaxSize()
- {
- return configuration.getScheduledThreadPoolMaxSize();
- }
-
- public int getThreadPoolMaxSize()
- {
- return configuration.getThreadPoolMaxSize();
- }
-
- public long getSecurityInvalidationInterval()
- {
- return configuration.getSecurityInvalidationInterval();
- }
-
- public boolean isClustered()
- {
- return configuration.isClustered();
- }
-
- public boolean isCreateBindingsDir()
- {
- return configuration.isCreateBindingsDir();
- }
-
- public boolean isCreateJournalDir()
- {
- return configuration.isCreateJournalDir();
- }
-
- public boolean isJournalSyncNonTransactional()
- {
- return configuration.isJournalSyncNonTransactional();
- }
-
- public boolean isJournalSyncTransactional()
- {
- return configuration.isJournalSyncTransactional();
- }
-
- public boolean isSecurityEnabled()
- {
- return configuration.isSecurityEnabled();
- }
-
- public void deployQueue(final String address, final String name, String filterString) throws Exception
- {
- server.deployQueue(new SimpleString(address), new SimpleString(name), new SimpleString(filterString), true, false);
- }
-
- public void deployQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
- {
- SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
-
- server.deployQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
- }
-
- public void createQueue(final String address, final String name) throws Exception
- {
- server.createQueue(new SimpleString(address), new SimpleString(name), null, true, false);
- }
-
- public void createQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
- {
- SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
-
- server.createQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
- }
-
- public void destroyQueue(final String name) throws Exception
- {
- SimpleString queueName = new SimpleString(name);
-
- server.destroyQueue(queueName, null);
- }
-
- public int getConnectionCount()
- {
- return server.getConnectionCount();
- }
-
- public void enableMessageCounters()
- {
- setMessageCounterEnabled(true);
- }
-
- public void disableMessageCounters()
- {
- setMessageCounterEnabled(false);
- }
-
- public void resetAllMessageCounters()
- {
- messageCounterManager.resetAllCounters();
- }
-
- public void resetAllMessageCounterHistories()
- {
- messageCounterManager.resetAllCounterHistories();
- }
-
- public boolean isMessageCounterEnabled()
- {
- return messageCounterEnabled;
- }
-
- public synchronized long getMessageCounterSamplePeriod()
- {
- return messageCounterManager.getSamplePeriod();
- }
-
- public synchronized void setMessageCounterSamplePeriod(final long newPeriod)
- {
- if (newPeriod < MessageCounterManagerImpl.MIN_SAMPLE_PERIOD)
- {
- throw new IllegalArgumentException("Cannot set MessageCounterSamplePeriod < " + MessageCounterManagerImpl.MIN_SAMPLE_PERIOD +
- " ms");
- }
-
- if (messageCounterManager != null && newPeriod != messageCounterManager.getSamplePeriod())
- {
- messageCounterManager.reschedule(newPeriod);
- }
- }
-
- public int getMessageCounterMaxDayCount()
- {
- return messageCounterManager.getMaxDayCount();
- }
-
- public void setMessageCounterMaxDayCount(final int count)
- {
- if (count <= 0)
- {
- throw new IllegalArgumentException("invalid value: count must be greater than 0");
- }
- messageCounterManager.setMaxDayCount(count);
- }
-
- public String[] listPreparedTransactions()
- {
- Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
- ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
- Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
- {
- public int compare(Entry<Xid, Long> entry1, Entry<Xid, Long> entry2)
- {
- // sort by creation time, oldest first
- return (int)(entry1.getValue() - entry2.getValue());
- }
- });
- String[] s = new String[xidsSortedByCreationTime.size()];
- int i = 0;
- for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
- {
- Date creation = new Date(entry.getValue());
- Xid xid = entry.getKey();
- s[i++] = DATE_FORMAT.format(creation) + " base64: " + XidImpl.toBase64String(xid) + " " + xid.toString();
- }
- return s;
- }
-
- public synchronized boolean commitPreparedTransaction(final String transactionAsBase64) throws Exception
- {
- List<Xid> xids = resourceManager.getPreparedTransactions();
-
- for (Xid xid : xids)
- {
- if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
- {
- Transaction transaction = resourceManager.removeTransaction(xid);
- transaction.commit();
- return true;
- }
- }
- return false;
- }
-
- public synchronized boolean rollbackPreparedTransaction(final String transactionAsBase64) throws Exception
- {
- List<Xid> xids = resourceManager.getPreparedTransactions();
-
- for (Xid xid : xids)
- {
- if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
- {
- Transaction transaction = resourceManager.removeTransaction(xid);
- transaction.rollback();
- return true;
- }
- }
- return false;
- }
-
- public String[] listRemoteAddresses()
- {
- Set<RemotingConnection> connections = remotingService.getConnections();
-
- String[] remoteAddresses = new String[connections.size()];
- int i = 0;
- for (RemotingConnection connection : connections)
- {
- remoteAddresses[i++] = connection.getRemoteAddress();
- }
- return remoteAddresses;
- }
-
- public String[] listRemoteAddresses(final String ipAddress)
- {
- Set<RemotingConnection> connections = remotingService.getConnections();
- List<String> remoteConnections = new ArrayList<String>();
- for (RemotingConnection connection : connections)
- {
- String remoteAddress = connection.getRemoteAddress();
- if (remoteAddress.contains(ipAddress))
- {
- remoteConnections.add(connection.getRemoteAddress());
- }
- }
- return (String[])remoteConnections.toArray(new String[remoteConnections.size()]);
- }
-
- public synchronized boolean closeConnectionsForAddress(final String ipAddress)
- {
- boolean closed = false;
- Set<RemotingConnection> connections = remotingService.getConnections();
- for (RemotingConnection connection : connections)
- {
- String remoteAddress = connection.getRemoteAddress();
- if (remoteAddress.contains(ipAddress))
- {
- remotingService.removeConnection(connection.getID());
- connection.fail(new MessagingException(MessagingException.INTERNAL_ERROR, "connections for " + ipAddress +
- " closed by management"));
- closed = true;
- }
- }
-
- return closed;
- }
-
- public String[] listConnectionIDs()
- {
- Set<RemotingConnection> connections = remotingService.getConnections();
- String[] connectionIDs = new String[connections.size()];
- int i = 0;
- for (RemotingConnection connection : connections)
- {
- connectionIDs[i++] = connection.getID().toString();
- }
- return connectionIDs;
- }
-
- public String[] listSessions(final String connectionID)
- {
- List<ServerSession> sessions = server.getSessions(connectionID);
- String[] sessionIDs = new String[sessions.size()];
- int i = 0;
- for (ServerSession serverSession : sessions)
- {
- sessionIDs[i++] = serverSession.getName();
- }
- return sessionIDs;
- }
-
- public Object[] getConnectors() throws Exception
- {
- Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations().values();
-
- Object[] ret = new Object[connectorConfigurations.size()];
-
- int i = 0;
- for (TransportConfiguration config: connectorConfigurations)
- {
- Object[] tc = new Object[3];
-
- tc[0] = config.getName();
- tc[1] = config.getFactoryClassName();
- tc[2] = config.getParams();
-
- ret[i++] = tc;
- }
-
- return ret;
- }
-
- public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception
- {
- postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address));
- }
-
- // NotificationEmitter implementation ----------------------------
-
- public void removeNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener, filter, handback);
- }
-
- public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener);
- }
-
- public void addNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws IllegalArgumentException
- {
- broadcaster.addNotificationListener(listener, filter, handback);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- NotificationType[] values = NotificationType.values();
- String[] names = new String[values.length];
- for (int i = 0; i < values.length; i++)
- {
- names[i] = values[i].toString();
- }
- return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
- this.getClass().getName(),
- "Notifications emitted by a Core Server") };
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private synchronized void setMessageCounterEnabled(boolean enable)
- {
- if (isStarted())
- {
- if (messageCounterEnabled && !enable)
- {
- stopMessageCounters();
- }
- else if (!messageCounterEnabled && enable)
- {
- startMessageCounters();
- }
- }
- messageCounterEnabled = enable;
- }
-
- private void startMessageCounters()
- {
- messageCounterManager.start();
- }
-
- private void stopMessageCounters()
- {
- messageCounterManager.stop();
-
- messageCounterManager.resetAllCounters();
-
- messageCounterManager.resetAllCounterHistories();
- }
-
- public long getConnectionTTLOverride()
- {
- return configuration.getConnectionTTLOverride();
- }
-
- public int getIDCacheSize()
- {
- return configuration.getIDCacheSize();
- }
-
- public String getLargeMessagesDirectory()
- {
- return configuration.getLargeMessagesDirectory();
- }
-
- public String getManagementAddress()
- {
- return configuration.getManagementAddress().toString();
- }
-
- public String getManagementNotificationAddress()
- {
- return configuration.getManagementNotificationAddress().toString();
- }
-
- public long getManagementRequestTimeout()
- {
- return configuration.getManagementRequestTimeout();
- }
-
- public long getMessageExpiryScanPeriod()
- {
- return configuration.getMessageExpiryScanPeriod();
- }
-
- public long getMessageExpiryThreadPriority()
- {
- return configuration.getMessageExpiryThreadPriority();
- }
-
- public int getGlobalPageSize()
- {
- return configuration.getGlobalPagingSize();
- }
-
- public long getQueueActivationTimeout()
- {
- return configuration.getQueueActivationTimeout();
- }
-
- public long getTransactionTimeout()
- {
- return configuration.getTransactionTimeout();
- }
-
- public long getTransactionTimeoutScanPeriod()
- {
- return configuration.getTransactionTimeoutScanPeriod();
- }
-
- public boolean isPersistDeliveryCountBeforeDelivery()
- {
- return configuration.isPersistDeliveryCountBeforeDelivery();
- }
-
- public boolean isPersistIDCache()
- {
- return configuration.isPersistIDCache();
- }
-
- public boolean isWildcardRoutingEnabled()
- {
- return configuration.isWildcardRoutingEnabled();
- }
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,635 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management.impl;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanNotificationInfo;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+import javax.transaction.xa.Xid;
+
+import org.jboss.messaging.core.config.Configuration;
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.core.exception.MessagingException;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.management.MessagingServerControl;
+import org.jboss.messaging.core.management.NotificationType;
+import org.jboss.messaging.core.messagecounter.MessageCounterManager;
+import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
+import org.jboss.messaging.core.postoffice.PostOffice;
+import org.jboss.messaging.core.remoting.RemotingConnection;
+import org.jboss.messaging.core.remoting.server.RemotingService;
+import org.jboss.messaging.core.server.MessagingServer;
+import org.jboss.messaging.core.server.ServerSession;
+import org.jboss.messaging.core.transaction.ResourceManager;
+import org.jboss.messaging.core.transaction.Transaction;
+import org.jboss.messaging.core.transaction.impl.XidImpl;
+import org.jboss.messaging.utils.SimpleString;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class MessagingServerControlImpl implements MessagingServerControl, NotificationEmitter
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(MessagingServerControlImpl.class);
+
+ private static DateFormat DATE_FORMAT = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.MEDIUM);
+
+ // Attributes ----------------------------------------------------
+
+ private final PostOffice postOffice;
+
+ private final Configuration configuration;
+
+ private final ResourceManager resourceManager;
+
+ private final RemotingService remotingService;
+
+ private final MessagingServer server;
+
+ private final MessageCounterManager messageCounterManager;
+
+ private final NotificationBroadcasterSupport broadcaster;
+
+ private boolean messageCounterEnabled;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public MessagingServerControlImpl(final PostOffice postOffice,
+ final Configuration configuration,
+ final ResourceManager resourceManager,
+ final RemotingService remotingService,
+ final MessagingServer messagingServer,
+ final MessageCounterManager messageCounterManager,
+ final NotificationBroadcasterSupport broadcaster) throws Exception
+ {
+ this.postOffice = postOffice;
+ this.configuration = configuration;
+ this.resourceManager = resourceManager;
+ this.remotingService = remotingService;
+ this.server = messagingServer;
+ this.messageCounterManager = messageCounterManager;
+ this.broadcaster = broadcaster;
+ this.messageCounterEnabled = configuration.isMessageCounterEnabled();
+ }
+
+ // Public --------------------------------------------------------
+
+ public Configuration getConfiguration()
+ {
+ return configuration;
+ }
+
+ // MessagingServerControlMBean implementation --------------------
+
+ public boolean isStarted()
+ {
+ return server.isStarted();
+ }
+
+ public String getVersion()
+ {
+ return server.getVersion().getFullVersion();
+ }
+
+ public boolean isBackup()
+ {
+ return configuration.isBackup();
+ }
+
+ public String getBackupConnectorName()
+ {
+ return configuration.getBackupConnectorName();
+ }
+
+ public String getBindingsDirectory()
+ {
+ return configuration.getBindingsDirectory();
+ }
+
+ public String[] getInterceptorClassNames()
+ {
+ return configuration.getInterceptorClassNames().toArray(new String[configuration.getInterceptorClassNames().size()]);
+ }
+
+ public int getAIOBufferSize()
+ {
+ return configuration.getAIOBufferSize();
+ }
+
+ public int getAIOBufferTimeout()
+ {
+ return configuration.getAIOBufferTimeout();
+ }
+
+ public String getJournalDirectory()
+ {
+ return configuration.getJournalDirectory();
+ }
+
+ public int getJournalFileSize()
+ {
+ return configuration.getJournalFileSize();
+ }
+
+ public int getJournalMaxAIO()
+ {
+ return configuration.getJournalMaxAIO();
+ }
+
+ public int getJournalMinFiles()
+ {
+ return configuration.getJournalMinFiles();
+ }
+
+ public String getJournalType()
+ {
+ return configuration.getJournalType().toString();
+ }
+
+ public long getPagingMaxGlobalSizeBytes()
+ {
+ return configuration.getPagingMaxGlobalSizeBytes();
+ }
+
+ public String getPagingDirectory()
+ {
+ return configuration.getPagingDirectory();
+ }
+
+ public int getScheduledThreadPoolMaxSize()
+ {
+ return configuration.getScheduledThreadPoolMaxSize();
+ }
+
+ public int getThreadPoolMaxSize()
+ {
+ return configuration.getThreadPoolMaxSize();
+ }
+
+ public long getSecurityInvalidationInterval()
+ {
+ return configuration.getSecurityInvalidationInterval();
+ }
+
+ public boolean isClustered()
+ {
+ return configuration.isClustered();
+ }
+
+ public boolean isCreateBindingsDir()
+ {
+ return configuration.isCreateBindingsDir();
+ }
+
+ public boolean isCreateJournalDir()
+ {
+ return configuration.isCreateJournalDir();
+ }
+
+ public boolean isJournalSyncNonTransactional()
+ {
+ return configuration.isJournalSyncNonTransactional();
+ }
+
+ public boolean isJournalSyncTransactional()
+ {
+ return configuration.isJournalSyncTransactional();
+ }
+
+ public boolean isSecurityEnabled()
+ {
+ return configuration.isSecurityEnabled();
+ }
+
+ public void deployQueue(final String address, final String name, String filterString) throws Exception
+ {
+ server.deployQueue(new SimpleString(address), new SimpleString(name), new SimpleString(filterString), true, false);
+ }
+
+ public void deployQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
+ {
+ SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
+
+ server.deployQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
+ }
+
+ public void createQueue(final String address, final String name) throws Exception
+ {
+ server.createQueue(new SimpleString(address), new SimpleString(name), null, true, false);
+ }
+
+ public void createQueue(final String address, final String name, final String filterStr, final boolean durable) throws Exception
+ {
+ SimpleString filter = filterStr == null ? null : new SimpleString(filterStr);
+
+ server.createQueue(new SimpleString(address), new SimpleString(name), filter, durable, false);
+ }
+
+ public void destroyQueue(final String name) throws Exception
+ {
+ SimpleString queueName = new SimpleString(name);
+
+ server.destroyQueue(queueName, null);
+ }
+
+ public int getConnectionCount()
+ {
+ return server.getConnectionCount();
+ }
+
+ public void enableMessageCounters()
+ {
+ setMessageCounterEnabled(true);
+ }
+
+ public void disableMessageCounters()
+ {
+ setMessageCounterEnabled(false);
+ }
+
+ public void resetAllMessageCounters()
+ {
+ messageCounterManager.resetAllCounters();
+ }
+
+ public void resetAllMessageCounterHistories()
+ {
+ messageCounterManager.resetAllCounterHistories();
+ }
+
+ public boolean isMessageCounterEnabled()
+ {
+ return messageCounterEnabled;
+ }
+
+ public synchronized long getMessageCounterSamplePeriod()
+ {
+ return messageCounterManager.getSamplePeriod();
+ }
+
+ public synchronized void setMessageCounterSamplePeriod(final long newPeriod)
+ {
+ if (newPeriod < MessageCounterManagerImpl.MIN_SAMPLE_PERIOD)
+ {
+ throw new IllegalArgumentException("Cannot set MessageCounterSamplePeriod < " + MessageCounterManagerImpl.MIN_SAMPLE_PERIOD +
+ " ms");
+ }
+
+ if (messageCounterManager != null && newPeriod != messageCounterManager.getSamplePeriod())
+ {
+ messageCounterManager.reschedule(newPeriod);
+ }
+ }
+
+ public int getMessageCounterMaxDayCount()
+ {
+ return messageCounterManager.getMaxDayCount();
+ }
+
+ public void setMessageCounterMaxDayCount(final int count)
+ {
+ if (count <= 0)
+ {
+ throw new IllegalArgumentException("invalid value: count must be greater than 0");
+ }
+ messageCounterManager.setMaxDayCount(count);
+ }
+
+ public String[] listPreparedTransactions()
+ {
+ Map<Xid, Long> xids = resourceManager.getPreparedTransactionsWithCreationTime();
+ ArrayList<Entry<Xid, Long>> xidsSortedByCreationTime = new ArrayList<Map.Entry<Xid, Long>>(xids.entrySet());
+ Collections.sort(xidsSortedByCreationTime, new Comparator<Entry<Xid, Long>>()
+ {
+ public int compare(Entry<Xid, Long> entry1, Entry<Xid, Long> entry2)
+ {
+ // sort by creation time, oldest first
+ return (int)(entry1.getValue() - entry2.getValue());
+ }
+ });
+ String[] s = new String[xidsSortedByCreationTime.size()];
+ int i = 0;
+ for (Map.Entry<Xid, Long> entry : xidsSortedByCreationTime)
+ {
+ Date creation = new Date(entry.getValue());
+ Xid xid = entry.getKey();
+ s[i++] = DATE_FORMAT.format(creation) + " base64: " + XidImpl.toBase64String(xid) + " " + xid.toString();
+ }
+ return s;
+ }
+
+ public synchronized boolean commitPreparedTransaction(final String transactionAsBase64) throws Exception
+ {
+ List<Xid> xids = resourceManager.getPreparedTransactions();
+
+ for (Xid xid : xids)
+ {
+ if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
+ {
+ Transaction transaction = resourceManager.removeTransaction(xid);
+ transaction.commit();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public synchronized boolean rollbackPreparedTransaction(final String transactionAsBase64) throws Exception
+ {
+ List<Xid> xids = resourceManager.getPreparedTransactions();
+
+ for (Xid xid : xids)
+ {
+ if (XidImpl.toBase64String(xid).equals(transactionAsBase64))
+ {
+ Transaction transaction = resourceManager.removeTransaction(xid);
+ transaction.rollback();
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public String[] listRemoteAddresses()
+ {
+ Set<RemotingConnection> connections = remotingService.getConnections();
+
+ String[] remoteAddresses = new String[connections.size()];
+ int i = 0;
+ for (RemotingConnection connection : connections)
+ {
+ remoteAddresses[i++] = connection.getRemoteAddress();
+ }
+ return remoteAddresses;
+ }
+
+ public String[] listRemoteAddresses(final String ipAddress)
+ {
+ Set<RemotingConnection> connections = remotingService.getConnections();
+ List<String> remoteConnections = new ArrayList<String>();
+ for (RemotingConnection connection : connections)
+ {
+ String remoteAddress = connection.getRemoteAddress();
+ if (remoteAddress.contains(ipAddress))
+ {
+ remoteConnections.add(connection.getRemoteAddress());
+ }
+ }
+ return (String[])remoteConnections.toArray(new String[remoteConnections.size()]);
+ }
+
+ public synchronized boolean closeConnectionsForAddress(final String ipAddress)
+ {
+ boolean closed = false;
+ Set<RemotingConnection> connections = remotingService.getConnections();
+ for (RemotingConnection connection : connections)
+ {
+ String remoteAddress = connection.getRemoteAddress();
+ if (remoteAddress.contains(ipAddress))
+ {
+ remotingService.removeConnection(connection.getID());
+ connection.fail(new MessagingException(MessagingException.INTERNAL_ERROR, "connections for " + ipAddress +
+ " closed by management"));
+ closed = true;
+ }
+ }
+
+ return closed;
+ }
+
+ public String[] listConnectionIDs()
+ {
+ Set<RemotingConnection> connections = remotingService.getConnections();
+ String[] connectionIDs = new String[connections.size()];
+ int i = 0;
+ for (RemotingConnection connection : connections)
+ {
+ connectionIDs[i++] = connection.getID().toString();
+ }
+ return connectionIDs;
+ }
+
+ public String[] listSessions(final String connectionID)
+ {
+ List<ServerSession> sessions = server.getSessions(connectionID);
+ String[] sessionIDs = new String[sessions.size()];
+ int i = 0;
+ for (ServerSession serverSession : sessions)
+ {
+ sessionIDs[i++] = serverSession.getName();
+ }
+ return sessionIDs;
+ }
+
+ public Object[] getConnectors() throws Exception
+ {
+ Collection<TransportConfiguration> connectorConfigurations = configuration.getConnectorConfigurations().values();
+
+ Object[] ret = new Object[connectorConfigurations.size()];
+
+ int i = 0;
+ for (TransportConfiguration config: connectorConfigurations)
+ {
+ Object[] tc = new Object[3];
+
+ tc[0] = config.getName();
+ tc[1] = config.getFactoryClassName();
+ tc[2] = config.getParams();
+
+ ret[i++] = tc;
+ }
+
+ return ret;
+ }
+
+ public void sendQueueInfoToQueue(final String queueName, final String address) throws Exception
+ {
+ postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address));
+ }
+
+ // NotificationEmitter implementation ----------------------------
+
+ public void removeNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener, filter, handback);
+ }
+
+ public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener);
+ }
+
+ public void addNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws IllegalArgumentException
+ {
+ broadcaster.addNotificationListener(listener, filter, handback);
+ }
+
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
+ NotificationType[] values = NotificationType.values();
+ String[] names = new String[values.length];
+ for (int i = 0; i < values.length; i++)
+ {
+ names[i] = values[i].toString();
+ }
+ return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
+ this.getClass().getName(),
+ "Notifications emitted by a Core Server") };
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private synchronized void setMessageCounterEnabled(boolean enable)
+ {
+ if (isStarted())
+ {
+ if (messageCounterEnabled && !enable)
+ {
+ stopMessageCounters();
+ }
+ else if (!messageCounterEnabled && enable)
+ {
+ startMessageCounters();
+ }
+ }
+ messageCounterEnabled = enable;
+ }
+
+ private void startMessageCounters()
+ {
+ messageCounterManager.start();
+ }
+
+ private void stopMessageCounters()
+ {
+ messageCounterManager.stop();
+
+ messageCounterManager.resetAllCounters();
+
+ messageCounterManager.resetAllCounterHistories();
+ }
+
+ public long getConnectionTTLOverride()
+ {
+ return configuration.getConnectionTTLOverride();
+ }
+
+ public int getIDCacheSize()
+ {
+ return configuration.getIDCacheSize();
+ }
+
+ public String getLargeMessagesDirectory()
+ {
+ return configuration.getLargeMessagesDirectory();
+ }
+
+ public String getManagementAddress()
+ {
+ return configuration.getManagementAddress().toString();
+ }
+
+ public String getManagementNotificationAddress()
+ {
+ return configuration.getManagementNotificationAddress().toString();
+ }
+
+ public long getManagementRequestTimeout()
+ {
+ return configuration.getManagementRequestTimeout();
+ }
+
+ public long getMessageExpiryScanPeriod()
+ {
+ return configuration.getMessageExpiryScanPeriod();
+ }
+
+ public long getMessageExpiryThreadPriority()
+ {
+ return configuration.getMessageExpiryThreadPriority();
+ }
+
+ public int getGlobalPageSize()
+ {
+ return configuration.getGlobalPagingSize();
+ }
+
+ public long getQueueActivationTimeout()
+ {
+ return configuration.getQueueActivationTimeout();
+ }
+
+ public long getTransactionTimeout()
+ {
+ return configuration.getTransactionTimeout();
+ }
+
+ public long getTransactionTimeoutScanPeriod()
+ {
+ return configuration.getTransactionTimeoutScanPeriod();
+ }
+
+ public boolean isPersistDeliveryCountBeforeDelivery()
+ {
+ return configuration.isPersistDeliveryCountBeforeDelivery();
+ }
+
+ public boolean isPersistIDCache()
+ {
+ return configuration.isPersistIDCache();
+ }
+
+ public boolean isWildcardRoutingEnabled()
+ {
+ return configuration.isWildcardRoutingEnabled();
+ }
+}
Deleted: trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,411 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.core.management.impl;
-
-import java.util.List;
-import java.util.Map;
-
-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.management.MessageCounterInfo;
-import org.jboss.messaging.core.management.QueueControlMBean;
-import org.jboss.messaging.core.message.Message;
-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.settings.HierarchicalRepository;
-import org.jboss.messaging.core.settings.impl.AddressSettings;
-import org.jboss.messaging.utils.SimpleString;
-import org.jboss.messaging.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class QueueControl implements QueueControlMBean
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final Queue queue;
-
- private final String address;
-
- private final PostOffice postOffice;
-
- private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
-
- private MessageCounter counter;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public QueueControl(final Queue queue,
- final String address,
- final PostOffice postOffice,
- final HierarchicalRepository<AddressSettings> addressSettingsRepository)
- {
- this.queue = queue;
- this.address = address;
- this.postOffice = postOffice;
- this.addressSettingsRepository = addressSettingsRepository;
- }
-
- // Public --------------------------------------------------------
-
- public void setMessageCounter(MessageCounter counter)
- {
- this.counter = counter;
- }
-
- // QueueControlMBean implementation ------------------------------
-
- public String getName()
- {
- return queue.getName().toString();
- }
-
- public String getAddress()
- {
- return address;
- }
-
- public String getFilter()
- {
- Filter filter = queue.getFilter();
-
- return (filter != null) ? filter.getFilterString().toString() : null;
- }
-
- public boolean isDurable()
- {
- return queue.isDurable();
- }
-
- public boolean isTemporary()
- {
- return queue.isTemporary();
- }
-
- public boolean isBackup()
- {
- return queue.isBackup();
- }
-
- public int getMessageCount()
- {
- return queue.getMessageCount();
- }
-
- public int getConsumerCount()
- {
- return queue.getConsumerCount();
- }
-
- public int getDeliveringCount()
- {
- return queue.getDeliveringCount();
- }
-
- public int getMessagesAdded()
- {
- return queue.getMessagesAdded();
- }
-
- public long getPersistenceID()
- {
- return queue.getPersistenceID();
- }
-
- public long getScheduledCount()
- {
- return queue.getScheduledCount();
- }
-
- public String getDeadLetterAddress()
- {
- AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
-
- if (addressSettings != null && addressSettings.getDeadLetterAddress() != null)
- {
- return addressSettings.getDeadLetterAddress().toString();
- }
- else
- {
- return null;
- }
- }
-
- public void setDeadLetterAddress(final String deadLetterAddress) throws Exception
- {
- AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
-
- if (deadLetterAddress != null)
- {
- addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
- }
- }
-
- public String getExpiryAddress()
- {
- AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
-
- if (addressSettings != null && addressSettings.getExpiryAddress() != null)
- {
- return addressSettings.getExpiryAddress().toString();
- }
- else
- {
- return null;
- }
- }
-
- public void setExpiryAddress(final String expiryAddres) throws Exception
- {
- AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
-
- if (expiryAddres != null)
- {
- addressSettings.setExpiryAddress(new SimpleString(expiryAddres));
- }
- }
-
- public Map<String, Object>[] listAllMessages() throws Exception
- {
- return listMessages(null);
- }
-
- public Map<String, Object>[] listScheduledMessages() throws Exception
- {
- List<MessageReference> refs = queue.getScheduledMessages();
- Map<String, Object>[] messages = new Map[refs.size()];
- int i = 0;
- for (MessageReference ref : refs)
- {
- Message message = ref.getMessage();
- messages[i++] = message.toMap();
- }
- return messages;
- }
-
- public Map[] listMessages(final String filterStr) throws Exception
- {
- try
- {
- Filter filter = FilterImpl.createFilter(filterStr);
- List<MessageReference> refs = queue.list(filter);
- Map<String, Object>[] messages = new Map[refs.size()];
- int i = 0;
- for (MessageReference ref : refs)
- {
- Message message = ref.getMessage();
- messages[i++] = message.toMap();
- }
- return messages;
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public int countMessages(final String filterStr) throws Exception
- {
- Filter filter = FilterImpl.createFilter(filterStr);
- List<MessageReference> refs = queue.list(filter);
- return refs.size();
- }
-
- public int removeAllMessages() throws Exception
- {
- try
- {
- return queue.deleteAllReferences();
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public boolean removeMessage(final long messageID) throws Exception
- {
- try
- {
- return queue.deleteReference(messageID);
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public int removeMatchingMessages(final String filterStr) throws Exception
- {
- Filter filter = FilterImpl.createFilter(filterStr);
-
- return queue.deleteMatchingReferences(filter);
- }
-
- public boolean expireMessage(final long messageID) throws Exception
- {
- return queue.expireReference(messageID);
- }
-
- public int expireMessages(final String filterStr) throws Exception
- {
- try
- {
- Filter filter = FilterImpl.createFilter(filterStr);
-
- return queue.expireReferences(filter);
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public boolean moveMessage(final long messageID, final String otherQueueName) throws Exception
- {
- Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));
-
- if (binding == null)
- {
- throw new IllegalArgumentException("No queue found for " + otherQueueName);
- }
-
- return queue.moveReference(messageID, binding.getAddress());
- }
-
- public int moveMatchingMessages(final String filterStr, final String otherQueueName) throws Exception
- {
- Filter filter = FilterImpl.createFilter(filterStr);
-
- Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));
-
- if (binding == null)
- {
- throw new IllegalArgumentException("No queue found for " + otherQueueName);
- }
-
- return queue.moveReferences(filter, binding.getAddress());
- }
-
- public int moveAllMessages(String otherQueueName) throws Exception
- {
- return moveMatchingMessages(null, otherQueueName);
- }
-
- public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
- {
- Filter filter = filterStr == null ? null : new FilterImpl(new SimpleString(filterStr));
-
- List<MessageReference> refs = queue.list(filter);
-
- for (MessageReference ref : refs)
- {
- sendMessageToDeadLetterAddress(ref.getMessage().getMessageID());
- }
-
- return refs.size();
- }
-
- public boolean sendMessageToDeadLetterAddress(final long messageID) throws Exception
- {
- return queue.sendMessageToDeadLetterAddress(messageID);
- }
-
- public int changeMessagesPriority(String filterStr, int newPriority) throws Exception
- {
- Filter filter = filterStr == null ? null : new FilterImpl(new SimpleString(filterStr));
-
- List<MessageReference> refs = queue.list(filter);
-
- for (MessageReference ref : refs)
- {
- changeMessagePriority(ref.getMessage().getMessageID(), newPriority);
- }
-
- return refs.size();
- }
-
- public boolean changeMessagePriority(final long messageID, final int newPriority) throws Exception
- {
- if (newPriority < 0 || newPriority > 9)
- {
- throw new IllegalArgumentException("invalid newPriority value: " + newPriority +
- ". It must be between 0 and 9 (both included)");
- }
- return queue.changeReferencePriority(messageID, (byte)newPriority);
- }
-
- public String listMessageCounter()
- {
- try
- {
- return MessageCounterInfo.toJSon(counter);
- }
- catch (Exception e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- public void resetMessageCounter()
- {
- counter.resetCounter();
- }
-
- public String listMessageCounterAsHTML()
- {
- return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
- }
-
- public String listMessageCounterHistory() throws Exception
- {
- return MessageCounterHelper.listMessageCounterHistory(counter);
- }
-
- public String listMessageCounterHistoryAsHTML()
- {
- return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/src/main/org/jboss/messaging/core/management/impl/QueueControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/core/management/impl/QueueControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/QueueControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/QueueControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,410 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.core.management.impl;
+
+import java.util.List;
+import java.util.Map;
+
+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.management.MessageCounterInfo;
+import org.jboss.messaging.core.management.QueueControl;
+import org.jboss.messaging.core.message.Message;
+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.settings.HierarchicalRepository;
+import org.jboss.messaging.core.settings.impl.AddressSettings;
+import org.jboss.messaging.utils.SimpleString;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class QueueControlImpl implements QueueControl
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final Queue queue;
+
+ private final String address;
+
+ private final PostOffice postOffice;
+
+ private final HierarchicalRepository<AddressSettings> addressSettingsRepository;
+
+ private MessageCounter counter;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public QueueControlImpl(final Queue queue,
+ final String address,
+ final PostOffice postOffice,
+ final HierarchicalRepository<AddressSettings> addressSettingsRepository)
+ {
+ this.queue = queue;
+ this.address = address;
+ this.postOffice = postOffice;
+ this.addressSettingsRepository = addressSettingsRepository;
+ }
+
+ // Public --------------------------------------------------------
+
+ public void setMessageCounter(MessageCounter counter)
+ {
+ this.counter = counter;
+ }
+
+ // QueueControlMBean implementation ------------------------------
+
+ public String getName()
+ {
+ return queue.getName().toString();
+ }
+
+ public String getAddress()
+ {
+ return address;
+ }
+
+ public String getFilter()
+ {
+ Filter filter = queue.getFilter();
+
+ return (filter != null) ? filter.getFilterString().toString() : null;
+ }
+
+ public boolean isDurable()
+ {
+ return queue.isDurable();
+ }
+
+ public boolean isTemporary()
+ {
+ return queue.isTemporary();
+ }
+
+ public boolean isBackup()
+ {
+ return queue.isBackup();
+ }
+
+ public int getMessageCount()
+ {
+ return queue.getMessageCount();
+ }
+
+ public int getConsumerCount()
+ {
+ return queue.getConsumerCount();
+ }
+
+ public int getDeliveringCount()
+ {
+ return queue.getDeliveringCount();
+ }
+
+ public int getMessagesAdded()
+ {
+ return queue.getMessagesAdded();
+ }
+
+ public long getPersistenceID()
+ {
+ return queue.getPersistenceID();
+ }
+
+ public long getScheduledCount()
+ {
+ return queue.getScheduledCount();
+ }
+
+ public String getDeadLetterAddress()
+ {
+ AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
+
+ if (addressSettings != null && addressSettings.getDeadLetterAddress() != null)
+ {
+ return addressSettings.getDeadLetterAddress().toString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setDeadLetterAddress(final String deadLetterAddress) throws Exception
+ {
+ AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
+
+ if (deadLetterAddress != null)
+ {
+ addressSettings.setDeadLetterAddress(new SimpleString(deadLetterAddress));
+ }
+ }
+
+ public String getExpiryAddress()
+ {
+ AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
+
+ if (addressSettings != null && addressSettings.getExpiryAddress() != null)
+ {
+ return addressSettings.getExpiryAddress().toString();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public void setExpiryAddress(final String expiryAddres) throws Exception
+ {
+ AddressSettings addressSettings = addressSettingsRepository.getMatch(address);
+
+ if (expiryAddres != null)
+ {
+ addressSettings.setExpiryAddress(new SimpleString(expiryAddres));
+ }
+ }
+
+ public Map<String, Object>[] listAllMessages() throws Exception
+ {
+ return listMessages(null);
+ }
+
+ public Map<String, Object>[] listScheduledMessages() throws Exception
+ {
+ List<MessageReference> refs = queue.getScheduledMessages();
+ Map<String, Object>[] messages = new Map[refs.size()];
+ int i = 0;
+ for (MessageReference ref : refs)
+ {
+ Message message = ref.getMessage();
+ messages[i++] = message.toMap();
+ }
+ return messages;
+ }
+
+ public Map[] listMessages(final String filterStr) throws Exception
+ {
+ try
+ {
+ Filter filter = FilterImpl.createFilter(filterStr);
+ List<MessageReference> refs = queue.list(filter);
+ Map<String, Object>[] messages = new Map[refs.size()];
+ int i = 0;
+ for (MessageReference ref : refs)
+ {
+ Message message = ref.getMessage();
+ messages[i++] = message.toMap();
+ }
+ return messages;
+ }
+ catch (MessagingException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public int countMessages(final String filterStr) throws Exception
+ {
+ Filter filter = FilterImpl.createFilter(filterStr);
+ List<MessageReference> refs = queue.list(filter);
+ return refs.size();
+ }
+
+ public int removeAllMessages() throws Exception
+ {
+ try
+ {
+ return queue.deleteAllReferences();
+ }
+ catch (MessagingException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public boolean removeMessage(final long messageID) throws Exception
+ {
+ try
+ {
+ return queue.deleteReference(messageID);
+ }
+ catch (MessagingException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public int removeMatchingMessages(final String filterStr) throws Exception
+ {
+ Filter filter = FilterImpl.createFilter(filterStr);
+
+ return queue.deleteMatchingReferences(filter);
+ }
+
+ public boolean expireMessage(final long messageID) throws Exception
+ {
+ return queue.expireReference(messageID);
+ }
+
+ public int expireMessages(final String filterStr) throws Exception
+ {
+ try
+ {
+ Filter filter = FilterImpl.createFilter(filterStr);
+
+ return queue.expireReferences(filter);
+ }
+ catch (MessagingException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public boolean moveMessage(final long messageID, final String otherQueueName) throws Exception
+ {
+ Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));
+
+ if (binding == null)
+ {
+ throw new IllegalArgumentException("No queue found for " + otherQueueName);
+ }
+
+ return queue.moveReference(messageID, binding.getAddress());
+ }
+
+ public int moveMatchingMessages(final String filterStr, final String otherQueueName) throws Exception
+ {
+ Filter filter = FilterImpl.createFilter(filterStr);
+
+ Binding binding = postOffice.getBinding(new SimpleString(otherQueueName));
+
+ if (binding == null)
+ {
+ throw new IllegalArgumentException("No queue found for " + otherQueueName);
+ }
+
+ return queue.moveReferences(filter, binding.getAddress());
+ }
+
+ public int moveAllMessages(String otherQueueName) throws Exception
+ {
+ return moveMatchingMessages(null, otherQueueName);
+ }
+
+ public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
+ {
+ Filter filter = filterStr == null ? null : new FilterImpl(new SimpleString(filterStr));
+
+ List<MessageReference> refs = queue.list(filter);
+
+ for (MessageReference ref : refs)
+ {
+ sendMessageToDeadLetterAddress(ref.getMessage().getMessageID());
+ }
+
+ return refs.size();
+ }
+
+ public boolean sendMessageToDeadLetterAddress(final long messageID) throws Exception
+ {
+ return queue.sendMessageToDeadLetterAddress(messageID);
+ }
+
+ public int changeMessagesPriority(String filterStr, int newPriority) throws Exception
+ {
+ Filter filter = filterStr == null ? null : new FilterImpl(new SimpleString(filterStr));
+
+ List<MessageReference> refs = queue.list(filter);
+
+ for (MessageReference ref : refs)
+ {
+ changeMessagePriority(ref.getMessage().getMessageID(), newPriority);
+ }
+
+ return refs.size();
+ }
+
+ public boolean changeMessagePriority(final long messageID, final int newPriority) throws Exception
+ {
+ if (newPriority < 0 || newPriority > 9)
+ {
+ throw new IllegalArgumentException("invalid newPriority value: " + newPriority +
+ ". It must be between 0 and 9 (both included)");
+ }
+ return queue.changeReferencePriority(messageID, (byte)newPriority);
+ }
+
+ public String listMessageCounter()
+ {
+ try
+ {
+ return MessageCounterInfo.toJSon(counter);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public void resetMessageCounter()
+ {
+ counter.resetCounter();
+ }
+
+ public String listMessageCounterAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
+ }
+
+ public String listMessageCounterHistory() throws Exception
+ {
+ return MessageCounterHelper.listMessageCounterHistory(counter);
+ }
+
+ public String listMessageCounterHistoryAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Modified: trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareAddressControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareAddressControlWrapper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareAddressControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -24,10 +24,10 @@
import javax.management.MBeanInfo;
-import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.AddressControl;
import org.jboss.messaging.core.management.ReplicationOperationInvoker;
import org.jboss.messaging.core.management.ResourceNames;
-import org.jboss.messaging.core.management.impl.AddressControl;
+import org.jboss.messaging.core.management.impl.AddressControlImpl;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
/**
@@ -37,24 +37,24 @@
*
*/
public class ReplicationAwareAddressControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- AddressControlMBean
+ AddressControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final AddressControl localAddressControl;
+ private final AddressControlImpl localAddressControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareAddressControlWrapper(final AddressControl localAddressControl,
+ public ReplicationAwareAddressControlWrapper(final AddressControlImpl localAddressControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
super(ResourceNames.CORE_ADDRESS + localAddressControl.getAddress(),
- AddressControlMBean.class,
+ AddressControl.class,
replicationInvoker);
this.localAddressControl = localAddressControl;
@@ -112,7 +112,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(AddressControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(AddressControl.class),
info.getNotifications());
}
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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -23,11 +23,11 @@
package org.jboss.messaging.core.management.jmx.impl;
import org.jboss.messaging.core.config.Configuration;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ReplicationOperationInvoker;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
-import org.jboss.messaging.core.management.impl.MessagingServerControl;
+import org.jboss.messaging.core.management.impl.MessagingServerControlImpl;
import javax.management.MBeanInfo;
@@ -38,23 +38,23 @@
*
*/
public class ReplicationAwareMessagingServerControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- MessagingServerControlMBean
+ MessagingServerControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final MessagingServerControl localControl;
+ private final MessagingServerControlImpl localControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareMessagingServerControlWrapper(final MessagingServerControl localControl,
+ public ReplicationAwareMessagingServerControlWrapper(final MessagingServerControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.CORE_SERVER, MessagingServerControlMBean.class, replicationInvoker);
+ super(ResourceNames.CORE_SERVER, MessagingServerControl.class, replicationInvoker);
this.localControl = localControl;
}
@@ -406,7 +406,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(MessagingServerControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(MessagingServerControl.class),
localControl.getNotificationInfo());
}
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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareQueueControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -28,11 +28,11 @@
import javax.management.openmbean.CompositeData;
import javax.management.openmbean.TabularData;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
import org.jboss.messaging.core.management.ReplicationOperationInvoker;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
-import org.jboss.messaging.core.management.impl.QueueControl;
+import org.jboss.messaging.core.management.impl.QueueControlImpl;
/**
* A ReplicationAwareQueueControlWrapper
@@ -40,23 +40,23 @@
* @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
*
*/
-public class ReplicationAwareQueueControlWrapper extends ReplicationAwareStandardMBeanWrapper implements QueueControlMBean
+public class ReplicationAwareQueueControlWrapper extends ReplicationAwareStandardMBeanWrapper implements QueueControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final QueueControl localQueueControl;
+ private final QueueControlImpl localQueueControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareQueueControlWrapper(final QueueControl localControl,
+ public ReplicationAwareQueueControlWrapper(final QueueControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.CORE_QUEUE + localControl.getName(), QueueControlMBean.class, replicationInvoker);
+ super(ResourceNames.CORE_QUEUE + localControl.getName(), QueueControl.class, replicationInvoker);
this.localQueueControl = localControl;
}
@@ -258,7 +258,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(QueueControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(QueueControl.class),
info.getNotifications());
}
Modified: trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/messagecounter/MessageCounter.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -27,7 +27,7 @@
import java.util.GregorianCalendar;
import java.util.List;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
/**
* This class stores message count informations for a given queue
@@ -59,7 +59,7 @@
private boolean destDurable;
// destination queue
- private QueueControlMBean destQueue;
+ private QueueControl destQueue;
// counter
private long countTotal;
@@ -93,7 +93,7 @@
* @param durable durable subsciption flag
* @param daycountmax max message history day count
*/
- public MessageCounter(String name, String subscription, QueueControlMBean queue, boolean topic, boolean durable, int daycountmax)
+ public MessageCounter(String name, String subscription, QueueControl queue, boolean topic, boolean durable, int daycountmax)
{
// store destination related information
destName = name;
Modified: trunk/src/main/org/jboss/messaging/core/server/MessagingServer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/MessagingServer.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/server/MessagingServer.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -20,7 +20,7 @@
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.deployers.DeploymentManager;
import org.jboss.messaging.core.management.ManagementService;
-import org.jboss.messaging.core.management.impl.MessagingServerControl;
+import org.jboss.messaging.core.management.impl.MessagingServerControlImpl;
import org.jboss.messaging.core.persistence.StorageManager;
import org.jboss.messaging.core.postoffice.PostOffice;
import org.jboss.messaging.core.remoting.Channel;
@@ -62,7 +62,7 @@
Version getVersion();
- MessagingServerControl getMessagingServerControl();
+ MessagingServerControlImpl getMessagingServerControl();
void registerActivateCallback(ActivateCallback callback);
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -51,7 +51,7 @@
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.management.ManagementService;
import org.jboss.messaging.core.management.impl.ManagementServiceImpl;
-import org.jboss.messaging.core.management.impl.MessagingServerControl;
+import org.jboss.messaging.core.management.impl.MessagingServerControlImpl;
import org.jboss.messaging.core.paging.PagingManager;
import org.jboss.messaging.core.paging.impl.PagingManagerImpl;
import org.jboss.messaging.core.paging.impl.PagingStoreFactoryNIO;
@@ -163,7 +163,7 @@
private ResourceManager resourceManager;
- private MessagingServerControl messagingServerControl;
+ private MessagingServerControlImpl messagingServerControl;
private ClusterManager clusterManager;
@@ -615,7 +615,7 @@
}
}
- public MessagingServerControl getMessagingServerControl()
+ public MessagingServerControlImpl getMessagingServerControl()
{
return messagingServerControl;
}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:fox at redhat.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface ConnectionFactoryControl
+{
+ String getName();
+
+ List<String> getBindings();
+
+ String getClientID();
+
+ long getClientFailureCheckPeriod();
+
+ long getCallTimeout();
+
+ int getDupsOKBatchSize();
+
+ int getConsumerMaxRate();
+
+ int getConsumerWindowSize();
+
+ int getProducerMaxRate();
+
+ int getProducerWindowSize();
+
+ boolean isBlockOnAcknowledge();
+
+ boolean isBlockOnPersistentSend();
+
+ boolean isBlockOnNonPersistentSend();
+
+ boolean isPreAcknowledge();
+
+ long getConnectionTTL();
+
+ long getTransactionBatchSize();
+
+ long getMinLargeMessageSize();
+
+ boolean isAutoGroup();
+
+ int getMaxConnections();
+
+ long getRetryInterval();
+
+ double getRetryIntervalMultiplier();
+
+ int getReconnectAttempts();
+
+ boolean isFailoverOnNodeShutdown();
+}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,81 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:fox at redhat.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface ConnectionFactoryControlMBean
-{
- String getName();
-
- List<String> getBindings();
-
- String getClientID();
-
- long getClientFailureCheckPeriod();
-
- long getCallTimeout();
-
- int getDupsOKBatchSize();
-
- int getConsumerMaxRate();
-
- int getConsumerWindowSize();
-
- int getProducerMaxRate();
-
- int getProducerWindowSize();
-
- boolean isBlockOnAcknowledge();
-
- boolean isBlockOnPersistentSend();
-
- boolean isBlockOnNonPersistentSend();
-
- boolean isPreAcknowledge();
-
- long getConnectionTTL();
-
- long getTransactionBatchSize();
-
- long getMinLargeMessageSize();
-
- boolean isAutoGroup();
-
- int getMaxConnections();
-
- long getRetryInterval();
-
- double getRetryIntervalMultiplier();
-
- int getReconnectAttempts();
-
- boolean isFailoverOnNodeShutdown();
-}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSManagementService.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -37,7 +37,7 @@
*/
public interface JMSManagementService
{
- JMSServerControlMBean registerJMSServer(JMSServerManager server) throws Exception;
+ JMSServerControl registerJMSServer(JMSServerManager server) throws Exception;
void unregisterJMSServer() throws Exception;
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+import static javax.management.MBeanOperationInfo.INFO;
+
+import java.util.Map;
+
+import org.jboss.messaging.core.management.Operation;
+import org.jboss.messaging.core.management.Parameter;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface JMSQueueControl extends DestinationControlMBean
+{
+ // Attributes ----------------------------------------------------
+
+ String getName();
+
+ String getExpiryAddress();
+
+ void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue")
+ String expiryAddress) throws Exception;
+
+ String getDeadLetterAddress();
+
+ void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue")
+ String deadLetterAddress) throws Exception;
+
+ int getMessagesAdded();
+
+ boolean isTemporary();
+
+ boolean isDurable();
+
+ int getMessageCount();
+
+ long getScheduledCount();
+
+ int getConsumerCount();
+
+ int getDeliveringCount();
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "List all messages in the queue", impact = INFO)
+ Map<String, Object>[] listAllMessages() throws Exception;
+
+ @Operation(desc = "List all messages in the queue which matches the filter", impact = INFO)
+ Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = INFO)
+ int countMessages(@Parameter(name = "filter", desc = "A JMS message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
+ boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID")
+ String messageID) throws Exception;
+
+ @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = ACTION)
+ int removeMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = ACTION)
+ int expireMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter) throws Exception;
+
+ @Operation(desc = "Expire the message corresponding to the given messageID", impact = ACTION)
+ boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID")
+ String messageID) throws Exception;
+
+ @Operation(desc = "Send the message corresponding to the given messageID to the queue's Dead Letter Queue", impact = ACTION)
+ boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID")
+ String messageID) 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")
+ String messageID, @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)")
+ int newPriority) throws Exception;
+
+ @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = ACTION)
+ boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID")
+ String messageID, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to")
+ String otherQueueName) throws Exception;
+
+ @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = ACTION)
+ int moveMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
+ String filter, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
+ String otherQueueName) throws Exception;
+
+ @Operation(desc = "Move all the messages to another queue (and returns the number of moved messages)", impact = ACTION)
+ int moveAllMessages(@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
+ String otherQueueName) throws Exception;
+
+ String listMessageCounter() throws Exception;
+
+ String listMessageCounterAsHTML() throws Exception;
+
+ String listMessageCounterHistory() throws Exception;
+
+ String listMessageCounterHistoryAsHTML() throws Exception;
+
+}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSQueueControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,129 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-import static javax.management.MBeanOperationInfo.INFO;
-
-import java.util.Map;
-
-import org.jboss.messaging.core.management.Operation;
-import org.jboss.messaging.core.management.Parameter;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface JMSQueueControlMBean extends DestinationControlMBean
-{
- // Attributes ----------------------------------------------------
-
- String getName();
-
- String getExpiryAddress();
-
- void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue")
- String expiryAddress) throws Exception;
-
- String getDeadLetterAddress();
-
- void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue")
- String deadLetterAddress) throws Exception;
-
- int getMessagesAdded();
-
- boolean isTemporary();
-
- boolean isDurable();
-
- int getMessageCount();
-
- long getScheduledCount();
-
- int getConsumerCount();
-
- int getDeliveringCount();
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "List all messages in the queue", impact = INFO)
- Map<String, Object>[] listAllMessages() throws Exception;
-
- @Operation(desc = "List all messages in the queue which matches the filter", impact = INFO)
- Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = INFO)
- int countMessages(@Parameter(name = "filter", desc = "A JMS message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Remove the message corresponding to the given messageID", impact = ACTION)
- boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID")
- String messageID) throws Exception;
-
- @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = ACTION)
- int removeMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = ACTION)
- int expireMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter) throws Exception;
-
- @Operation(desc = "Expire the message corresponding to the given messageID", impact = ACTION)
- boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID")
- String messageID) throws Exception;
-
- @Operation(desc = "Send the message corresponding to the given messageID to the queue's Dead Letter Queue", impact = ACTION)
- boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID")
- String messageID) 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")
- String messageID, @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)")
- int newPriority) throws Exception;
-
- @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = ACTION)
- boolean moveMessage(@Parameter(name = "messageID", desc = "A message ID")
- String messageID, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the message to")
- String otherQueueName) throws Exception;
-
- @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = ACTION)
- int moveMatchingMessages(@Parameter(name = "filter", desc = "A message filter")
- String filter, @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
- String otherQueueName) throws Exception;
-
- @Operation(desc = "Move all the messages to another queue (and returns the number of moved messages)", impact = ACTION)
- int moveAllMessages(@Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to")
- String otherQueueName) throws Exception;
-
- String listMessageCounter() throws Exception;
-
- String listMessageCounterAsHTML() throws Exception;
-
- String listMessageCounterHistory() throws Exception;
-
- String listMessageCounterHistoryAsHTML() throws Exception;
-
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,200 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+import static javax.management.MBeanOperationInfo.INFO;
+
+import java.util.Map;
+
+import org.jboss.messaging.core.management.Operation;
+import org.jboss.messaging.core.management.Parameter;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface JMSServerControl
+{
+ // Attributes ----------------------------------------------------
+
+ boolean isStarted();
+
+ String getVersion();
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "Create a JMS Queue", impact = ACTION)
+ boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create")
+ String name, @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI")
+ String jndiBinding) throws Exception;
+
+ @Operation(desc = "Destroy a JMS Queue", impact = ACTION)
+ boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy")
+ String name) throws Exception;
+
+ @Operation(desc = "Create a JMS Topic", impact = ACTION)
+ boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create")
+ String name, @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI")
+ String jndiBinding) throws Exception;
+
+ @Operation(desc = "Destroy a JMS Topic", impact = ACTION)
+ boolean destroyTopic(@Parameter(name = "name", desc = "Name of the topic to destroy")
+ String name) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ Object[] bindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ Object[] liveConnectorsTransportClassNames,
+ Object[] liveConnectorTransportParams,
+ Object[] backupConnectorsTransportClassNames,
+ Object[] backupConnectorTransportParams,
+ String clientID,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ int maxConnections,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnPersistentSend,
+ boolean blockOnNonPersistentSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ Object[] bindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String discoveryAddress,
+ int discoveryPort,
+ String clientID,
+ long discoveryRefreshTimeout,
+ long clientFailureCheckPeriod,
+ long connectionTTL,
+ long callTimeout,
+ int maxConnections,
+ int minLargeMessageSize,
+ int consumerWindowSize,
+ int consumerMaxRate,
+ int producerWindowSize,
+ int producerMaxRate,
+ boolean blockOnAcknowledge,
+ boolean blockOnPersistentSend,
+ boolean blockOnNonPersistentSend,
+ boolean autoGroup,
+ boolean preAcknowledge,
+ String loadBalancingPolicyClassName,
+ int transactionBatchSize,
+ int dupsOKBatchSize,
+ long initialWaitTimeout,
+ boolean useGlobalPools,
+ int scheduledThreadPoolMaxSize,
+ int threadPoolMaxSize,
+ long retryInterval,
+ double retryIntervalMultiplier,
+ int reconnectAttempts,
+ boolean failoverOnServerShutdown,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String backupTransportClassName,
+ Map<String, Object> backupTransportParams,
+ Object[] jndiBindings) throws Exception;
+
+ void createConnectionFactory(String name,
+ String liveTransportClassName,
+ Map<String, Object> liveTransportParams,
+ String backupTransportClassName,
+ Map<String, Object> backupTransportParams,
+ String clientID,
+ Object[] jndiBindings) throws Exception;
+
+ @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
+ void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to create")
+ String name) throws Exception;
+
+ @Operation(desc = "List the client addresses", impact = INFO)
+ String[] listRemoteAddresses() throws Exception;
+
+ @Operation(desc = "List the client addresses which match the given IP Address", impact = INFO)
+ String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress")
+ String ipAddress) throws Exception;
+
+ @Operation(desc = "Closes all the connections for the given IP Address", impact = INFO)
+ boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress")
+ String ipAddress) throws Exception;
+
+ @Operation(desc = "List all the connection IDs", impact = INFO)
+ String[] listConnectionIDs() throws Exception;
+
+ @Operation(desc = "List the sessions for the given connectionID", impact = INFO)
+ String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID")
+ String connectionID) throws Exception;
+}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,200 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-import static javax.management.MBeanOperationInfo.INFO;
-
-import java.util.Map;
-
-import org.jboss.messaging.core.management.Operation;
-import org.jboss.messaging.core.management.Parameter;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface JMSServerControlMBean
-{
- // Attributes ----------------------------------------------------
-
- boolean isStarted();
-
- String getVersion();
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "Create a JMS Queue", impact = ACTION)
- boolean createQueue(@Parameter(name = "name", desc = "Name of the queue to create")
- String name, @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI")
- String jndiBinding) throws Exception;
-
- @Operation(desc = "Destroy a JMS Queue", impact = ACTION)
- boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy")
- String name) throws Exception;
-
- @Operation(desc = "Create a JMS Topic", impact = ACTION)
- boolean createTopic(@Parameter(name = "name", desc = "Name of the topic to create")
- String name, @Parameter(name = "jndiBinding", desc = "the name of the binding for JNDI")
- String jndiBinding) throws Exception;
-
- @Operation(desc = "Destroy a JMS Topic", impact = ACTION)
- boolean destroyTopic(@Parameter(name = "name", desc = "Name of the topic to destroy")
- String name) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- Object[] bindings) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- Object[] liveConnectorsTransportClassNames,
- Object[] liveConnectorTransportParams,
- Object[] backupConnectorsTransportClassNames,
- Object[] backupConnectorTransportParams,
- String clientID,
- long clientFailureCheckPeriod,
- long connectionTTL,
- long callTimeout,
- int maxConnections,
- int minLargeMessageSize,
- int consumerWindowSize,
- int consumerMaxRate,
- int producerWindowSize,
- int producerMaxRate,
- boolean blockOnAcknowledge,
- boolean blockOnPersistentSend,
- boolean blockOnNonPersistentSend,
- boolean autoGroup,
- boolean preAcknowledge,
- String loadBalancingPolicyClassName,
- int transactionBatchSize,
- int dupsOKBatchSize,
- boolean useGlobalPools,
- int scheduledThreadPoolMaxSize,
- int threadPoolMaxSize,
- long retryInterval,
- double retryIntervalMultiplier,
- int reconnectAttempts,
- boolean failoverOnServerShutdown,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String discoveryAddress,
- int discoveryPort,
- String clientID,
- Object[] bindings) throws Exception;
-
- void createConnectionFactory(String name,
- String discoveryAddress,
- int discoveryPort,
- String clientID,
- long discoveryRefreshTimeout,
- long clientFailureCheckPeriod,
- long connectionTTL,
- long callTimeout,
- int maxConnections,
- int minLargeMessageSize,
- int consumerWindowSize,
- int consumerMaxRate,
- int producerWindowSize,
- int producerMaxRate,
- boolean blockOnAcknowledge,
- boolean blockOnPersistentSend,
- boolean blockOnNonPersistentSend,
- boolean autoGroup,
- boolean preAcknowledge,
- String loadBalancingPolicyClassName,
- int transactionBatchSize,
- int dupsOKBatchSize,
- long initialWaitTimeout,
- boolean useGlobalPools,
- int scheduledThreadPoolMaxSize,
- int threadPoolMaxSize,
- long retryInterval,
- double retryIntervalMultiplier,
- int reconnectAttempts,
- boolean failoverOnServerShutdown,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String backupTransportClassName,
- Map<String, Object> backupTransportParams,
- Object[] jndiBindings) throws Exception;
-
- void createConnectionFactory(String name,
- String liveTransportClassName,
- Map<String, Object> liveTransportParams,
- String backupTransportClassName,
- Map<String, Object> backupTransportParams,
- String clientID,
- Object[] jndiBindings) throws Exception;
-
- @Operation(desc = "Create a JMS ConnectionFactory", impact = ACTION)
- void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to create")
- String name) throws Exception;
-
- @Operation(desc = "List the client addresses", impact = INFO)
- String[] listRemoteAddresses() throws Exception;
-
- @Operation(desc = "List the client addresses which match the given IP Address", impact = INFO)
- String[] listRemoteAddresses(@Parameter(desc = "an IP address", name = "ipAddress")
- String ipAddress) throws Exception;
-
- @Operation(desc = "Closes all the connections for the given IP Address", impact = INFO)
- boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress")
- String ipAddress) throws Exception;
-
- @Operation(desc = "List all the connection IDs", impact = INFO)
- String[] listConnectionIDs() throws Exception;
-
- @Operation(desc = "List the sessions for the given connectionID", impact = INFO)
- String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID")
- String connectionID) throws Exception;
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/TopicControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management;
+
+import static javax.management.MBeanOperationInfo.ACTION;
+
+import java.util.Map;
+
+import org.jboss.messaging.core.management.Operation;
+import org.jboss.messaging.core.management.Parameter;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public interface TopicControl extends DestinationControlMBean
+{
+ // Attributes ----------------------------------------------------
+
+ int getSubscriptionCount();
+
+ int getDurableSubscriptionCount();
+
+ int getNonDurableSubscriptionCount();
+
+ int getDurableMessageCount();
+
+ int getNonDurableMessageCount();
+
+ // Operations ----------------------------------------------------
+
+ @Operation(desc = "List all subscriptions")
+ Object[] listAllSubscriptions() throws Exception;
+
+ @Operation(desc = "List only the durable subscriptions")
+ Object[] listDurableSubscriptions() throws Exception;
+
+ @Operation(desc = "List only the non durable subscriptions")
+ Object[] listNonDurableSubscriptions() throws Exception;
+
+ @Operation(desc = "List all the message for the given subscription")
+ public Map<String, Object>[] listMessagesForSubscription(
+ @Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName)
+ throws Exception;
+
+ @Operation(desc = "Count the number of messages matching the filter for the given subscription")
+ public int countMessagesForSubscription(
+ @Parameter(name = "clientID", desc = "the client ID") String clientID,
+ @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName,
+ @Parameter(name = "filter", desc = "a JMS filter") String filter)
+ throws Exception;
+
+ @Operation(desc = "Drop a durable subscription", impact = ACTION)
+ void dropDurableSubscription(
+ @Parameter(name = "clientID", desc = "the client ID") String clientID,
+ @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName)
+ throws Exception;
+
+
+ @Operation(desc = "Drop all subscriptions from this topic", impact = ACTION)
+ void dropAllSubscriptions() throws Exception;
+}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/TopicControlMBean.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management;
-
-import static javax.management.MBeanOperationInfo.ACTION;
-
-import java.util.Map;
-
-import org.jboss.messaging.core.management.Operation;
-import org.jboss.messaging.core.management.Parameter;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public interface TopicControlMBean extends DestinationControlMBean
-{
- // Attributes ----------------------------------------------------
-
- int getSubscriptionCount();
-
- int getDurableSubscriptionCount();
-
- int getNonDurableSubscriptionCount();
-
- int getDurableMessageCount();
-
- int getNonDurableMessageCount();
-
- // Operations ----------------------------------------------------
-
- @Operation(desc = "List all subscriptions")
- Object[] listAllSubscriptions() throws Exception;
-
- @Operation(desc = "List only the durable subscriptions")
- Object[] listDurableSubscriptions() throws Exception;
-
- @Operation(desc = "List only the non durable subscriptions")
- Object[] listNonDurableSubscriptions() throws Exception;
-
- @Operation(desc = "List all the message for the given subscription")
- public Map<String, Object>[] listMessagesForSubscription(
- @Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName)
- throws Exception;
-
- @Operation(desc = "Count the number of messages matching the filter for the given subscription")
- public int countMessagesForSubscription(
- @Parameter(name = "clientID", desc = "the client ID") String clientID,
- @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName,
- @Parameter(name = "filter", desc = "a JMS filter") String filter)
- throws Exception;
-
- @Operation(desc = "Drop a durable subscription", impact = ACTION)
- void dropDurableSubscription(
- @Parameter(name = "clientID", desc = "the client ID") String clientID,
- @Parameter(name = "subscriptionName", desc = "the name of the durable subscription") String subscriptionName)
- throws Exception;
-
-
- @Operation(desc = "Drop all subscriptions from this topic", impact = ACTION)
- void dropAllSubscriptions() throws Exception;
-}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,189 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management.impl;
-
-import java.util.List;
-
-import javax.management.NotCompliantMBeanException;
-import javax.management.StandardMBean;
-
-import org.jboss.messaging.jms.client.JBossConnectionFactory;
-import org.jboss.messaging.jms.server.management.ConnectionFactoryControlMBean;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class ConnectionFactoryControl extends StandardMBean implements ConnectionFactoryControlMBean
-{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final JBossConnectionFactory cf;
-
- private final List<String> bindings;
-
- private final String name;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- public ConnectionFactoryControl(final JBossConnectionFactory cf, final String name, final List<String> bindings) throws NotCompliantMBeanException
- {
- super(ConnectionFactoryControlMBean.class);
- this.cf = cf;
- this.name = name;
- this.bindings = bindings;
- }
-
- // Public --------------------------------------------------------
-
- // ManagedConnectionFactoryMBean implementation ------------------
-
- public List<String> getBindings()
- {
- return bindings;
- }
-
- public String getClientID()
- {
- return cf.getClientID();
- }
-
- public long getClientFailureCheckPeriod()
- {
- return cf.getClientFailureCheckPeriod();
- }
-
- public long getCallTimeout()
- {
- return cf.getCallTimeout();
- }
-
- public int getConsumerMaxRate()
- {
- return cf.getConsumerMaxRate();
- }
-
- public int getConsumerWindowSize()
- {
- return cf.getConsumerWindowSize();
- }
-
- public int getProducerMaxRate()
- {
- return cf.getProducerMaxRate();
- }
-
- public int getProducerWindowSize()
- {
- return cf.getProducerWindowSize();
- }
-
- public int getDupsOKBatchSize()
- {
- return cf.getDupsOKBatchSize();
- }
-
- public boolean isBlockOnAcknowledge()
- {
- return cf.isBlockOnAcknowledge();
- }
-
- public boolean isBlockOnNonPersistentSend()
- {
- return cf.isBlockOnNonPersistentSend();
- }
-
- public boolean isBlockOnPersistentSend()
- {
- return cf.isBlockOnPersistentSend();
- }
-
- public boolean isPreAcknowledge()
- {
- return cf.isPreAcknowledge();
- }
-
- public String getName()
- {
- return name;
- }
-
- public long getConnectionTTL()
- {
- return cf.getConnectionTTL();
- }
-
- public int getMaxConnections()
- {
- return cf.getMaxConnections();
- }
-
- public int getReconnectAttempts()
- {
- return cf.getReconnectAttempts();
- }
-
- public boolean isFailoverOnNodeShutdown()
- {
- return cf.isFailoverOnServerShutdown();
- }
-
- public long getMinLargeMessageSize()
- {
- return cf.getMinLargeMessageSize();
- }
-
- public long getRetryInterval()
- {
- return cf.getRetryInterval();
- }
-
- public double getRetryIntervalMultiplier()
- {
- return cf.getRetryIntervalMultiplier();
- }
-
- public long getTransactionBatchSize()
- {
- return cf.getTransactionBatchSize();
- }
-
- public boolean isAutoGroup()
- {
- return cf.isAutoGroup();
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,187 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management.impl;
+
+import java.util.List;
+
+import javax.management.NotCompliantMBeanException;
+
+import org.jboss.messaging.jms.client.JBossConnectionFactory;
+import org.jboss.messaging.jms.server.management.ConnectionFactoryControl;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class ConnectionFactoryControlImpl implements ConnectionFactoryControl
+{
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final JBossConnectionFactory cf;
+
+ private final List<String> bindings;
+
+ private final String name;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ConnectionFactoryControlImpl(final JBossConnectionFactory cf, final String name, final List<String> bindings) throws NotCompliantMBeanException
+ {
+ this.cf = cf;
+ this.name = name;
+ this.bindings = bindings;
+ }
+
+ // Public --------------------------------------------------------
+
+ // ManagedConnectionFactoryMBean implementation ------------------
+
+ public List<String> getBindings()
+ {
+ return bindings;
+ }
+
+ public String getClientID()
+ {
+ return cf.getClientID();
+ }
+
+ public long getClientFailureCheckPeriod()
+ {
+ return cf.getClientFailureCheckPeriod();
+ }
+
+ public long getCallTimeout()
+ {
+ return cf.getCallTimeout();
+ }
+
+ public int getConsumerMaxRate()
+ {
+ return cf.getConsumerMaxRate();
+ }
+
+ public int getConsumerWindowSize()
+ {
+ return cf.getConsumerWindowSize();
+ }
+
+ public int getProducerMaxRate()
+ {
+ return cf.getProducerMaxRate();
+ }
+
+ public int getProducerWindowSize()
+ {
+ return cf.getProducerWindowSize();
+ }
+
+ public int getDupsOKBatchSize()
+ {
+ return cf.getDupsOKBatchSize();
+ }
+
+ public boolean isBlockOnAcknowledge()
+ {
+ return cf.isBlockOnAcknowledge();
+ }
+
+ public boolean isBlockOnNonPersistentSend()
+ {
+ return cf.isBlockOnNonPersistentSend();
+ }
+
+ public boolean isBlockOnPersistentSend()
+ {
+ return cf.isBlockOnPersistentSend();
+ }
+
+ public boolean isPreAcknowledge()
+ {
+ return cf.isPreAcknowledge();
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public long getConnectionTTL()
+ {
+ return cf.getConnectionTTL();
+ }
+
+ public int getMaxConnections()
+ {
+ return cf.getMaxConnections();
+ }
+
+ public int getReconnectAttempts()
+ {
+ return cf.getReconnectAttempts();
+ }
+
+ public boolean isFailoverOnNodeShutdown()
+ {
+ return cf.isFailoverOnServerShutdown();
+ }
+
+ public long getMinLargeMessageSize()
+ {
+ return cf.getMinLargeMessageSize();
+ }
+
+ public long getRetryInterval()
+ {
+ return cf.getRetryInterval();
+ }
+
+ public double getRetryIntervalMultiplier()
+ {
+ return cf.getRetryIntervalMultiplier();
+ }
+
+ public long getTransactionBatchSize()
+ {
+ return cf.getTransactionBatchSize();
+ }
+
+ public boolean isAutoGroup()
+ {
+ return cf.isAutoGroup();
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSManagementServiceImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -27,10 +27,10 @@
import javax.management.ObjectName;
-import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.AddressControl;
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.QueueControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.messagecounter.MessageCounter;
import org.jboss.messaging.core.messagecounter.MessageCounterManager;
@@ -39,7 +39,7 @@
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.management.JMSManagementService;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
import org.jboss.messaging.jms.server.management.jmx.impl.ReplicationAwareConnectionFactoryControlWrapper;
import org.jboss.messaging.jms.server.management.jmx.impl.ReplicationAwareJMSQueueControlWrapper;
import org.jboss.messaging.jms.server.management.jmx.impl.ReplicationAwareJMSServerControlWrapper;
@@ -70,11 +70,11 @@
// JMSManagementRegistration implementation ----------------------
- public synchronized JMSServerControlMBean registerJMSServer(final JMSServerManager server) throws Exception
+ public synchronized JMSServerControl registerJMSServer(final JMSServerManager server) throws Exception
{
ObjectName objectName = ObjectNames.getJMSServerObjectName();
- JMSServerControl control = new JMSServerControl(server);
- JMSServerControlMBean replicatingProxy = new ReplicationAwareJMSServerControlWrapper(control,
+ JMSServerControlImpl control = new JMSServerControlImpl(server);
+ JMSServerControl replicatingProxy = new ReplicationAwareJMSServerControlWrapper(control,
managementService.getReplicationOperationInvoker());
managementService.registerInJMX(objectName,
replicatingProxy);
@@ -92,7 +92,7 @@
public synchronized void registerQueue(final JBossQueue queue,
final String jndiBinding) throws Exception
{
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue.getAddress());
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue.getAddress());
MessageCounterManager messageCounterManager = managementService.getMessageCounterManager();
MessageCounter counter = new MessageCounter(queue.getName(),
null,
@@ -102,7 +102,7 @@
messageCounterManager.getMaxDayCount());
messageCounterManager.registerMessageCounter(queue.getName(), counter);
ObjectName objectName = ObjectNames.getJMSQueueObjectName(queue.getQueueName());
- JMSQueueControl control = new JMSQueueControl(queue,
+ JMSQueueControlImpl control = new JMSQueueControlImpl(queue,
coreQueueControl,
jndiBinding,
counter);
@@ -123,8 +123,8 @@
final String jndiBinding) throws Exception
{
ObjectName objectName = ObjectNames.getJMSTopicObjectName(topic.getTopicName());
- AddressControlMBean addressControl = (AddressControlMBean)managementService.getResource(ResourceNames.CORE_ADDRESS + topic.getAddress());
- TopicControl control = new TopicControl(topic, addressControl, jndiBinding, managementService);
+ AddressControl addressControl = (AddressControl)managementService.getResource(ResourceNames.CORE_ADDRESS + topic.getAddress());
+ TopicControlImpl control = new TopicControlImpl(topic, addressControl, jndiBinding, managementService);
managementService.registerInJMX(objectName, new ReplicationAwareTopicControlWrapper(control,
managementService.getReplicationOperationInvoker()));
managementService.registerInRegistry(ResourceNames.JMS_TOPIC + topic.getTopicName(), control);
@@ -142,7 +142,7 @@
final List<String> bindings) throws Exception
{
ObjectName objectName = ObjectNames.getConnectionFactoryObjectName(name);
- ConnectionFactoryControl control = new ConnectionFactoryControl(connectionFactory, name, bindings);
+ ConnectionFactoryControlImpl control = new ConnectionFactoryControlImpl(connectionFactory, name, bindings);
managementService.registerInJMX(objectName,
new ReplicationAwareConnectionFactoryControlWrapper(control,
managementService.getReplicationOperationInvoker()));
Deleted: 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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,315 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management.impl;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.MessageCounterInfo;
-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.jms.JBossQueue;
-import org.jboss.messaging.jms.client.JBossMessage;
-import org.jboss.messaging.jms.client.SelectorTranslator;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSQueueControl implements JMSQueueControlMBean
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(JMSQueueControl.class);
-
- // Attributes ----------------------------------------------------
-
- private final JBossQueue managedQueue;
-
- private final QueueControlMBean coreQueueControl;
-
- private final String binding;
-
- private final MessageCounter counter;
-
- // Static --------------------------------------------------------
-
- public static String createFilterFromJMSSelector(final String selectorStr) throws MessagingException
- {
- return (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
- }
-
- private static String createFilterForJMSMessageID(String jmsMessageID) throws Exception
- {
- return JBossMessage.JBM_MESSAGE_ID + " = '" + jmsMessageID + "'";
- }
-
- // Constructors --------------------------------------------------
-
- public JMSQueueControl(final JBossQueue managedQueue,
- final QueueControlMBean coreQueueControl,
- final String jndiBinding,
- final MessageCounter counter)
- {
- this.managedQueue = managedQueue;
- this.coreQueueControl = coreQueueControl;
- this.binding = jndiBinding;
- this.counter = counter;
- }
-
- // Public --------------------------------------------------------
-
- // ManagedJMSQueueMBean implementation ---------------------------
-
- public String getName()
- {
- return managedQueue.getName();
- }
-
- public String getAddress()
- {
- return managedQueue.getAddress();
- }
-
- public boolean isTemporary()
- {
- return managedQueue.isTemporary();
- }
-
- public int getMessageCount()
- {
- return coreQueueControl.getMessageCount();
- }
-
- public int getMessagesAdded()
- {
- return coreQueueControl.getMessagesAdded();
- }
-
- public int getConsumerCount()
- {
- return coreQueueControl.getConsumerCount();
- }
-
- public int getDeliveringCount()
- {
- return coreQueueControl.getDeliveringCount();
- }
-
- public long getScheduledCount()
- {
- return coreQueueControl.getScheduledCount();
- }
-
- public boolean isDurable()
- {
- return coreQueueControl.isDurable();
- }
-
- public String getJNDIBinding()
- {
- return binding;
- }
-
- public String getDeadLetterAddress()
- {
- return coreQueueControl.getDeadLetterAddress();
- }
-
- public void setDeadLetterAddress(String deadLetterAddress) throws Exception
- {
- coreQueueControl.setDeadLetterAddress(deadLetterAddress);
- }
-
- public String getExpiryAddress()
- {
- return coreQueueControl.getExpiryAddress();
- }
-
- public void setExpiryAddress(String expiryAddres) throws Exception
- {
- coreQueueControl.setExpiryAddress(expiryAddres);
- }
-
- public boolean removeMessage(final String messageID) throws Exception
- {
- String filter = createFilterForJMSMessageID(messageID);
- int removed = coreQueueControl.removeMatchingMessages(filter);
- if (removed != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int removeMatchingMessages(String filterStr) throws Exception
- {
- String filter = createFilterFromJMSSelector(filterStr);
- return coreQueueControl.removeMatchingMessages(filter);
- }
-
- public int removeAllMessages() throws Exception
- {
- return coreQueueControl.removeAllMessages();
- }
-
- public Map<String, Object>[] listAllMessages() throws Exception
- {
- return listMessages(null);
- }
-
- public Map<String, Object>[] listMessages(final String filterStr) throws Exception
- {
- try
- {
- String filter = createFilterFromJMSSelector(filterStr);
- Map<String, Object>[] coreMessages = coreQueueControl.listMessages(filter);
-
- Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
-
- int i = 0;
-
- for (Map<String, Object> coreMessage : coreMessages)
- {
- Map<String, Object> jmsMessage = JBossMessage.coreMaptoJMSMap(coreMessage);
- jmsMessages[i++] = jmsMessage;
- }
- return jmsMessages;
- }
- catch (MessagingException e)
- {
- throw new IllegalStateException(e.getMessage());
- }
- }
-
- public int countMessages(final String filterStr) throws Exception
- {
- String filter = createFilterFromJMSSelector(filterStr);
- return coreQueueControl.countMessages(filter);
- }
-
- public boolean expireMessage(final String messageID) throws Exception
- {
- String filter = createFilterForJMSMessageID(messageID);
- int expired = coreQueueControl.expireMessages(filter);
- if (expired != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public int expireMessages(final String filterStr) throws Exception
- {
- String filter = createFilterFromJMSSelector(filterStr);
- return coreQueueControl.expireMessages(filter);
- }
-
- public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
- {
- String filter = createFilterForJMSMessageID(messageID);
- int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
- if (dead != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
- {
- String filter = createFilterForJMSMessageID(messageID);
- int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
- if (changed != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
- return true;
- }
-
- public boolean moveMessage(String messageID, String otherQueueName) throws Exception
- {
- String filter = createFilterForJMSMessageID(messageID);
- JBossQueue otherQueue = new JBossQueue(otherQueueName);
- int moved = coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
- if (moved != 1)
- {
- throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
- }
-
- return true;
- }
-
- public int moveMatchingMessages(String filterStr, String otherQueueName) throws Exception
- {
- String filter = createFilterFromJMSSelector(filterStr);
- JBossQueue otherQueue = new JBossQueue(otherQueueName);
- return coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
- }
-
- public int moveAllMessages(String otherQueueName) throws Exception
- {
- return moveMatchingMessages(null, otherQueueName);
- }
-
- public String listMessageCounter()
- {
- try
- {
- return MessageCounterInfo.toJSon(counter);
- }
- catch (Exception e)
- {
- throw new IllegalStateException(e);
- }
- }
-
- public String listMessageCounterAsHTML()
- {
- return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
- }
-
- public String listMessageCounterHistory() throws Exception
- {
- return MessageCounterHelper.listMessageCounterHistory(counter);
- }
-
- public String listMessageCounterHistoryAsHTML()
- {
- return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSQueueControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,314 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management.impl;
+
+import java.util.Map;
+
+import org.jboss.messaging.core.exception.MessagingException;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.management.MessageCounterInfo;
+import org.jboss.messaging.core.management.QueueControl;
+import org.jboss.messaging.core.messagecounter.MessageCounter;
+import org.jboss.messaging.core.messagecounter.impl.MessageCounterHelper;
+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.JMSQueueControl;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSQueueControlImpl implements JMSQueueControl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(JMSQueueControlImpl.class);
+
+ // Attributes ----------------------------------------------------
+
+ private final JBossQueue managedQueue;
+
+ private final QueueControl coreQueueControl;
+
+ private final String binding;
+
+ private final MessageCounter counter;
+
+ // Static --------------------------------------------------------
+
+ public static String createFilterFromJMSSelector(final String selectorStr) throws MessagingException
+ {
+ return (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
+ }
+
+ private static String createFilterForJMSMessageID(String jmsMessageID) throws Exception
+ {
+ return JBossMessage.JBM_MESSAGE_ID + " = '" + jmsMessageID + "'";
+ }
+
+ // Constructors --------------------------------------------------
+
+ public JMSQueueControlImpl(final JBossQueue managedQueue,
+ final QueueControl coreQueueControl,
+ final String jndiBinding,
+ final MessageCounter counter)
+ {
+ this.managedQueue = managedQueue;
+ this.coreQueueControl = coreQueueControl;
+ this.binding = jndiBinding;
+ this.counter = counter;
+ }
+
+ // Public --------------------------------------------------------
+
+ // ManagedJMSQueueMBean implementation ---------------------------
+
+ public String getName()
+ {
+ return managedQueue.getName();
+ }
+
+ public String getAddress()
+ {
+ return managedQueue.getAddress();
+ }
+
+ public boolean isTemporary()
+ {
+ return managedQueue.isTemporary();
+ }
+
+ public int getMessageCount()
+ {
+ return coreQueueControl.getMessageCount();
+ }
+
+ public int getMessagesAdded()
+ {
+ return coreQueueControl.getMessagesAdded();
+ }
+
+ public int getConsumerCount()
+ {
+ return coreQueueControl.getConsumerCount();
+ }
+
+ public int getDeliveringCount()
+ {
+ return coreQueueControl.getDeliveringCount();
+ }
+
+ public long getScheduledCount()
+ {
+ return coreQueueControl.getScheduledCount();
+ }
+
+ public boolean isDurable()
+ {
+ return coreQueueControl.isDurable();
+ }
+
+ public String getJNDIBinding()
+ {
+ return binding;
+ }
+
+ public String getDeadLetterAddress()
+ {
+ return coreQueueControl.getDeadLetterAddress();
+ }
+
+ public void setDeadLetterAddress(String deadLetterAddress) throws Exception
+ {
+ coreQueueControl.setDeadLetterAddress(deadLetterAddress);
+ }
+
+ public String getExpiryAddress()
+ {
+ return coreQueueControl.getExpiryAddress();
+ }
+
+ public void setExpiryAddress(String expiryAddres) throws Exception
+ {
+ coreQueueControl.setExpiryAddress(expiryAddres);
+ }
+
+ public boolean removeMessage(final String messageID) throws Exception
+ {
+ String filter = createFilterForJMSMessageID(messageID);
+ int removed = coreQueueControl.removeMatchingMessages(filter);
+ if (removed != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int removeMatchingMessages(String filterStr) throws Exception
+ {
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.removeMatchingMessages(filter);
+ }
+
+ public int removeAllMessages() throws Exception
+ {
+ return coreQueueControl.removeAllMessages();
+ }
+
+ public Map<String, Object>[] listAllMessages() throws Exception
+ {
+ return listMessages(null);
+ }
+
+ public Map<String, Object>[] listMessages(final String filterStr) throws Exception
+ {
+ try
+ {
+ String filter = createFilterFromJMSSelector(filterStr);
+ Map<String, Object>[] coreMessages = coreQueueControl.listMessages(filter);
+
+ Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
+
+ int i = 0;
+
+ for (Map<String, Object> coreMessage : coreMessages)
+ {
+ Map<String, Object> jmsMessage = JBossMessage.coreMaptoJMSMap(coreMessage);
+ jmsMessages[i++] = jmsMessage;
+ }
+ return jmsMessages;
+ }
+ catch (MessagingException e)
+ {
+ throw new IllegalStateException(e.getMessage());
+ }
+ }
+
+ public int countMessages(final String filterStr) throws Exception
+ {
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.countMessages(filter);
+ }
+
+ public boolean expireMessage(final String messageID) throws Exception
+ {
+ String filter = createFilterForJMSMessageID(messageID);
+ int expired = coreQueueControl.expireMessages(filter);
+ if (expired != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public int expireMessages(final String filterStr) throws Exception
+ {
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.expireMessages(filter);
+ }
+
+ public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
+ {
+ String filter = createFilterForJMSMessageID(messageID);
+ int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+ if (dead != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
+ {
+ String filter = createFilterForJMSMessageID(messageID);
+ int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
+ if (changed != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+ return true;
+ }
+
+ public boolean moveMessage(String messageID, String otherQueueName) throws Exception
+ {
+ String filter = createFilterForJMSMessageID(messageID);
+ JBossQueue otherQueue = new JBossQueue(otherQueueName);
+ int moved = coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
+ if (moved != 1)
+ {
+ throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+ }
+
+ return true;
+ }
+
+ public int moveMatchingMessages(String filterStr, String otherQueueName) throws Exception
+ {
+ String filter = createFilterFromJMSSelector(filterStr);
+ JBossQueue otherQueue = new JBossQueue(otherQueueName);
+ return coreQueueControl.moveMatchingMessages(filter, otherQueue.getAddress());
+ }
+
+ public int moveAllMessages(String otherQueueName) throws Exception
+ {
+ return moveMatchingMessages(null, otherQueueName);
+ }
+
+ public String listMessageCounter()
+ {
+ try
+ {
+ return MessageCounterInfo.toJSon(counter);
+ }
+ catch (Exception e)
+ {
+ throw new IllegalStateException(e);
+ }
+ }
+
+ public String listMessageCounterAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterAsHTML(new MessageCounter[] { counter });
+ }
+
+ public String listMessageCounterHistory() throws Exception
+ {
+ return MessageCounterHelper.listMessageCounterHistory(counter);
+ }
+
+ public String listMessageCounterHistoryAsHTML()
+ {
+ return MessageCounterHelper.listMessageCounterHistoryAsHTML(new MessageCounter[] { counter });
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ // Inner classes -------------------------------------------------
+}
Deleted: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,549 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management.impl;
-
-import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
-import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
-import org.jboss.messaging.utils.Pair;
-
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanNotificationInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.Notification;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.NotificationEmitter;
-import javax.management.NotificationFilter;
-import javax.management.NotificationListener;
-import javax.management.StandardMBean;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSServerControl extends StandardMBean implements JMSServerControlMBean, NotificationEmitter
-{
-
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
- private final JMSServerManager server;
-
- private final NotificationBroadcasterSupport broadcaster;
-
- private final AtomicLong notifSeq = new AtomicLong(0);
-
- // Static --------------------------------------------------------
-
- private static List<String> convert(Object[] jndiBindings)
- {
- List<String> bindings = new ArrayList<String>();
- for (Object object : jndiBindings)
- {
- bindings.add(object.toString());
- }
- return bindings;
- }
-
- // Constructors --------------------------------------------------
-
- public JMSServerControl(final JMSServerManager server) throws NotCompliantMBeanException
- {
- super(JMSServerControlMBean.class);
- this.server = server;
- broadcaster = new NotificationBroadcasterSupport();
- }
-
- // Public --------------------------------------------------------
-
- // JMSServerControlMBean implementation --------------------------
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, pairs, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- private List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams)
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
-
- for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
- {
- Map<String, Object>[] liveParams = new Map[liveConnectorTransportParams.length];
- for (int j = 0; j < liveConnectorTransportParams.length; j++)
- {
- liveParams[i] = (Map<String, Object>)liveConnectorTransportParams[j];
- }
-
- TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
- liveParams[i]);
-
- Map<String, Object>[] backupParams = new Map[backupConnectorTransportParams.length];
- for (int j = 0; j < backupConnectorTransportParams.length; j++)
- {
- backupParams[i] = (Map<String, Object>)backupConnectorTransportParams[j];
- }
-
- TransportConfiguration tcBackup = new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(),
- backupParams[i]);
- Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
- tcBackup);
-
- pairs.add(pair);
- }
-
- return pairs;
- }
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final Object[] liveConnectorsTransportClassNames,
- final Object[] liveConnectorTransportParams,
- final Object[] backupConnectorsTransportClassNames,
- final Object[] backupConnectorTransportParams,
- final String clientID,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final int maxConnections,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnPersistentSend,
- final boolean blockOnNonPersistentSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final Object[] jndiBindings) throws Exception
- {
- List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
- liveConnectorTransportParams,
- backupConnectorsTransportClassNames,
- backupConnectorTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name,
- pairs,
- clientID,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- maxConnections,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnPersistentSend,
- blockOnNonPersistentSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- reconnectAttempts,
- failoverOnServerShutdown,
- jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String discoveryAddress,
- final int discoveryPort,
- final String clientID,
- final long discoveryRefreshTimeout,
- final long clientFailureCheckPeriod,
- final long connectionTTL,
- final long callTimeout,
- final int maxConnections,
- final int minLargeMessageSize,
- final int consumerWindowSize,
- final int consumerMaxRate,
- final int producerWindowSize,
- final int producerMaxRate,
- final boolean blockOnAcknowledge,
- final boolean blockOnPersistentSend,
- final boolean blockOnNonPersistentSend,
- final boolean autoGroup,
- final boolean preAcknowledge,
- final String loadBalancingPolicyClassName,
- final int transactionBatchSize,
- final int dupsOKBatchSize,
- final long initialWaitTimeout,
- final boolean useGlobalPools,
- final int scheduledThreadPoolMaxSize,
- final int threadPoolMaxSize,
- final long retryInterval,
- final double retryIntervalMultiplier,
- final int reconnectAttempts,
- final boolean failoverOnServerShutdown,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name,
- discoveryAddress,
- discoveryPort,
- clientID,
- discoveryRefreshTimeout,
- clientFailureCheckPeriod,
- connectionTTL,
- callTimeout,
- maxConnections,
- minLargeMessageSize,
- consumerWindowSize,
- consumerMaxRate,
- producerWindowSize,
- producerMaxRate,
- blockOnAcknowledge,
- blockOnPersistentSend,
- blockOnNonPersistentSend,
- autoGroup,
- preAcknowledge,
- loadBalancingPolicyClassName,
- transactionBatchSize,
- dupsOKBatchSize,
- initialWaitTimeout,
- useGlobalPools,
- scheduledThreadPoolMaxSize,
- threadPoolMaxSize,
- retryInterval,
- retryIntervalMultiplier,
- reconnectAttempts,
- failoverOnServerShutdown,
- jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final Object[] jndiBindings) throws Exception
- {
-
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, liveTC, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- List<String> jndiBindingsList = convert(jndiBindings);
-
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- server.createConnectionFactory(name, liveTC, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String backupTransportClassName,
- final Map<String, Object> backupTransportParams,
- final Object[] jndiBindings) throws Exception
- {
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, liveTC, backupTC, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public void createConnectionFactory(final String name,
- final String liveTransportClassName,
- final Map<String, Object> liveTransportParams,
- final String backupTransportClassName,
- final Map<String, Object> backupTransportParams,
- final String clientID,
- final Object[] jndiBindings) throws Exception
- {
- TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
- TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
-
- List<String> jndiBindingsList = convert(jndiBindings);
-
- server.createConnectionFactory(name, liveTC, backupTC, clientID, jndiBindingsList);
-
- sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
- }
-
- public boolean createQueue(final String name, final String jndiBinding) throws Exception
- {
- boolean created = server.createQueue(name, jndiBinding, null, true);
- if (created)
- {
- sendNotification(NotificationType.QUEUE_CREATED, name);
- }
- return created;
- }
-
- public boolean destroyQueue(final String name) throws Exception
- {
- boolean destroyed = server.destroyQueue(name);
- if (destroyed)
- {
- sendNotification(NotificationType.QUEUE_DESTROYED, name);
- }
- return destroyed;
- }
-
- public boolean createTopic(final String topicName, final String jndiBinding) throws Exception
- {
- boolean created = server.createTopic(topicName, jndiBinding);
- if (created)
- {
- sendNotification(NotificationType.TOPIC_CREATED, topicName);
- }
- return created;
- }
-
- public boolean destroyTopic(final String name) throws Exception
- {
- boolean destroyed = server.destroyTopic(name);
- if (destroyed)
- {
- sendNotification(NotificationType.TOPIC_DESTROYED, name);
- }
- return destroyed;
- }
-
- public void destroyConnectionFactory(final String name) throws Exception
- {
- boolean destroyed = server.destroyConnectionFactory(name);
- if (destroyed)
- {
- sendNotification(NotificationType.CONNECTION_FACTORY_DESTROYED, name);
- }
- }
-
- public boolean isStarted()
- {
- return server.isStarted();
- }
-
- public String getVersion()
- {
- return server.getVersion();
- }
-
- // NotificationEmitter implementation ----------------------------
-
- public void removeNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener, filter, handback);
- }
-
- public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
- {
- broadcaster.removeNotificationListener(listener);
- }
-
- public void addNotificationListener(final NotificationListener listener,
- final NotificationFilter filter,
- final Object handback) throws IllegalArgumentException
- {
- broadcaster.addNotificationListener(listener, filter, handback);
- }
-
- public MBeanNotificationInfo[] getNotificationInfo()
- {
- NotificationType[] values = NotificationType.values();
- String[] names = new String[values.length];
- for (int i = 0; i < values.length; i++)
- {
- names[i] = values[i].toString();
- }
- return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
- this.getClass().getName(),
- "Notifications emitted by a JMS Server") };
- }
-
- public String[] listRemoteAddresses() throws Exception
- {
- return server.listRemoteAddresses();
- }
-
- public String[] listRemoteAddresses(final String ipAddress) throws Exception
- {
- return server.listRemoteAddresses(ipAddress);
- }
-
- public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
- {
- return server.closeConnectionsForAddress(ipAddress);
- }
-
- public String[] listConnectionIDs() throws Exception
- {
- return server.listConnectionIDs();
- }
-
- public String[] listSessions(final String connectionID) throws Exception
- {
- return server.listSessions(connectionID);
- }
-
- // StandardMBean overrides
- // ---------------------------------------------------
-
- /*
- * overrides getMBeanInfo to add operations info using annotations
- *
- * @see Operation
- *
- * @see Parameter
- */
- @Override
- public MBeanInfo getMBeanInfo()
- {
- MBeanInfo info = super.getMBeanInfo();
- return new MBeanInfo(info.getClassName(),
- info.getDescription(),
- info.getAttributes(),
- info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControlMBean.class),
- getNotificationInfo());
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private void sendNotification(final NotificationType type, final String message)
- {
- Notification notif = new Notification(type.toString(), this, notifSeq.incrementAndGet(), message);
- broadcaster.sendNotification(notif);
- }
-
- // Inner classes -------------------------------------------------
-
- public static enum NotificationType
- {
- QUEUE_CREATED,
- QUEUE_DESTROYED,
- TOPIC_CREATED,
- TOPIC_DESTROYED,
- CONNECTION_FACTORY_CREATED,
- CONNECTION_FACTORY_DESTROYED;
- }
-
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,523 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.management.ListenerNotFoundException;
+import javax.management.MBeanNotificationInfo;
+import javax.management.Notification;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.NotificationEmitter;
+import javax.management.NotificationFilter;
+import javax.management.NotificationListener;
+
+import org.jboss.messaging.core.config.TransportConfiguration;
+import org.jboss.messaging.jms.server.JMSServerManager;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
+import org.jboss.messaging.utils.Pair;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class JMSServerControlImpl implements JMSServerControl, NotificationEmitter
+{
+
+ // Constants -----------------------------------------------------
+
+ // Attributes ----------------------------------------------------
+
+ private final JMSServerManager server;
+
+ private final NotificationBroadcasterSupport broadcaster;
+
+ private final AtomicLong notifSeq = new AtomicLong(0);
+
+ // Static --------------------------------------------------------
+
+ private static List<String> convert(Object[] jndiBindings)
+ {
+ List<String> bindings = new ArrayList<String>();
+ for (Object object : jndiBindings)
+ {
+ bindings.add(object.toString());
+ }
+ return bindings;
+ }
+
+ // Constructors --------------------------------------------------
+
+ public JMSServerControlImpl(final JMSServerManager server)
+ {
+ this.server = server;
+ broadcaster = new NotificationBroadcasterSupport();
+ }
+
+ // Public --------------------------------------------------------
+
+ // JMSServerControlMBean implementation --------------------------
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, pairs, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ private List<Pair<TransportConfiguration, TransportConfiguration>> convertToConnectorPairs(final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams)
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = new ArrayList<Pair<TransportConfiguration, TransportConfiguration>>();
+
+ for (int i = 0; i < liveConnectorsTransportClassNames.length; i++)
+ {
+ Map<String, Object>[] liveParams = new Map[liveConnectorTransportParams.length];
+ for (int j = 0; j < liveConnectorTransportParams.length; j++)
+ {
+ liveParams[i] = (Map<String, Object>)liveConnectorTransportParams[j];
+ }
+
+ TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
+ liveParams[i]);
+
+ Map<String, Object>[] backupParams = new Map[backupConnectorTransportParams.length];
+ for (int j = 0; j < backupConnectorTransportParams.length; j++)
+ {
+ backupParams[i] = (Map<String, Object>)backupConnectorTransportParams[j];
+ }
+
+ TransportConfiguration tcBackup = new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(),
+ backupParams[i]);
+ Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
+ tcBackup);
+
+ pairs.add(pair);
+ }
+
+ return pairs;
+ }
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final Object[] liveConnectorsTransportClassNames,
+ final Object[] liveConnectorTransportParams,
+ final Object[] backupConnectorsTransportClassNames,
+ final Object[] backupConnectorTransportParams,
+ final String clientID,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<Pair<TransportConfiguration, TransportConfiguration>> pairs = convertToConnectorPairs(liveConnectorsTransportClassNames,
+ liveConnectorTransportParams,
+ backupConnectorsTransportClassNames,
+ backupConnectorTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name,
+ pairs,
+ clientID,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String discoveryAddress,
+ final int discoveryPort,
+ final String clientID,
+ final long discoveryRefreshTimeout,
+ final long clientFailureCheckPeriod,
+ final long connectionTTL,
+ final long callTimeout,
+ final int maxConnections,
+ final int minLargeMessageSize,
+ final int consumerWindowSize,
+ final int consumerMaxRate,
+ final int producerWindowSize,
+ final int producerMaxRate,
+ final boolean blockOnAcknowledge,
+ final boolean blockOnPersistentSend,
+ final boolean blockOnNonPersistentSend,
+ final boolean autoGroup,
+ final boolean preAcknowledge,
+ final String loadBalancingPolicyClassName,
+ final int transactionBatchSize,
+ final int dupsOKBatchSize,
+ final long initialWaitTimeout,
+ final boolean useGlobalPools,
+ final int scheduledThreadPoolMaxSize,
+ final int threadPoolMaxSize,
+ final long retryInterval,
+ final double retryIntervalMultiplier,
+ final int reconnectAttempts,
+ final boolean failoverOnServerShutdown,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name,
+ discoveryAddress,
+ discoveryPort,
+ clientID,
+ discoveryRefreshTimeout,
+ clientFailureCheckPeriod,
+ connectionTTL,
+ callTimeout,
+ maxConnections,
+ minLargeMessageSize,
+ consumerWindowSize,
+ consumerMaxRate,
+ producerWindowSize,
+ producerMaxRate,
+ blockOnAcknowledge,
+ blockOnPersistentSend,
+ blockOnNonPersistentSend,
+ autoGroup,
+ preAcknowledge,
+ loadBalancingPolicyClassName,
+ transactionBatchSize,
+ dupsOKBatchSize,
+ initialWaitTimeout,
+ useGlobalPools,
+ scheduledThreadPoolMaxSize,
+ threadPoolMaxSize,
+ retryInterval,
+ retryIntervalMultiplier,
+ reconnectAttempts,
+ failoverOnServerShutdown,
+ jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, liveTC, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ server.createConnectionFactory(name, liveTC, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String backupTransportClassName,
+ final Map<String, Object> backupTransportParams,
+ final Object[] jndiBindings) throws Exception
+ {
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, liveTC, backupTC, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public void createConnectionFactory(final String name,
+ final String liveTransportClassName,
+ final Map<String, Object> liveTransportParams,
+ final String backupTransportClassName,
+ final Map<String, Object> backupTransportParams,
+ final String clientID,
+ final Object[] jndiBindings) throws Exception
+ {
+ TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+ TransportConfiguration backupTC = new TransportConfiguration(backupTransportClassName, backupTransportParams);
+
+ List<String> jndiBindingsList = convert(jndiBindings);
+
+ server.createConnectionFactory(name, liveTC, backupTC, clientID, jndiBindingsList);
+
+ sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+ }
+
+ public boolean createQueue(final String name, final String jndiBinding) throws Exception
+ {
+ boolean created = server.createQueue(name, jndiBinding, null, true);
+ if (created)
+ {
+ sendNotification(NotificationType.QUEUE_CREATED, name);
+ }
+ return created;
+ }
+
+ public boolean destroyQueue(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyQueue(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.QUEUE_DESTROYED, name);
+ }
+ return destroyed;
+ }
+
+ public boolean createTopic(final String topicName, final String jndiBinding) throws Exception
+ {
+ boolean created = server.createTopic(topicName, jndiBinding);
+ if (created)
+ {
+ sendNotification(NotificationType.TOPIC_CREATED, topicName);
+ }
+ return created;
+ }
+
+ public boolean destroyTopic(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyTopic(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.TOPIC_DESTROYED, name);
+ }
+ return destroyed;
+ }
+
+ public void destroyConnectionFactory(final String name) throws Exception
+ {
+ boolean destroyed = server.destroyConnectionFactory(name);
+ if (destroyed)
+ {
+ sendNotification(NotificationType.CONNECTION_FACTORY_DESTROYED, name);
+ }
+ }
+
+ public boolean isStarted()
+ {
+ return server.isStarted();
+ }
+
+ public String getVersion()
+ {
+ return server.getVersion();
+ }
+
+ // NotificationEmitter implementation ----------------------------
+
+ public void removeNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener, filter, handback);
+ }
+
+ public void removeNotificationListener(final NotificationListener listener) throws ListenerNotFoundException
+ {
+ broadcaster.removeNotificationListener(listener);
+ }
+
+ public void addNotificationListener(final NotificationListener listener,
+ final NotificationFilter filter,
+ final Object handback) throws IllegalArgumentException
+ {
+ broadcaster.addNotificationListener(listener, filter, handback);
+ }
+
+ public MBeanNotificationInfo[] getNotificationInfo()
+ {
+ NotificationType[] values = NotificationType.values();
+ String[] names = new String[values.length];
+ for (int i = 0; i < values.length; i++)
+ {
+ names[i] = values[i].toString();
+ }
+ return new MBeanNotificationInfo[] { new MBeanNotificationInfo(names,
+ this.getClass().getName(),
+ "Notifications emitted by a JMS Server") };
+ }
+
+ public String[] listRemoteAddresses() throws Exception
+ {
+ return server.listRemoteAddresses();
+ }
+
+ public String[] listRemoteAddresses(final String ipAddress) throws Exception
+ {
+ return server.listRemoteAddresses(ipAddress);
+ }
+
+ public boolean closeConnectionsForAddress(final String ipAddress) throws Exception
+ {
+ return server.closeConnectionsForAddress(ipAddress);
+ }
+
+ public String[] listConnectionIDs() throws Exception
+ {
+ return server.listConnectionIDs();
+ }
+
+ public String[] listSessions(final String connectionID) throws Exception
+ {
+ return server.listSessions(connectionID);
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private void sendNotification(final NotificationType type, final String message)
+ {
+ Notification notif = new Notification(type.toString(), this, notifSeq.incrementAndGet(), message);
+ broadcaster.sendNotification(notif);
+ }
+
+ // Inner classes -------------------------------------------------
+
+ public static enum NotificationType
+ {
+ QUEUE_CREATED,
+ QUEUE_DESTROYED,
+ TOPIC_CREATED,
+ TOPIC_DESTROYED,
+ CONNECTION_FACTORY_CREATED,
+ CONNECTION_FACTORY_DESTROYED;
+ }
+
+}
Deleted: 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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -1,302 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.jms.server.management.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.AddressControlMBean;
-import org.jboss.messaging.core.management.ManagementService;
-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.JBossMessage;
-import org.jboss.messaging.jms.client.SelectorTranslator;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
-import org.jboss.messaging.utils.Pair;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class TopicControl implements TopicControlMBean
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(TopicControl.class);
-
- // Attributes ----------------------------------------------------
-
- private final JBossTopic managedTopic;
-
- private final String binding;
-
- 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 ManagementService managementService)
- {
- this.managedTopic = topic;
- this.addressControl = addressControl;
- this.binding = jndiBinding;
- this.managementService = managementService;
- }
-
- // TopicControlMBean implementation ------------------------------
-
- public String getName()
- {
- return managedTopic.getName();
- }
-
- public boolean isTemporary()
- {
- return managedTopic.isTemporary();
- }
-
- public String getAddress()
- {
- return managedTopic.getAddress();
- }
-
- public String getJNDIBinding()
- {
- return binding;
- }
-
- public int getMessageCount()
- {
- return getMessageCount(DurabilityType.ALL);
- }
-
- public int getDurableMessageCount()
- {
- return getMessageCount(DurabilityType.DURABLE);
- }
-
- public int getNonDurableMessageCount()
- {
- return getMessageCount(DurabilityType.NON_DURABLE);
- }
-
- public int getSubscriptionCount()
- {
- return getQueues(DurabilityType.ALL).size();
- }
-
- public int getDurableSubscriptionCount()
- {
- return getQueues(DurabilityType.DURABLE).size();
- }
-
- public int getNonDurableSubscriptionCount()
- {
- return getQueues(DurabilityType.NON_DURABLE).size();
- }
-
- public Object[] listAllSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.ALL);
- }
-
- public Object[] listDurableSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.DURABLE);
- }
-
- public Object[] listNonDurableSubscriptions()
- {
- return listSubscribersInfos(DurabilityType.NON_DURABLE);
- }
-
- public Map<String, Object>[] listMessagesForSubscription(final String queueName) throws Exception
- {
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName);
- }
-
- Map<String, Object>[] coreMessages = coreQueueControl.listAllMessages();
-
- Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
-
- int i = 0;
-
- for (Map<String, Object> coreMessage : coreMessages)
- {
- jmsMessages[i++] = JBossMessage.coreMaptoJMSMap(coreMessage);
- }
- return jmsMessages;
- }
-
- public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
- {
- String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
- }
- String filter = createFilterFromJMSSelector(filterStr);
- return coreQueueControl.listMessages(filter).length;
- }
-
- public int removeAllMessages() throws Exception
- {
- int count = 0;
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
- count += coreQueueControl.removeAllMessages();
- }
-
- return count;
- }
-
- public void dropDurableSubscription(String clientID, String subscriptionName) throws Exception
- {
- String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
- if (coreQueueControl == null)
- {
- throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
- }
- MessagingServerControlMBean serverControl = (MessagingServerControlMBean)managementService.getResource(ResourceNames.CORE_SERVER);
- serverControl.destroyQueue(queueName);
- }
-
- public void dropAllSubscriptions() throws Exception
- {
- MessagingServerControlMBean serverControl = (MessagingServerControlMBean)managementService.getResource(ResourceNames.CORE_SERVER);
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- serverControl.destroyQueue(queue);
- }
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- private Object[] listSubscribersInfos(final DurabilityType durability)
- {
- List<QueueControlMBean> queues = getQueues(durability);
- List<Object[]> subInfos = new ArrayList<Object[]>(queues.size());
-
- for (QueueControlMBean queue : queues)
- {
- String clientID = null;
- String subName = null;
-
- if (queue.isDurable())
- {
- Pair<String, String> pair = JBossTopic.decomposeQueueNameForDurableSubscription(queue.getName().toString());
- clientID = pair.a;
- subName = pair.b;
- }
-
- String filter = queue.getFilter() != null ? queue.getFilter() : null;
-
- Object[] subscriptionInfo = new Object[6];
- subscriptionInfo[0] = queue.getName();
- subscriptionInfo[1] = clientID;
- subscriptionInfo[2] = subName;
- subscriptionInfo[3] = queue.isDurable();
- subscriptionInfo[4] = queue.getMessageCount();
-
- subInfos.add(subscriptionInfo);
- }
- return subInfos.toArray(new Object[subInfos.size()]);
- }
-
- private int getMessageCount(final DurabilityType durability)
- {
- List<QueueControlMBean> queues = getQueues(durability);
- int count = 0;
- for (QueueControlMBean queue : queues)
- {
- count += queue.getMessageCount();
- }
- return count;
- }
-
- private List<QueueControlMBean> getQueues(final DurabilityType durability)
- {
- try
- {
- List<QueueControlMBean> matchingQueues = new ArrayList<QueueControlMBean>();
- String[] queues = addressControl.getQueueNames();
- for (String queue : queues)
- {
- QueueControlMBean coreQueueControl = (QueueControlMBean)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
-
- // Ignore the "special" subscription
- if (!coreQueueControl.getName().equals(addressControl.getAddress()))
- {
- if (durability == DurabilityType.ALL || (durability == DurabilityType.DURABLE && coreQueueControl.isDurable()) ||
- (durability == DurabilityType.NON_DURABLE && !coreQueueControl.isDurable()))
- {
- matchingQueues.add(coreQueueControl);
- }
- }
- }
- return matchingQueues;
- }
- catch (Exception e)
- {
- return Collections.emptyList();
- }
- }
-
- // Inner classes -------------------------------------------------
-
- private enum DurabilityType
- {
- ALL, DURABLE, NON_DURABLE
- }
-}
Copied: trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControlImpl.java (from rev 7268, trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControl.java)
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControlImpl.java (rev 0)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/TopicControlImpl.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -0,0 +1,302 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 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.jms.server.management.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.messaging.core.exception.MessagingException;
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.management.AddressControl;
+import org.jboss.messaging.core.management.ManagementService;
+import org.jboss.messaging.core.management.MessagingServerControl;
+import org.jboss.messaging.core.management.QueueControl;
+import org.jboss.messaging.core.management.ResourceNames;
+import org.jboss.messaging.jms.JBossTopic;
+import org.jboss.messaging.jms.client.JBossMessage;
+import org.jboss.messaging.jms.client.SelectorTranslator;
+import org.jboss.messaging.jms.server.management.TopicControl;
+import org.jboss.messaging.utils.Pair;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ *
+ * @version <tt>$Revision$</tt>
+ *
+ */
+public class TopicControlImpl implements TopicControl
+{
+ // Constants -----------------------------------------------------
+
+ private static final Logger log = Logger.getLogger(TopicControlImpl.class);
+
+ // Attributes ----------------------------------------------------
+
+ private final JBossTopic managedTopic;
+
+ private final String binding;
+
+ private AddressControl addressControl;
+
+ private ManagementService managementService;
+
+ // Static --------------------------------------------------------
+
+ public static String createFilterFromJMSSelector(final String selectorStr) throws MessagingException
+ {
+ return (selectorStr == null) ? null : SelectorTranslator.convertToJBMFilterString(selectorStr);
+ }
+
+ // Constructors --------------------------------------------------
+
+ public TopicControlImpl(final JBossTopic topic,
+ final AddressControl addressControl,
+ final String jndiBinding,
+ final ManagementService managementService)
+ {
+ this.managedTopic = topic;
+ this.addressControl = addressControl;
+ this.binding = jndiBinding;
+ this.managementService = managementService;
+ }
+
+ // TopicControlMBean implementation ------------------------------
+
+ public String getName()
+ {
+ return managedTopic.getName();
+ }
+
+ public boolean isTemporary()
+ {
+ return managedTopic.isTemporary();
+ }
+
+ public String getAddress()
+ {
+ return managedTopic.getAddress();
+ }
+
+ public String getJNDIBinding()
+ {
+ return binding;
+ }
+
+ public int getMessageCount()
+ {
+ return getMessageCount(DurabilityType.ALL);
+ }
+
+ public int getDurableMessageCount()
+ {
+ return getMessageCount(DurabilityType.DURABLE);
+ }
+
+ public int getNonDurableMessageCount()
+ {
+ return getMessageCount(DurabilityType.NON_DURABLE);
+ }
+
+ public int getSubscriptionCount()
+ {
+ return getQueues(DurabilityType.ALL).size();
+ }
+
+ public int getDurableSubscriptionCount()
+ {
+ return getQueues(DurabilityType.DURABLE).size();
+ }
+
+ public int getNonDurableSubscriptionCount()
+ {
+ return getQueues(DurabilityType.NON_DURABLE).size();
+ }
+
+ public Object[] listAllSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.ALL);
+ }
+
+ public Object[] listDurableSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.DURABLE);
+ }
+
+ public Object[] listNonDurableSubscriptions()
+ {
+ return listSubscribersInfos(DurabilityType.NON_DURABLE);
+ }
+
+ public Map<String, Object>[] listMessagesForSubscription(final String queueName) throws Exception
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName);
+ }
+
+ Map<String, Object>[] coreMessages = coreQueueControl.listAllMessages();
+
+ Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
+
+ int i = 0;
+
+ for (Map<String, Object> coreMessage : coreMessages)
+ {
+ jmsMessages[i++] = JBossMessage.coreMaptoJMSMap(coreMessage);
+ }
+ return jmsMessages;
+ }
+
+ public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
+ {
+ String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
+ }
+ String filter = createFilterFromJMSSelector(filterStr);
+ return coreQueueControl.listMessages(filter).length;
+ }
+
+ public int removeAllMessages() throws Exception
+ {
+ int count = 0;
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+ count += coreQueueControl.removeAllMessages();
+ }
+
+ return count;
+ }
+
+ public void dropDurableSubscription(String clientID, String subscriptionName) throws Exception
+ {
+ String queueName = JBossTopic.createQueueNameForDurableSubscription(clientID, subscriptionName);
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+ if (coreQueueControl == null)
+ {
+ throw new IllegalArgumentException("No subscriptions with name " + queueName + " for clientID " + clientID);
+ }
+ MessagingServerControl serverControl = (MessagingServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+ serverControl.destroyQueue(queueName);
+ }
+
+ public void dropAllSubscriptions() throws Exception
+ {
+ MessagingServerControl serverControl = (MessagingServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ serverControl.destroyQueue(queue);
+ }
+ }
+
+ // Package protected ---------------------------------------------
+
+ // Protected -----------------------------------------------------
+
+ // Private -------------------------------------------------------
+
+ private Object[] listSubscribersInfos(final DurabilityType durability)
+ {
+ List<QueueControl> queues = getQueues(durability);
+ List<Object[]> subInfos = new ArrayList<Object[]>(queues.size());
+
+ for (QueueControl queue : queues)
+ {
+ String clientID = null;
+ String subName = null;
+
+ if (queue.isDurable())
+ {
+ Pair<String, String> pair = JBossTopic.decomposeQueueNameForDurableSubscription(queue.getName().toString());
+ clientID = pair.a;
+ subName = pair.b;
+ }
+
+ String filter = queue.getFilter() != null ? queue.getFilter() : null;
+
+ Object[] subscriptionInfo = new Object[6];
+ subscriptionInfo[0] = queue.getName();
+ subscriptionInfo[1] = clientID;
+ subscriptionInfo[2] = subName;
+ subscriptionInfo[3] = queue.isDurable();
+ subscriptionInfo[4] = queue.getMessageCount();
+
+ subInfos.add(subscriptionInfo);
+ }
+ return subInfos.toArray(new Object[subInfos.size()]);
+ }
+
+ private int getMessageCount(final DurabilityType durability)
+ {
+ List<QueueControl> queues = getQueues(durability);
+ int count = 0;
+ for (QueueControl queue : queues)
+ {
+ count += queue.getMessageCount();
+ }
+ return count;
+ }
+
+ private List<QueueControl> getQueues(final DurabilityType durability)
+ {
+ try
+ {
+ List<QueueControl> matchingQueues = new ArrayList<QueueControl>();
+ String[] queues = addressControl.getQueueNames();
+ for (String queue : queues)
+ {
+ QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+
+ // Ignore the "special" subscription
+ if (!coreQueueControl.getName().equals(addressControl.getAddress()))
+ {
+ if (durability == DurabilityType.ALL || (durability == DurabilityType.DURABLE && coreQueueControl.isDurable()) ||
+ (durability == DurabilityType.NON_DURABLE && !coreQueueControl.isDurable()))
+ {
+ matchingQueues.add(coreQueueControl);
+ }
+ }
+ }
+ return matchingQueues;
+ }
+ catch (Exception e)
+ {
+ return Collections.emptyList();
+ }
+ }
+
+ // Inner classes -------------------------------------------------
+
+ private enum DurabilityType
+ {
+ ALL, DURABLE, NON_DURABLE
+ }
+}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -30,8 +30,8 @@
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
import org.jboss.messaging.core.management.jmx.impl.ReplicationAwareStandardMBeanWrapper;
-import org.jboss.messaging.jms.server.management.ConnectionFactoryControlMBean;
-import org.jboss.messaging.jms.server.management.impl.ConnectionFactoryControl;
+import org.jboss.messaging.jms.server.management.ConnectionFactoryControl;
+import org.jboss.messaging.jms.server.management.impl.ConnectionFactoryControlImpl;
/**
* A ReplicationAwareConnectionFactoryControlWrapper
@@ -39,23 +39,23 @@
* @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
*/
public class ReplicationAwareConnectionFactoryControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- ConnectionFactoryControlMBean
+ ConnectionFactoryControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final ConnectionFactoryControl localControl;
+ private final ConnectionFactoryControlImpl localControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareConnectionFactoryControlWrapper(final ConnectionFactoryControl localControl,
+ public ReplicationAwareConnectionFactoryControlWrapper(final ConnectionFactoryControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.JMS_CONNECTION_FACTORY + localControl.getName(), ConnectionFactoryControlMBean.class, replicationInvoker);
+ super(ResourceNames.JMS_CONNECTION_FACTORY + localControl.getName(), ConnectionFactoryControl.class, replicationInvoker);
this.localControl = localControl;
}
@@ -186,7 +186,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class),
info.getNotifications());
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSQueueControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSQueueControlWrapper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSQueueControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -31,8 +31,8 @@
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
import org.jboss.messaging.core.management.jmx.impl.ReplicationAwareStandardMBeanWrapper;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSQueueControl;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
+import org.jboss.messaging.jms.server.management.impl.JMSQueueControlImpl;
/**
* A ReplicationAwareJMSQueueControlWrapper
@@ -40,7 +40,7 @@
* @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
*/
public class ReplicationAwareJMSQueueControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- JMSQueueControlMBean
+ JMSQueueControl
{
// Constants -----------------------------------------------------
@@ -49,16 +49,16 @@
// Attributes ----------------------------------------------------
- private final JMSQueueControl localControl;
+ private final JMSQueueControlImpl localControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareJMSQueueControlWrapper(final JMSQueueControl localControl,
+ public ReplicationAwareJMSQueueControlWrapper(final JMSQueueControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.JMS_QUEUE + localControl.getName(), JMSQueueControlMBean.class, replicationInvoker);
+ super(ResourceNames.JMS_QUEUE + localControl.getName(), JMSQueueControl.class, replicationInvoker);
this.localControl = localControl;
}
@@ -229,7 +229,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class),
info.getNotifications());
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -30,8 +30,8 @@
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
import org.jboss.messaging.core.management.jmx.impl.ReplicationAwareStandardMBeanWrapper;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
-import org.jboss.messaging.jms.server.management.impl.JMSServerControl;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
+import org.jboss.messaging.jms.server.management.impl.JMSServerControlImpl;
/**
* A ReplicationAwareJMSServerControlWrapper
@@ -40,23 +40,23 @@
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
*/
public class ReplicationAwareJMSServerControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- JMSServerControlMBean
+ JMSServerControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final JMSServerControl localControl;
+ private final JMSServerControlImpl localControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareJMSServerControlWrapper(final JMSServerControl localControl,
+ public ReplicationAwareJMSServerControlWrapper(final JMSServerControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.JMS_SERVER, JMSServerControlMBean.class, replicationInvoker);
+ super(ResourceNames.JMS_SERVER, JMSServerControl.class, replicationInvoker);
this.localControl = localControl;
}
@@ -364,7 +364,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
info.getNotifications());
}
Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareTopicControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareTopicControlWrapper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareTopicControlWrapper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -30,8 +30,8 @@
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.management.impl.MBeanInfoHelper;
import org.jboss.messaging.core.management.jmx.impl.ReplicationAwareStandardMBeanWrapper;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
-import org.jboss.messaging.jms.server.management.impl.TopicControl;
+import org.jboss.messaging.jms.server.management.TopicControl;
+import org.jboss.messaging.jms.server.management.impl.TopicControlImpl;
/**
* A ReplicationAwareTopicControlWrapper
@@ -39,23 +39,23 @@
* @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
*/
public class ReplicationAwareTopicControlWrapper extends ReplicationAwareStandardMBeanWrapper implements
- TopicControlMBean
+ TopicControl
{
// Constants -----------------------------------------------------
// Attributes ----------------------------------------------------
- private final TopicControl localControl;
+ private final TopicControlImpl localControl;
// Static --------------------------------------------------------
// Constructors --------------------------------------------------
- public ReplicationAwareTopicControlWrapper(final TopicControl localControl,
+ public ReplicationAwareTopicControlWrapper(final TopicControlImpl localControl,
final ReplicationOperationInvoker replicationInvoker) throws Exception
{
- super(ResourceNames.JMS_TOPIC + localControl.getName(), TopicControlMBean.class, replicationInvoker);
+ super(ResourceNames.JMS_TOPIC + localControl.getName(), TopicControl.class, replicationInvoker);
this.localControl = localControl;
}
@@ -163,7 +163,7 @@
info.getDescription(),
info.getAttributes(),
info.getConstructors(),
- MBeanInfoHelper.getMBeanOperationsInfo(TopicControlMBean.class),
+ MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class),
info.getNotifications());
}
Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -68,8 +68,8 @@
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.server.JMSServerManager;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
+import org.jboss.messaging.jms.server.management.TopicControl;
import org.jboss.messaging.utils.Pair;
import org.jboss.messaging.utils.SimpleString;
@@ -417,7 +417,7 @@
public Integer getMessageCountForQueue(String queueName) throws Exception
{
- JMSQueueControlMBean queue = (JMSQueueControlMBean)getMessagingServer().getManagementService()
+ JMSQueueControl queue = (JMSQueueControl)getMessagingServer().getManagementService()
.getResource(ResourceNames.JMS_QUEUE + queueName);
if (queue != null)
{
@@ -446,9 +446,9 @@
public List<String> listAllSubscribersForTopic(String s) throws Exception
{
ObjectName objectName = ObjectNames.getJMSTopicObjectName(s);
- TopicControlMBean topic = (TopicControlMBean)MBeanServerInvocationHandler.newProxyInstance(ManagementFactory.getPlatformMBeanServer(),
+ TopicControl topic = (TopicControl)MBeanServerInvocationHandler.newProxyInstance(ManagementFactory.getPlatformMBeanServer(),
objectName,
- TopicControlMBean.class,
+ TopicControl.class,
false);
Object[] subInfos = topic.listAllSubscriptions();
List<String> subs = new ArrayList<String>();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/HeuristicXATest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/HeuristicXATest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/HeuristicXATest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -36,7 +36,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.core.server.Queue;
import org.jboss.messaging.core.settings.impl.AddressSettings;
@@ -82,7 +82,7 @@
{
server.start();
- MessagingServerControlMBean jmxServer = ManagementControlHelper.createMessagingServerControl(mbeanServer);
+ MessagingServerControl jmxServer = ManagementControlHelper.createMessagingServerControl(mbeanServer);
assertFalse(jmxServer.commitPreparedTransaction("Nananananana"));
}
@@ -139,7 +139,7 @@
session.close();
- MessagingServerControlMBean jmxServer = ManagementControlHelper.createMessagingServerControl(mbeanServer);
+ MessagingServerControl jmxServer = ManagementControlHelper.createMessagingServerControl(mbeanServer);
String preparedTransactions[] = jmxServer.listPreparedTransactions();
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareAddressControlWrapperTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.AddressControl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createAddressControl;
import static org.jboss.messaging.tests.util.RandomUtil.randomBoolean;
@@ -59,8 +59,8 @@
public void testAddRole() throws Exception
{
- AddressControlMBean liveAddressControl = createAddressControl(address, liveMBeanServer);
- AddressControlMBean backupAddressControl = createAddressControl(address, backupMBeanServer);
+ AddressControl liveAddressControl = createAddressControl(address, liveMBeanServer);
+ AddressControl backupAddressControl = createAddressControl(address, backupMBeanServer);
Object[] roles = liveAddressControl.getRoles();
assertEquals(roles.length, backupAddressControl.getRoles().length);
@@ -75,8 +75,8 @@
{
String roleName = randomString();
- AddressControlMBean liveAddressControl = createAddressControl(address, liveMBeanServer);
- AddressControlMBean backupAddressControl = createAddressControl(address, backupMBeanServer);
+ AddressControl liveAddressControl = createAddressControl(address, liveMBeanServer);
+ AddressControl backupAddressControl = createAddressControl(address, backupMBeanServer);
Object[] roles = liveAddressControl.getRoles();
assertEquals(roles.length, backupAddressControl.getRoles().length);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareMessagingServerControlWrapperTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -37,9 +37,9 @@
import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.management.MessageCounterInfo;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.tests.util.RandomUtil;
import org.jboss.messaging.utils.SimpleString;
@@ -70,7 +70,7 @@
SimpleString address = randomSimpleString();
SimpleString name = randomSimpleString();
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
ObjectName queueON = ObjectNames.getQueueObjectName(address, name);
assertResourceNotExists(liveMBeanServer, queueON);
@@ -87,7 +87,7 @@
SimpleString address = randomSimpleString();
SimpleString name = randomSimpleString();
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
ObjectName queueON = ObjectNames.getQueueObjectName(address, name);
assertResourceNotExists(liveMBeanServer, queueON);
@@ -108,8 +108,8 @@
public void testEnableMessageCounters() throws Exception
{
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
- MessagingServerControlMBean backupServerControl = createMessagingServerControl(backupMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl backupServerControl = createMessagingServerControl(backupMBeanServer);
assertFalse(liveServerControl.isMessageCounterEnabled());
assertFalse(backupServerControl.isMessageCounterEnabled());
@@ -122,8 +122,8 @@
public void testDisableMessageCounters() throws Exception
{
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
- MessagingServerControlMBean backupServerControl = createMessagingServerControl(backupMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl backupServerControl = createMessagingServerControl(backupMBeanServer);
assertFalse(liveServerControl.isMessageCounterEnabled());
assertFalse(backupServerControl.isMessageCounterEnabled());
@@ -143,12 +143,12 @@
public void testResetAllMessageCounters() throws Exception
{
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
liveServerControl.enableMessageCounters();
liveServerControl.setMessageCounterSamplePeriod(2000);
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
// send on queue
ClientProducer producer = session.createProducer(address);
@@ -182,8 +182,8 @@
{
long newPeriod = randomPositiveLong();
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
- MessagingServerControlMBean backupServerControl = createMessagingServerControl(backupMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl backupServerControl = createMessagingServerControl(backupMBeanServer);
assertEquals(liveServerControl.getMessageCounterSamplePeriod(),
backupServerControl.getMessageCounterSamplePeriod());
@@ -198,8 +198,8 @@
{
int newCount = RandomUtil.randomPositiveInt();
- MessagingServerControlMBean liveServerControl = createMessagingServerControl(liveMBeanServer);
- MessagingServerControlMBean backupServerControl = createMessagingServerControl(backupMBeanServer);
+ MessagingServerControl liveServerControl = createMessagingServerControl(liveMBeanServer);
+ MessagingServerControl backupServerControl = createMessagingServerControl(backupMBeanServer);
assertEquals(liveServerControl.getMessageCounterMaxDayCount(), backupServerControl.getMessageCounterMaxDayCount());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/management/ReplicationAwareQueueControlWrapperTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -36,7 +36,7 @@
import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.tests.util.RandomUtil;
import org.jboss.messaging.utils.SimpleString;
@@ -69,8 +69,8 @@
byte oldPriority = (byte)1;
byte newPriority = (byte)8;
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -108,8 +108,8 @@
public void testExpireMessage() throws Exception
{
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -139,8 +139,8 @@
long matchingValue = randomLong();
long unmatchingValue = matchingValue + 1;
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -172,10 +172,10 @@
session.createQueue(otherQueue, otherQueue, null, false);
ClientProducer producer = session.createProducer(address);
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
- QueueControlMBean liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
- QueueControlMBean backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
+ QueueControl backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -216,10 +216,10 @@
session.createQueue(otherQueue, otherQueue, null, false);
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
- QueueControlMBean liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
- QueueControlMBean backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
+ QueueControl backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
// send on queue
ClientProducer producer = session.createProducer(address);
@@ -254,10 +254,10 @@
session.createQueue(otherQueue, otherQueue, null, false);
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
- QueueControlMBean liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
- QueueControlMBean backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveOtherQueueControl = createQueueControl(otherQueue, otherQueue, liveMBeanServer);
+ QueueControl backupOtherQueueControl = createQueueControl(otherQueue, otherQueue, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -289,8 +289,8 @@
public void testRemoveAllMessages() throws Exception
{
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -318,8 +318,8 @@
long matchingValue = randomLong();
long unmatchingValue = matchingValue + 1;
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
// send on queue
ClientProducer producer = session.createProducer(address);
@@ -343,8 +343,8 @@
public void testRemoveMessage() throws Exception
{
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -370,8 +370,8 @@
public void testSendMessageToDeadLetterAddress() throws Exception
{
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -399,8 +399,8 @@
{
String deadLetterAddress = randomString();
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
@@ -418,8 +418,8 @@
{
String expiryAddress = randomString();
- QueueControlMBean liveQueueControl = createQueueControl(address, address, liveMBeanServer);
- QueueControlMBean backupQueueControl = createQueueControl(address, address, backupMBeanServer);
+ QueueControl liveQueueControl = createQueueControl(address, address, liveMBeanServer);
+ QueueControl backupQueueControl = createQueueControl(address, address, backupMBeanServer);
assertFalse(liveQueueControl.isBackup());
assertTrue(backupQueueControl.isBackup());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/bridge/BridgeTestBase.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/bridge/BridgeTestBase.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -39,8 +39,8 @@
import org.jboss.messaging.jms.client.JBossMessage;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
+import org.jboss.messaging.jms.server.management.TopicControl;
import org.jboss.messaging.tests.unit.util.InVMContext;
import org.jboss.messaging.tests.util.UnitTestCase;
@@ -442,7 +442,7 @@
{
managementService = server1.getManagementService();
}
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)managementService.getResource(ResourceNames.JMS_QUEUE + queue.getQueueName());
+ JMSQueueControl queueControl = (JMSQueueControl)managementService.getResource(ResourceNames.JMS_QUEUE + queue.getQueueName());
Integer messageCount = queueControl.getMessageCount();
@@ -460,7 +460,7 @@
{
managementService = server1.getManagementService();
}
- TopicControlMBean topicControl = (TopicControlMBean)managementService.getResource(ResourceNames.JMS_TOPIC + topic.getTopicName());
+ TopicControl topicControl = (TopicControl)managementService.getResource(ResourceNames.JMS_TOPIC + topic.getTopicName());
assertEquals(0, topicControl.getSubscriptionCount());
}
@@ -472,7 +472,7 @@
{
managementService = server1.getManagementService();
}
- JMSQueueControlMBean queueControl = (JMSQueueControlMBean)managementService.getResource(ResourceNames.JMS_QUEUE + queueName);
+ JMSQueueControl queueControl = (JMSQueueControl)managementService.getResource(ResourceNames.JMS_QUEUE + queueName);
queueControl.removeAllMessages();
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSQueueControlWrapperTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
import org.jboss.messaging.tests.integration.cluster.management.ReplicationAwareTestBase;
import org.jboss.messaging.tests.integration.jms.server.management.JMSUtil;
import org.jboss.messaging.tests.integration.jms.server.management.NullInitialContext;
@@ -64,13 +64,13 @@
private Session session;
- private JMSQueueControlMBean liveQueueControl;
+ private JMSQueueControl liveQueueControl;
- private JMSQueueControlMBean backupQueueControl;
+ private JMSQueueControl backupQueueControl;
- private JMSQueueControlMBean liveOtherQueueControl;
+ private JMSQueueControl liveOtherQueueControl;
- private JMSQueueControlMBean backupOtherQueueControl;
+ private JMSQueueControl backupOtherQueueControl;
// Static --------------------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSServerControlWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSServerControlWrapperTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/management/ReplicationAwareJMSServerControlWrapperTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -32,7 +32,7 @@
import org.jboss.messaging.core.management.ObjectNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
import org.jboss.messaging.tests.integration.cluster.management.ReplicationAwareTestBase;
import org.jboss.messaging.tests.integration.jms.server.management.JMSUtil;
import org.jboss.messaging.tests.integration.jms.server.management.NullInitialContext;
@@ -56,9 +56,9 @@
private JMSServerManagerImpl backupServerManager;
- private JMSServerControlMBean liveServerControl;
+ private JMSServerControl liveServerControl;
- private JMSServerControlMBean backupServerControl;
+ private JMSServerControl backupServerControl;
// Static --------------------------------------------------------
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -33,7 +33,7 @@
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
import org.jboss.messaging.tests.integration.management.ManagementControlHelper;
import static org.jboss.messaging.tests.integration.management.ManagementControlHelper.createJMSQueueControl;
import org.jboss.messaging.tests.integration.management.ManagementTestBase;
@@ -85,7 +85,7 @@
public void testGetAttributes() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(queue.getName(), queueControl.getName());
assertEquals(queue.getAddress(), queueControl.getAddress());
@@ -94,7 +94,7 @@
public void testGetXXXCount() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
assertEquals(0, queueControl.getConsumerCount());
@@ -126,7 +126,7 @@
public void testRemoveMessage() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
@@ -157,7 +157,7 @@
{
String unknownMessageID = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
@@ -173,7 +173,7 @@
public void testRemoveAllMessages() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
@@ -196,7 +196,7 @@
public void testRemoveMatchingMessages() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
@@ -231,7 +231,7 @@
public void testChangeMessagePriority() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
JMSUtil.sendMessages(queue, 1);
@@ -262,7 +262,7 @@
{
byte invalidPriority = (byte)23;
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
String[] messageIDs = JMSUtil.sendMessages(queue, 1);
@@ -291,7 +291,7 @@
{
String unkownMessageID = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
try
{
@@ -307,7 +307,7 @@
{
final SimpleString expiryAddress = randomSimpleString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertNull(queueControl.getExpiryAddress());
@@ -327,7 +327,7 @@
{
final String expiryAddress = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertNull(queueControl.getExpiryAddress());
@@ -337,13 +337,13 @@
public void testExpireMessage() throws Exception
{
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
String expiryQueueName = randomString();
JBossQueue expiryQueue = new JBossQueue(expiryQueueName);
serverManager.createQueue(expiryQueueName, expiryQueueName, null, true);
queueControl.setExpiryAddress(expiryQueue.getAddress());
- JMSQueueControlMBean expiryQueueControl = createJMSQueueControl(expiryQueue, mbeanServer);
+ JMSQueueControl expiryQueueControl = createJMSQueueControl(expiryQueue, mbeanServer);
String[] messageIDs = JMSUtil.sendMessages(queue, 1);
@@ -370,7 +370,7 @@
{
String unknownMessageID = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
try
{
@@ -398,7 +398,7 @@
connection.close();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(2, queueControl.getMessageCount());
int expiredMessagesCount = queueControl.expireMessages(filter);
@@ -415,7 +415,7 @@
long matchingValue = randomLong();
long unmatchingValue = matchingValue + 1;
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
Connection connection = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
@@ -436,7 +436,7 @@
{
final SimpleString deadLetterAddress = randomSimpleString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertNull(queueControl.getDeadLetterAddress());
@@ -456,7 +456,7 @@
{
final String deadLetterAddress = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertNull(queueControl.getDeadLetterAddress());
@@ -481,8 +481,8 @@
conn.close();
- JMSQueueControlMBean queueControl = createManagementControl();
- JMSQueueControlMBean dlqControl = ManagementControlHelper.createJMSQueueControl(dlq, mbeanServer);
+ JMSQueueControl queueControl = createManagementControl();
+ JMSQueueControl dlqControl = ManagementControlHelper.createJMSQueueControl(dlq, mbeanServer);
assertEquals(2, queueControl.getMessageCount());
assertEquals(0, dlqControl.getMessageCount());
@@ -507,7 +507,7 @@
{
String unknownMessageID = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
try
{
@@ -530,7 +530,7 @@
// send on queue
JMSUtil.sendMessages(queue, 2);
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(2, queueControl.getMessageCount());
// moved all messages to otherQueue
@@ -551,7 +551,7 @@
{
String unknownQueue = randomString();
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
try
{
@@ -580,7 +580,7 @@
JMSUtil.sendMessageWithProperty(session, queue, key, matchingValue);
JMSUtil.sendMessageWithProperty(session, queue, key, unmatchingValue);
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(2, queueControl.getMessageCount());
// moved matching messages to otherQueue
@@ -611,7 +611,7 @@
String[] messageIDs = JMSUtil.sendMessages(queue, 1);
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(1, queueControl.getMessageCount());
boolean moved = queueControl.moveMessage(messageIDs[0], otherQueueName);
@@ -631,7 +631,7 @@
serverManager.createQueue(otherQueueName, otherQueueName, null, true);
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(0, queueControl.getMessageCount());
try
@@ -652,7 +652,7 @@
String[] messageIDs = JMSUtil.sendMessages(queue, 1);
- JMSQueueControlMBean queueControl = createManagementControl();
+ JMSQueueControl queueControl = createManagementControl();
assertEquals(1, queueControl.getMessageCount());
try
@@ -702,7 +702,7 @@
super.tearDown();
}
- protected JMSQueueControlMBean createManagementControl() throws Exception
+ protected JMSQueueControl createManagementControl() throws Exception
{
return createJMSQueueControl(queue, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -35,7 +35,7 @@
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
import org.jboss.messaging.tests.integration.management.ManagementControlHelper;
import org.jboss.messaging.tests.integration.management.ManagementTestBase;
import org.jboss.messaging.tests.unit.util.InVMContext;
@@ -471,7 +471,7 @@
conn.close();
- JMSQueueControlMBean dlqControl = ManagementControlHelper.createJMSQueueControl(dlq, mbeanServer);
+ JMSQueueControl dlqControl = ManagementControlHelper.createJMSQueueControl(dlq, mbeanServer);
assertEquals(2, proxy.retrieveAttributeValue("MessageCount"));
assertEquals(0, dlqControl.getMessageCount());
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControl2Test.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControl2Test.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -42,7 +42,7 @@
import org.jboss.messaging.integration.transports.netty.NettyAcceptorFactory;
import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
import org.jboss.messaging.tests.integration.management.ManagementControlHelper;
import org.jboss.messaging.tests.integration.management.ManagementTestBase;
import org.jboss.messaging.tests.unit.util.InVMContext;
@@ -148,7 +148,7 @@
// Protected -----------------------------------------------------
- protected JMSServerControlMBean createManagementControl() throws Exception
+ protected JMSServerControl createManagementControl() throws Exception
{
return ManagementControlHelper.createJMSServerControl(mbeanServer);
}
@@ -162,7 +162,7 @@
{
server = startMessagingServer(acceptorFactory);
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
assertEquals(0, control.listConnectionIDs().length);
@@ -200,7 +200,7 @@
{
server = startMessagingServer(acceptorFactory);
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
assertEquals(0, control.listConnectionIDs().length);
@@ -238,7 +238,7 @@
{
server = startMessagingServer(acceptorFactory);
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
assertEquals(0, control.listRemoteAddresses().length);
@@ -277,7 +277,7 @@
{
server = startMessagingServer(acceptorFactory);
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
assertEquals(0, server.getConnectionCount());
assertEquals(0, control.listRemoteAddresses().length);
@@ -329,7 +329,7 @@
{
server = startMessagingServer(acceptorFactory);
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
assertEquals(0, server.getConnectionCount());
assertEquals(0, control.listRemoteAddresses().length);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -44,7 +44,7 @@
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.jms.server.JMSServerManager;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
import org.jboss.messaging.tests.integration.management.ManagementControlHelper;
import org.jboss.messaging.tests.integration.management.ManagementTestBase;
import org.jboss.messaging.tests.unit.util.InVMContext;
@@ -78,7 +78,7 @@
public void testGetVersion() throws Exception
{
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
String version = control.getVersion();
assertEquals(serverManager.getVersion(), version);
}
@@ -91,7 +91,7 @@
checkNoBinding(context, queueJNDIBinding);
checkNoResource(ObjectNames.getJMSQueueObjectName(queueName));
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
control.createQueue(queueName, queueJNDIBinding);
Object o = checkBinding(context, queueJNDIBinding);
@@ -110,7 +110,7 @@
checkNoBinding(context, queueJNDIBinding);
checkNoResource(ObjectNames.getJMSQueueObjectName(queueName));
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
control.createQueue(queueName, queueJNDIBinding);
checkBinding(context, queueJNDIBinding);
@@ -130,7 +130,7 @@
checkNoBinding(context, topicJNDIBinding);
checkNoResource(ObjectNames.getJMSTopicObjectName(topicName));
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
control.createTopic(topicName, topicJNDIBinding);
Object o = checkBinding(context, topicJNDIBinding);
@@ -148,7 +148,7 @@
checkNoBinding(context, topicJNDIBinding);
checkNoResource(ObjectNames.getJMSTopicObjectName(topicName));
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
control.createTopic(topicName, topicJNDIBinding);
checkBinding(context, topicJNDIBinding);
@@ -164,7 +164,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -178,7 +178,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
String clientID = randomString();
@@ -197,7 +197,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -217,7 +217,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
String clientID = randomString();
@@ -239,7 +239,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -259,7 +259,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
String clientID = randomString();
@@ -281,7 +281,7 @@
{
doCreateConnectionFactory(new ConnectionFactoryCreator()
{
- public void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception
+ public void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception
{
String cfName = randomString();
String clientID = randomString();
@@ -338,7 +338,7 @@
checkNoBinding(context, cfJNDIBinding);
}
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
control.createConnectionFactory(cfName, "231.7.7.7", 8765, clientID, cfJNDIBindings);
@@ -362,7 +362,7 @@
checkNoBinding(context, cfJNDIBinding);
}
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -416,7 +416,7 @@
super.tearDown();
}
- protected JMSServerControlMBean createManagementControl() throws Exception
+ protected JMSServerControl createManagementControl() throws Exception
{
return ManagementControlHelper.createJMSServerControl(mbeanServer);
}
@@ -435,7 +435,7 @@
}
checkNoResource(ObjectNames.getConnectionFactoryObjectName(cfName));
- JMSServerControlMBean control = createManagementControl();
+ JMSServerControl control = createManagementControl();
creator.createConnectionFactory(control, cfJNDIBindings);
TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
@@ -479,7 +479,7 @@
interface ConnectionFactoryCreator
{
- void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception;
+ void createConnectionFactory(JMSServerControl control, Object[] bindings) throws Exception;
}
}
\ No newline at end of file
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -35,7 +35,7 @@
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.jms.JBossQueue;
import org.jboss.messaging.jms.client.JBossConnectionFactory;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
/**
* A JMSServerControlUsingCoreTest
@@ -79,13 +79,13 @@
}
@Override
- protected JMSServerControlMBean createManagementControl() throws Exception
+ protected JMSServerControl createManagementControl() throws Exception
{
JBossQueue managementQueue = new JBossQueue(DEFAULT_MANAGEMENT_ADDRESS.toString(),
DEFAULT_MANAGEMENT_ADDRESS.toString());
final JMSMessagingProxy proxy = new JMSMessagingProxy(session, managementQueue, ResourceNames.JMS_SERVER);
- return new JMSServerControlMBean()
+ return new JMSServerControl()
{
public void createConnectionFactory(String name,
String discoveryAddress,
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/TopicControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/TopicControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -40,7 +40,7 @@
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.jms.JBossTopic;
import org.jboss.messaging.jms.server.impl.JMSServerManagerImpl;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
+import org.jboss.messaging.jms.server.management.TopicControl;
import org.jboss.messaging.tests.integration.management.ManagementTestBase;
/**
@@ -77,7 +77,7 @@
public void testGetAttributes() throws Exception
{
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(topic.getTopicName(), topicControl.getName());
assertEquals(topic.getAddress(), topicControl.getAddress());
@@ -97,7 +97,7 @@
Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(3, topicControl.getSubscriptionCount());
assertEquals(1, topicControl.getNonDurableSubscriptionCount());
assertEquals(2, topicControl.getDurableSubscriptionCount());
@@ -117,7 +117,7 @@
Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(0, topicControl.getMessageCount());
assertEquals(0, topicControl.getNonDurableMessageCount());
@@ -144,7 +144,7 @@
Connection connection_3 = JMSUtil.createConnection(InVMConnectorFactory.class.getName());
JMSUtil.createDurableSubscriber(connection_3, topic, clientID, subscriptionName + "2");
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(3, topicControl.listAllSubscriptions().length);
assertEquals(1, topicControl.listNonDurableSubscriptions().length);
assertEquals(2, topicControl.listDurableSubscriptions().length);
@@ -169,7 +169,7 @@
JMSUtil.sendMessageWithProperty(session, topic, key, unmatchingValue);
JMSUtil.sendMessageWithProperty(session, topic, key, matchingValue);
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(3, topicControl.getMessageCount());
@@ -184,7 +184,7 @@
{
String unknownSubscription = randomString();
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
try
{
@@ -200,7 +200,7 @@
{
String unknownClientID = randomString();
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
try
{
@@ -218,7 +218,7 @@
JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(1, topicControl.getDurableSubscriptionCount());
connection.close();
@@ -234,7 +234,7 @@
JMSUtil.createDurableSubscriber(connection, topic, clientID, subscriptionName);
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(1, topicControl.getDurableSubscriptionCount());
try
@@ -265,7 +265,7 @@
clientID,
subscriptionName + "2");
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(2, topicControl.getSubscriptionCount());
durableSubscriber_1.close();
@@ -289,7 +289,7 @@
JMSUtil.sendMessages(topic, 3);
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
assertEquals(3 * 2, topicControl.getMessageCount());
int removedCount = topicControl.removeAllMessages();
@@ -308,7 +308,7 @@
JMSUtil.sendMessages(topic, 3);
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
Map<String, Object>[] messages = topicControl.listMessagesForSubscription(JBossTopic.createQueueNameForDurableSubscription(clientID,
subscriptionName));
assertEquals(3, messages.length);
@@ -318,7 +318,7 @@
{
String unknownClientID = randomString();
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
try
{
@@ -335,7 +335,7 @@
{
String unknownSubscription = randomString();
- TopicControlMBean topicControl = createManagementControl();
+ TopicControl topicControl = createManagementControl();
try
{
@@ -386,7 +386,7 @@
super.tearDown();
}
- protected TopicControlMBean createManagementControl() throws Exception
+ protected TopicControl createManagementControl() throws Exception
{
return createTopicControl(topic, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -33,7 +33,7 @@
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.management.AcceptorControlMBean;
+import org.jboss.messaging.core.management.AcceptorControl;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.server.Messaging;
@@ -79,7 +79,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- AcceptorControlMBean acceptorControl = createManagementControl(acceptorConfig.getName());
+ AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());
assertEquals(acceptorConfig.getName(), acceptorControl.getName());
assertEquals(acceptorConfig.getFactoryClassName(), acceptorControl.getFactoryClassName());
@@ -97,7 +97,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- AcceptorControlMBean acceptorControl = createManagementControl(acceptorConfig.getName());
+ AcceptorControl acceptorControl = createManagementControl(acceptorConfig.getName());
// started by the server
assertTrue(acceptorControl.isStarted());
@@ -201,7 +201,7 @@
super.tearDown();
}
- protected AcceptorControlMBean createManagementControl(String name) throws Exception
+ protected AcceptorControl createManagementControl(String name) throws Exception
{
return ManagementControlHelper.createAcceptorControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/AcceptorControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -28,7 +28,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.AcceptorControlMBean;
+import org.jboss.messaging.core.management.AcceptorControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -55,13 +55,13 @@
private ClientSession session;
@Override
- protected AcceptorControlMBean createManagementControl(final String name) throws Exception
+ protected AcceptorControl createManagementControl(final String name) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
session = sf.createSession(false, true, true);
session.start();
- return new AcceptorControlMBean()
+ return new AcceptorControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session, ResourceNames.CORE_ACCEPTOR + name);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -35,7 +35,7 @@
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.AddressControl;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.security.CheckType;
@@ -74,7 +74,7 @@
session.createQueue(address, queue, false);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
assertEquals(address.toString(), addressControl.getAddress());
@@ -89,7 +89,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
String[] queueNames = addressControl.getQueueNames();
assertEquals(1, queueNames.length);
assertEquals(queue.toString(), queueNames[0]);
@@ -122,7 +122,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
Object[] tabularData = addressControl.getRoles();
assertEquals(0, tabularData.length);
@@ -160,7 +160,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
Object[] roles = addressControl.getRoles();
assertEquals(0, roles.length);
@@ -203,7 +203,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
Object[] tabularData = addressControl.getRoles();
assertEquals(0, tabularData.length);
@@ -249,7 +249,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
Object[] tabularData = addressControl.getRoles();
assertEquals(0, tabularData.length);
@@ -281,7 +281,7 @@
session.createQueue(address, queue, true);
- AddressControlMBean addressControl = createManagementControl(address);
+ AddressControl addressControl = createManagementControl(address);
Object[] tabularData = addressControl.getRoles();
assertEquals(0, tabularData.length);
@@ -330,7 +330,7 @@
super.tearDown();
}
- protected AddressControlMBean createManagementControl(SimpleString address) throws Exception
+ protected AddressControl createManagementControl(SimpleString address) throws Exception
{
return ManagementControlHelper.createAddressControl(address, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/AddressControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -35,7 +35,7 @@
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.AddressControlMBean;
+import org.jboss.messaging.core.management.AddressControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -319,7 +319,7 @@
super.tearDown();
}
- protected AddressControlMBean createManagementControl(SimpleString address) throws Exception
+ protected AddressControl createManagementControl(SimpleString address) throws Exception
{
return ManagementControlHelper.createAddressControl(address, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/BridgeControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/BridgeControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/BridgeControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -40,7 +40,7 @@
import org.jboss.messaging.core.config.cluster.BridgeConfiguration;
import org.jboss.messaging.core.config.cluster.QueueConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.BridgeControlMBean;
+import org.jboss.messaging.core.management.BridgeControl;
import org.jboss.messaging.core.management.ObjectNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -76,7 +76,7 @@
public void testAttributes() throws Exception
{
checkResource(ObjectNames.getBridgeObjectName(bridgeConfig.getName()));
- BridgeControlMBean bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);
+ BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);
assertEquals(bridgeConfig.getName(), bridgeControl.getName());
assertEquals(bridgeConfig.getDiscoveryGroupName(), bridgeControl.getDiscoveryGroupName());
@@ -99,7 +99,7 @@
public void testStartStop() throws Exception
{
checkResource(ObjectNames.getBridgeObjectName(bridgeConfig.getName()));
- BridgeControlMBean bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);
+ BridgeControl bridgeControl = createBridgeControl(bridgeConfig.getName(), mbeanServer);
// started by the server
assertTrue(bridgeControl.isStarted());
@@ -177,7 +177,7 @@
super.tearDown();
}
- protected BridgeControlMBean createBridgeControl(String name, MBeanServer mbeanServer) throws Exception
+ protected BridgeControl createBridgeControl(String name, MBeanServer mbeanServer) throws Exception
{
return ManagementControlHelper.createBridgeControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -32,7 +32,7 @@
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.cluster.BroadcastGroupConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
+import org.jboss.messaging.core.management.BroadcastGroupControl;
import org.jboss.messaging.core.server.Messaging;
import org.jboss.messaging.core.server.MessagingServer;
import org.jboss.messaging.integration.transports.netty.NettyConnectorFactory;
@@ -94,7 +94,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- BroadcastGroupControlMBean broadcastGroupControl = createManagementControl(broadcastGroupConfig.getName());
+ BroadcastGroupControl broadcastGroupControl = createManagementControl(broadcastGroupConfig.getName());
assertEquals(broadcastGroupConfig.getName(), broadcastGroupControl.getName());
assertEquals(broadcastGroupConfig.getGroupAddress(), broadcastGroupControl.getGroupAddress());
@@ -127,7 +127,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- BroadcastGroupControlMBean broadcastGroupControl = createManagementControl(broadcastGroupConfig.getName());
+ BroadcastGroupControl broadcastGroupControl = createManagementControl(broadcastGroupConfig.getName());
// started by the server
assertTrue(broadcastGroupControl.isStarted());
@@ -154,7 +154,7 @@
super.tearDown();
}
- protected BroadcastGroupControlMBean createManagementControl(String name) throws Exception
+ protected BroadcastGroupControl createManagementControl(String name) throws Exception
{
return ManagementControlHelper.createBroadcastGroupControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/BroadcastGroupControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
+import org.jboss.messaging.core.management.BroadcastGroupControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -53,13 +53,13 @@
// BroadcastGroupControlTest overrides --------------------------------
@Override
- protected BroadcastGroupControlMBean createManagementControl(final String name) throws Exception
+ protected BroadcastGroupControl createManagementControl(final String name) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
session = sf.createSession(false, true, true);
session.start();
- return new BroadcastGroupControlMBean()
+ return new BroadcastGroupControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
ResourceNames.CORE_BROADCAST_GROUP + name);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -42,7 +42,7 @@
import org.jboss.messaging.core.config.cluster.ClusterConnectionConfiguration;
import org.jboss.messaging.core.config.cluster.QueueConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.ClusterConnectionControlMBean;
+import org.jboss.messaging.core.management.ClusterConnectionControl;
import org.jboss.messaging.core.management.ObjectNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -79,7 +79,7 @@
{
checkResource(ObjectNames.getClusterConnectionObjectName(clusterConnectionConfig.getName()));
- ClusterConnectionControlMBean clusterConnectionControl = createManagementControl(clusterConnectionConfig.getName());
+ ClusterConnectionControl clusterConnectionControl = createManagementControl(clusterConnectionConfig.getName());
assertEquals(clusterConnectionConfig.getName(), clusterConnectionControl.getName());
assertEquals(clusterConnectionConfig.getAddress(), clusterConnectionControl.getAddress());
@@ -102,7 +102,7 @@
public void testStartStop() throws Exception
{
checkResource(ObjectNames.getClusterConnectionObjectName(clusterConnectionConfig.getName()));
- ClusterConnectionControlMBean clusterConnectionControl = createManagementControl(clusterConnectionConfig.getName());
+ ClusterConnectionControl clusterConnectionControl = createManagementControl(clusterConnectionConfig.getName());
// started by the server
assertTrue(clusterConnectionControl.isStarted());
@@ -178,7 +178,7 @@
super.tearDown();
}
- protected ClusterConnectionControlMBean createManagementControl(String name) throws Exception
+ protected ClusterConnectionControl createManagementControl(String name) throws Exception
{
return ManagementControlHelper.createClusterConnectionControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/ClusterConnectionControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.ClusterConnectionControlMBean;
+import org.jboss.messaging.core.management.ClusterConnectionControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -53,13 +53,13 @@
// ClusterConnectionControlTest overrides --------------------------------
@Override
- protected ClusterConnectionControlMBean createManagementControl(final String name) throws Exception
+ protected ClusterConnectionControl createManagementControl(final String name) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
session = sf.createSession(false, true, true);
session.start();
- return new ClusterConnectionControlMBean()
+ return new ClusterConnectionControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
ResourceNames.CORE_CLUSTER_CONNECTION + name);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -29,7 +29,7 @@
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.cluster.DiscoveryGroupConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
+import org.jboss.messaging.core.management.DiscoveryGroupControl;
import org.jboss.messaging.core.server.Messaging;
import org.jboss.messaging.core.server.MessagingServer;
@@ -69,7 +69,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- DiscoveryGroupControlMBean discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());
+ DiscoveryGroupControl discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());
assertEquals(discoveryGroupConfig.getName(), discoveryGroupControl.getName());
assertEquals(discoveryGroupConfig.getGroupAddress(), discoveryGroupControl.getGroupAddress());
@@ -89,7 +89,7 @@
service = Messaging.newMessagingServer(conf, mbeanServer, false);
service.start();
- DiscoveryGroupControlMBean discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());
+ DiscoveryGroupControl discoveryGroupControl = createManagementControl(discoveryGroupConfig.getName());
// started by the server
assertTrue(discoveryGroupControl.isStarted());
@@ -117,7 +117,7 @@
super.tearDown();
}
- protected DiscoveryGroupControlMBean createManagementControl(String name) throws Exception
+ protected DiscoveryGroupControl createManagementControl(String name) throws Exception
{
return createDiscoveryGroupControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/DiscoveryGroupControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
+import org.jboss.messaging.core.management.DiscoveryGroupControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -53,13 +53,13 @@
// DiscoveryGroupControlTest overrides --------------------------------
@Override
- protected DiscoveryGroupControlMBean createManagementControl(final String name) throws Exception
+ protected DiscoveryGroupControl createManagementControl(final String name) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
session = sf.createSession(false, true, true);
session.start();
- return new DiscoveryGroupControlMBean()
+ return new DiscoveryGroupControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
ResourceNames.CORE_DISCOVERY_GROUP + name);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -30,7 +30,7 @@
import org.jboss.messaging.core.config.cluster.DivertConfiguration;
import org.jboss.messaging.core.config.cluster.QueueConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.DivertControlMBean;
+import org.jboss.messaging.core.management.DivertControl;
import org.jboss.messaging.core.management.ObjectNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.server.Messaging;
@@ -64,7 +64,7 @@
{
checkResource(ObjectNames.getDivertObjectName(new SimpleString(divertConfig.getName())));
- DivertControlMBean divertControl = createManagementControl(divertConfig.getName());
+ DivertControl divertControl = createManagementControl(divertConfig.getName());
assertEquals(divertConfig.getFilterString(), divertControl.getFilter());
@@ -126,7 +126,7 @@
super.tearDown();
}
- protected DivertControlMBean createManagementControl(String name) throws Exception
+ protected DivertControl createManagementControl(String name) throws Exception
{
return ManagementControlHelper.createDivertControl(name, mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/DivertControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.client.ClientSessionFactory;
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.DivertControlMBean;
+import org.jboss.messaging.core.management.DivertControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -53,13 +53,13 @@
// DivertControlTest overrides --------------------------------
@Override
- protected DivertControlMBean createManagementControl(final String name) throws Exception
+ protected DivertControl createManagementControl(final String name) throws Exception
{
ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(InVMConnectorFactory.class.getName()));
session = sf.createSession(false, true, true);
session.start();
- return new DivertControlMBean()
+ return new DivertControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
ResourceNames.CORE_DIVERT + name);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/ManagementControlHelper.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -28,20 +28,20 @@
import javax.management.MBeanServerInvocationHandler;
import javax.management.ObjectName;
-import org.jboss.messaging.core.management.AcceptorControlMBean;
-import org.jboss.messaging.core.management.AddressControlMBean;
-import org.jboss.messaging.core.management.BridgeControlMBean;
-import org.jboss.messaging.core.management.BroadcastGroupControlMBean;
-import org.jboss.messaging.core.management.ClusterConnectionControlMBean;
-import org.jboss.messaging.core.management.DiscoveryGroupControlMBean;
-import org.jboss.messaging.core.management.DivertControlMBean;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.AcceptorControl;
+import org.jboss.messaging.core.management.AddressControl;
+import org.jboss.messaging.core.management.BridgeControl;
+import org.jboss.messaging.core.management.BroadcastGroupControl;
+import org.jboss.messaging.core.management.ClusterConnectionControl;
+import org.jboss.messaging.core.management.DiscoveryGroupControl;
+import org.jboss.messaging.core.management.DivertControl;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.core.management.QueueControlMBean;
-import org.jboss.messaging.jms.server.management.ConnectionFactoryControlMBean;
-import org.jboss.messaging.jms.server.management.JMSQueueControlMBean;
-import org.jboss.messaging.jms.server.management.JMSServerControlMBean;
-import org.jboss.messaging.jms.server.management.TopicControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
+import org.jboss.messaging.jms.server.management.ConnectionFactoryControl;
+import org.jboss.messaging.jms.server.management.JMSQueueControl;
+import org.jboss.messaging.jms.server.management.JMSServerControl;
+import org.jboss.messaging.jms.server.management.TopicControl;
import org.jboss.messaging.utils.SimpleString;
/**
@@ -59,99 +59,99 @@
// Static --------------------------------------------------------
- public static AcceptorControlMBean createAcceptorControl(String name, MBeanServer mbeanServer) throws Exception
+ public static AcceptorControl createAcceptorControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (AcceptorControlMBean)createProxy(ObjectNames.getAcceptorObjectName(name),
- AcceptorControlMBean.class,
+ return (AcceptorControl)createProxy(ObjectNames.getAcceptorObjectName(name),
+ AcceptorControl.class,
mbeanServer);
}
- public static BroadcastGroupControlMBean createBroadcastGroupControl(String name, MBeanServer mbeanServer) throws Exception
+ public static BroadcastGroupControl createBroadcastGroupControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (BroadcastGroupControlMBean)createProxy(ObjectNames.getBroadcastGroupObjectName(name),
- BroadcastGroupControlMBean.class,
+ return (BroadcastGroupControl)createProxy(ObjectNames.getBroadcastGroupObjectName(name),
+ BroadcastGroupControl.class,
mbeanServer);
}
- public static DiscoveryGroupControlMBean createDiscoveryGroupControl(String name, MBeanServer mbeanServer) throws Exception
+ public static DiscoveryGroupControl createDiscoveryGroupControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (DiscoveryGroupControlMBean)createProxy(ObjectNames.getDiscoveryGroupObjectName(name),
- DiscoveryGroupControlMBean.class,
+ return (DiscoveryGroupControl)createProxy(ObjectNames.getDiscoveryGroupObjectName(name),
+ DiscoveryGroupControl.class,
mbeanServer);
}
- public static BridgeControlMBean createBridgeControl(String name, MBeanServer mbeanServer) throws Exception
+ public static BridgeControl createBridgeControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (BridgeControlMBean)createProxy(ObjectNames.getBridgeObjectName(name),
- BridgeControlMBean.class,
+ return (BridgeControl)createProxy(ObjectNames.getBridgeObjectName(name),
+ BridgeControl.class,
mbeanServer);
}
- public static DivertControlMBean createDivertControl(String name, MBeanServer mbeanServer) throws Exception
+ public static DivertControl createDivertControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (DivertControlMBean)createProxy(ObjectNames.getDivertObjectName(new SimpleString(name)),
- DivertControlMBean.class,
+ return (DivertControl)createProxy(ObjectNames.getDivertObjectName(new SimpleString(name)),
+ DivertControl.class,
mbeanServer);
}
- public static ClusterConnectionControlMBean createClusterConnectionControl(String name, MBeanServer mbeanServer) throws Exception
+ public static ClusterConnectionControl createClusterConnectionControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (ClusterConnectionControlMBean)createProxy(ObjectNames.getClusterConnectionObjectName(name),
- ClusterConnectionControlMBean.class,
+ return (ClusterConnectionControl)createProxy(ObjectNames.getClusterConnectionObjectName(name),
+ ClusterConnectionControl.class,
mbeanServer);
}
- public static MessagingServerControlMBean createMessagingServerControl(MBeanServer mbeanServer) throws Exception
+ public static MessagingServerControl createMessagingServerControl(MBeanServer mbeanServer) throws Exception
{
- return (MessagingServerControlMBean)createProxy(ObjectNames.getMessagingServerObjectName(),
- MessagingServerControlMBean.class,
+ return (MessagingServerControl)createProxy(ObjectNames.getMessagingServerObjectName(),
+ MessagingServerControl.class,
mbeanServer);
}
- public static QueueControlMBean createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
+ public static QueueControl createQueueControl(SimpleString address, SimpleString name, MBeanServer mbeanServer) throws Exception
{
- return (QueueControlMBean)createProxy(ObjectNames.getQueueObjectName(address, name),
- QueueControlMBean.class,
+ return (QueueControl)createProxy(ObjectNames.getQueueObjectName(address, name),
+ QueueControl.class,
mbeanServer);
}
- public static AddressControlMBean createAddressControl(SimpleString address, MBeanServer mbeanServer) throws Exception
+ public static AddressControl createAddressControl(SimpleString address, MBeanServer mbeanServer) throws Exception
{
- return (AddressControlMBean)createProxy(ObjectNames.getAddressObjectName(address),
- AddressControlMBean.class,
+ return (AddressControl)createProxy(ObjectNames.getAddressObjectName(address),
+ AddressControl.class,
mbeanServer);
}
- public static JMSQueueControlMBean createJMSQueueControl(Queue queue, MBeanServer mbeanServer) throws Exception
+ public static JMSQueueControl createJMSQueueControl(Queue queue, MBeanServer mbeanServer) throws Exception
{
return createJMSQueueControl(queue.getQueueName(), mbeanServer);
}
- public static JMSQueueControlMBean createJMSQueueControl(String name, MBeanServer mbeanServer) throws Exception
+ public static JMSQueueControl createJMSQueueControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (JMSQueueControlMBean)createProxy(ObjectNames.getJMSQueueObjectName(name),
- JMSQueueControlMBean.class,
+ return (JMSQueueControl)createProxy(ObjectNames.getJMSQueueObjectName(name),
+ JMSQueueControl.class,
mbeanServer);
}
- public static JMSServerControlMBean createJMSServerControl(MBeanServer mbeanServer) throws Exception
+ public static JMSServerControl createJMSServerControl(MBeanServer mbeanServer) throws Exception
{
- return (JMSServerControlMBean)createProxy(ObjectNames.getJMSServerObjectName(),
- JMSServerControlMBean.class,
+ return (JMSServerControl)createProxy(ObjectNames.getJMSServerObjectName(),
+ JMSServerControl.class,
mbeanServer);
}
- public static ConnectionFactoryControlMBean createConnectionFactoryControl(String name, MBeanServer mbeanServer) throws Exception
+ public static ConnectionFactoryControl createConnectionFactoryControl(String name, MBeanServer mbeanServer) throws Exception
{
- return (ConnectionFactoryControlMBean)createProxy(ObjectNames.getConnectionFactoryObjectName(name),
- ConnectionFactoryControlMBean.class,
+ return (ConnectionFactoryControl)createProxy(ObjectNames.getConnectionFactoryObjectName(name),
+ ConnectionFactoryControl.class,
mbeanServer);
}
- public static TopicControlMBean createTopicControl(Topic topic, MBeanServer mbeanServer) throws Exception
+ public static TopicControl createTopicControl(Topic topic, MBeanServer mbeanServer) throws Exception
{
- return (TopicControlMBean)createProxy(ObjectNames.getJMSTopicObjectName(topic.getTopicName()),
- TopicControlMBean.class,
+ return (TopicControl)createProxy(ObjectNames.getJMSTopicObjectName(topic.getTopicName()),
+ TopicControl.class,
mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -29,9 +29,9 @@
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.TransportConfiguration;
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ObjectNames;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.QueueControl;
import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
import org.jboss.messaging.core.server.Messaging;
@@ -69,7 +69,7 @@
public void testGetAttributes() throws Exception
{
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
assertEquals(server.getVersion().getFullVersion(), serverControl.getVersion());
@@ -115,7 +115,7 @@
public void testGetConnectors() throws Exception
{
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
Object[] connectorData = serverControl.getConnectors();
assertNotNull(connectorData);
@@ -131,14 +131,14 @@
SimpleString address = RandomUtil.randomSimpleString();
SimpleString name = RandomUtil.randomSimpleString();
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
checkNoResource(ObjectNames.getQueueObjectName(address, name));
serverControl.createQueue(address.toString(), name.toString());
checkResource(ObjectNames.getQueueObjectName(address, name));
- QueueControlMBean queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
+ QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
assertEquals(address.toString(), queueControl.getAddress());
assertEquals(name.toString(), queueControl.getName());
assertNull(queueControl.getFilter());
@@ -157,14 +157,14 @@
String filter = "color = 'green'";
boolean durable = true;
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
checkNoResource(ObjectNames.getQueueObjectName(address, name));
serverControl.createQueue(address.toString(), name.toString(), filter, durable);
checkResource(ObjectNames.getQueueObjectName(address, name));
- QueueControlMBean queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
+ QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
assertEquals(address.toString(), queueControl.getAddress());
assertEquals(name.toString(), queueControl.getName());
assertEquals(filter, queueControl.getFilter());
@@ -183,14 +183,14 @@
String filter = null;
boolean durable = true;
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
checkNoResource(ObjectNames.getQueueObjectName(address, name));
serverControl.createQueue(address.toString(), name.toString(), filter, durable);
checkResource(ObjectNames.getQueueObjectName(address, name));
- QueueControlMBean queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
+ QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name, mbeanServer);
assertEquals(address.toString(), queueControl.getAddress());
assertEquals(name.toString(), queueControl.getName());
assertNull(queueControl.getFilter());
@@ -204,7 +204,7 @@
public void testMessageCounterMaxDayCount() throws Exception
{
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
assertEquals(MessageCounterManagerImpl.DEFAULT_MAX_DAY_COUNT, serverControl.getMessageCounterMaxDayCount());
@@ -236,7 +236,7 @@
public void testGetMessageCounterSamplePeriod() throws Exception
{
- MessagingServerControlMBean serverControl = createManagementControl();
+ MessagingServerControl serverControl = createManagementControl();
assertEquals(MessageCounterManagerImpl.DEFAULT_SAMPLE_PERIOD, serverControl.getMessageCounterSamplePeriod());
@@ -307,7 +307,7 @@
super.tearDown();
}
- protected MessagingServerControlMBean createManagementControl() throws Exception
+ protected MessagingServerControl createManagementControl() throws Exception
{
return ManagementControlHelper.createMessagingServerControl(mbeanServer);
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -27,7 +27,7 @@
import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
import org.jboss.messaging.core.config.Configuration;
import org.jboss.messaging.core.config.TransportConfiguration;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory;
@@ -73,10 +73,10 @@
}
@Override
- protected MessagingServerControlMBean createManagementControl() throws Exception
+ protected MessagingServerControl createManagementControl() throws Exception
{
- return new MessagingServerControlMBean()
+ return new MessagingServerControl()
{
private final CoreMessagingProxy proxy = new CoreMessagingProxy(session,
ResourceNames.CORE_SERVER);
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -43,8 +43,8 @@
import org.jboss.messaging.core.config.impl.ConfigurationImpl;
import org.jboss.messaging.core.management.DayCounterInfo;
import org.jboss.messaging.core.management.MessageCounterInfo;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
-import org.jboss.messaging.core.management.QueueControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
+import org.jboss.messaging.core.management.QueueControl;
import org.jboss.messaging.core.message.impl.MessageImpl;
import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -86,7 +86,7 @@
session.createQueue(address, queue, filter, durable);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(queue.toString(), queueControl.getName());
assertEquals(address.toString(), queueControl.getAddress());
assertEquals(filter.toString(), queueControl.getFilter());
@@ -104,7 +104,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(queue.toString(), queueControl.getName());
assertEquals(null, queueControl.getFilter());
@@ -119,7 +119,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertNull(queueControl.getDeadLetterAddress());
server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings()
@@ -144,7 +144,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
queueControl.setDeadLetterAddress(deadLetterAddress);
assertEquals(deadLetterAddress, queueControl.getDeadLetterAddress());
@@ -160,7 +160,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertNull(queueControl.getExpiryAddress());
server.getAddressSettingsRepository().addMatch(address.toString(), new AddressSettings()
@@ -185,7 +185,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
queueControl.setExpiryAddress(expiryAddress);
assertEquals(expiryAddress, queueControl.getExpiryAddress());
@@ -200,7 +200,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(0, queueControl.getConsumerCount());
@@ -220,7 +220,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(0, queueControl.getMessageCount());
ClientProducer producer = session.createProducer(address);
@@ -241,7 +241,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(0, queueControl.getMessagesAdded());
ClientProducer producer = session.createProducer(address);
@@ -265,7 +265,7 @@
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(0, queueControl.getScheduledCount());
ClientProducer producer = session.createProducer(address);
@@ -292,7 +292,7 @@
int intValue = randomInt();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
ClientProducer producer = session.createProducer(address);
ClientMessage message = session.createClientMessage(false);
@@ -327,7 +327,7 @@
ClientProducer producer = session.createProducer(address);
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(0, queueControl.getDeliveringCount());
ClientConsumer consumer = session.createConsumer(queue);
@@ -350,7 +350,7 @@
int intValue = randomInt();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
ClientProducer producer = session.createProducer(address);
ClientMessage message = session.createClientMessage(false);
@@ -381,7 +381,7 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
ClientProducer producer = session.createProducer(address);
ClientMessage matchingMessage = session.createClientMessage(false);
@@ -430,7 +430,7 @@
message.putLongProperty(key, value);
producer.send(message);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.getMessageCount());
// moved all messages to otherQueue
@@ -469,7 +469,7 @@
message.putLongProperty(key, value);
producer.send(message);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.getMessageCount());
// moved all messages to unknown queue
@@ -520,7 +520,7 @@
unmatchingMessage.putLongProperty(key, unmatchingValue);
producer.send(unmatchingMessage);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(2, queueControl.getMessageCount());
// moved matching messages to otherQueue
@@ -564,8 +564,8 @@
producer.send(session.createClientMessage(false));
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
- QueueControlMBean otherQueueControl = createManagementControl(otherAddress, otherQueue);
+ QueueControl queueControl = createManagementControl(address, queue);
+ QueueControl otherQueueControl = createManagementControl(otherAddress, otherQueue);
assertEquals(2, queueControl.getMessageCount());
assertEquals(0, otherQueueControl.getMessageCount());
@@ -598,7 +598,7 @@
// send 2 messages on queue
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.getMessageCount());
// the message IDs are set on the server
@@ -642,7 +642,7 @@
producer.send(session.createClientMessage(false));
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(2, queueControl.getMessageCount());
// delete all messages
@@ -684,7 +684,7 @@
unmatchingMessage.putLongProperty(key, unmatchingValue);
producer.send(unmatchingMessage);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(2, queueControl.getMessageCount());
// removed matching messages to otherQueue
@@ -720,7 +720,7 @@
producer.send(session.createClientMessage(false));
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(2, queueControl.getMessageCount());
// the message IDs are set on the server
@@ -760,7 +760,7 @@
producer.send(unmatchingMessage);
producer.send(matchingMessage);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(3, queueControl.getMessageCount());
assertEquals(2, queueControl.countMessages(key + " =" + matchingValue));
@@ -789,7 +789,7 @@
unmatchingMessage.putLongProperty(key, unmatchingValue);
producer.send(unmatchingMessage);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(2, queueControl.getMessageCount());
int expiredMessagesCount = queueControl.expireMessages(key + " =" + matchingValue);
@@ -827,8 +827,8 @@
// send on queue
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
- QueueControlMBean expiryQueueControl = createManagementControl(expiryAddress, expiryQueue);
+ QueueControl queueControl = createManagementControl(address, queue);
+ QueueControl expiryQueueControl = createManagementControl(expiryAddress, expiryQueue);
assertEquals(1, queueControl.getMessageCount());
assertEquals(0, expiryQueueControl.getMessageCount());
@@ -866,8 +866,8 @@
producer.send(session.createClientMessage(false));
producer.send(session.createClientMessage(false));
- QueueControlMBean queueControl = createManagementControl(address, queue);
- QueueControlMBean deadLetterQueueControl = createManagementControl(deadLetterAddress, deadLetterQueue);
+ QueueControl queueControl = createManagementControl(address, queue);
+ QueueControl deadLetterQueueControl = createManagementControl(deadLetterAddress, deadLetterQueue);
assertEquals(2, queueControl.getMessageCount());
// the message IDs are set on the server
@@ -908,7 +908,7 @@
message.setPriority(originalPriority);
producer.send(message);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.getMessageCount());
// the message IDs are set on the server
@@ -941,7 +941,7 @@
ClientMessage message = session.createClientMessage(false);
producer.send(message);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
assertEquals(1, queueControl.getMessageCount());
// the message IDs are set on the server
@@ -973,9 +973,9 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
@@ -1025,9 +1025,9 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
@@ -1077,7 +1077,7 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
String history = queueControl.listMessageCounterAsHTML();
assertNotNull(history);
@@ -1092,9 +1092,9 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(counterPeriod);
@@ -1112,9 +1112,9 @@
SimpleString queue = randomSimpleString();
session.createQueue(address, queue, null, false);
- QueueControlMBean queueControl = createManagementControl(address, queue);
+ QueueControl queueControl = createManagementControl(address, queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(counterPeriod);
@@ -1157,9 +1157,9 @@
super.tearDown();
}
- protected QueueControlMBean createManagementControl(SimpleString address, SimpleString queue) throws Exception
+ protected QueueControl createManagementControl(SimpleString address, SimpleString queue) throws Exception
{
- QueueControlMBean queueControl = createQueueControl(address, queue, mbeanServer);
+ QueueControl queueControl = createQueueControl(address, queue, mbeanServer);
return queueControl;
}
Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java 2009-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/QueueControlUsingCoreTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -45,7 +45,7 @@
import org.jboss.messaging.core.logging.Logger;
import org.jboss.messaging.core.management.DayCounterInfo;
import org.jboss.messaging.core.management.MessageCounterInfo;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.core.management.ResourceNames;
import org.jboss.messaging.core.message.impl.MessageImpl;
import org.jboss.messaging.core.messagecounter.impl.MessageCounterManagerImpl;
@@ -1004,7 +1004,7 @@
session.createQueue(address, queue, null, false);
CoreMessagingProxy proxy = createProxy(queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
@@ -1055,7 +1055,7 @@
session.createQueue(address, queue, null, false);
CoreMessagingProxy proxy = createProxy(queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(MessageCounterManagerImpl.MIN_SAMPLE_PERIOD);
@@ -1121,7 +1121,7 @@
session.createQueue(address, queue, null, false);
CoreMessagingProxy proxy = createProxy(queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(counterPeriod);
@@ -1141,7 +1141,7 @@
session.createQueue(address, queue, null, false);
CoreMessagingProxy proxy = createProxy(queue);
- MessagingServerControlMBean serverControl = createMessagingServerControl(mbeanServer);
+ MessagingServerControl serverControl = createMessagingServerControl(mbeanServer);
serverControl.enableMessageCounters();
serverControl.setMessageCounterSamplePeriod(counterPeriod);
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-06-10 12:46:38 UTC (rev 7293)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java 2009-06-10 14:30:03 UTC (rev 7294)
@@ -26,7 +26,7 @@
import org.jboss.messaging.core.config.cluster.QueueConfiguration;
import org.jboss.messaging.core.deployers.DeploymentManager;
import org.jboss.messaging.core.deployers.impl.QueueDeployer;
-import org.jboss.messaging.core.management.MessagingServerControlMBean;
+import org.jboss.messaging.core.management.MessagingServerControl;
import org.jboss.messaging.tests.util.UnitTestCase;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
@@ -135,7 +135,7 @@
// Inner classes -------------------------------------------------
- private class FakeServerControl implements MessagingServerControlMBean
+ private class FakeServerControl implements MessagingServerControl
{
public int getThreadPoolMaxSize()
More information about the jboss-cvs-commits
mailing list