[hornetq-commits] JBoss hornetq SVN: r8674 - in trunk: docs/user-manual/en and 20 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Dec 11 08:18:03 EST 2009


Author: jmesnil
Date: 2009-12-11 08:18:01 -0500 (Fri, 11 Dec 2009)
New Revision: 8674

Added:
   trunk/src/main/org/hornetq/jms/management/
   trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java
   trunk/src/main/org/hornetq/jms/management/DestinationControl.java
   trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java
   trunk/src/main/org/hornetq/jms/management/JMSServerControl.java
   trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java
   trunk/src/main/org/hornetq/jms/management/TopicControl.java
   trunk/src/main/org/hornetq/jms/management/impl/
   trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java
   trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java
   trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java
   trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java
   trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java
Removed:
   trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java
   trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
   trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
   trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java
   trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java
   trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
Modified:
   trunk/build-hornetq.xml
   trunk/docs/user-manual/en/management.xml
   trunk/examples/jms/client-kickoff/readme.html
   trunk/examples/jms/jmx/readme.html
   trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java
   trunk/examples/jms/management/readme.html
   trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java
   trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java
   trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java
   trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java
   trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
   trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
   trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
   trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
   trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java
   trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java
   trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
   trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java
   trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
   trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
   trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java
   trunk/src/main/org/hornetq/jms/client/HornetQSession.java
   trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
   trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java
   trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java
   trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
   trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
   trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java
   trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc

* moved JMS management API to org.hornetq.jms.management
* added javadoc for JMS management API

+ fixed compilation error for jms-tests

Modified: trunk/build-hornetq.xml
===================================================================
--- trunk/build-hornetq.xml	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/build-hornetq.xml	2009-12-11 13:18:01 UTC (rev 8674)
@@ -683,8 +683,8 @@
          <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/*.class"/>
 	      <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/client/*.class"/>
          <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/referenceable/*.class"/>
-         <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/server/management/*.class"/>
-         <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/server/management/impl/JMSManagementHelper.class"/>
+         <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/management/*.class"/>
+         <fileset dir="${build.jms.classes.dir}" includes="org/hornetq/jms/management/impl/JMSManagementHelper.class"/>
       </jar>
 	   
    </target>
@@ -1019,7 +1019,7 @@
             <include name="org/hornetq/core/remoting/spi"/>
             <include name="org/hornetq/jms"/>
             <include name="org/hornetq/jms/client"/>
-         	<include name="org/hornetq/jms/server/management"/>
+         	<include name="org/hornetq/jms/management"/>
             <include name="org/hornetq/utils"/>
          </packageset>
          <classpath refid="javadoc.classpath"/>
@@ -1030,7 +1030,7 @@
       	<group title="HornetQ Remoting API" packages="org.hornetq.core.remoting"/>
          <group title="HornetQ Remoting SPI" packages="org.hornetq.core.remoting.spi"/>
          <group title="JMS Facade" packages="org.hornetq.jms, org.hornetq.jms.client"/>
-         <group title="JMS Management API" packages="org.hornetq.jms.server.management"/>
+         <group title="JMS Management API" packages="org.hornetq.jms.management"/>
       	<link href="http://java.sun.com/j2se/1.5.0/docs/api"/>
       	<link href="http://java.sun.com/javaee/5/docs/api/"/>
       </javadoc>

Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/docs/user-manual/en/management.xml	2009-12-11 13:18:01 UTC (rev 8674)
@@ -56,7 +56,7 @@
          </listitem>
          <listitem>
             <para><emphasis>JMS</emphasis> resources are located in the <literal
-                  >org.hornetq.jms.server.management</literal> package</para>
+                  >org.hornetq.jms.management</literal> package</para>
          </listitem>
       </itemizedlist>
       <para>The way to invoke a <emphasis>management operations</emphasis> depends whether JMX, core
@@ -504,7 +504,7 @@
       </programlisting>
       <para>and the MBean is:</para>
       <programlisting>
-   org.hornetq.jms.server.management.JMSQueueControl   
+   org.hornetq.jms.management.JMSQueueControl   
       </programlisting>
       <para>The MBean's <literal>ObjectName</literal> are built using the helper class <literal
             >org.hornetq.core.management.ObjectNameBuilder</literal>. You can also use <literal
@@ -674,7 +674,7 @@
          </listitem>
          <listitem>
             <para>use the helper class <literal
-                  >org.hornetq.jms.server.management.impl.JMSManagementHelper</literal> to fill the
+                  >org.hornetq.jms.management.impl.JMSManagementHelper</literal> to fill the
                message with the management properties</para>
          </listitem>
          <listitem>
@@ -682,7 +682,7 @@
          </listitem>
          <listitem>
             <para>use the helper class <literal
-                  >org.hornetq.jms.server.management.impl.JMSManagementHelper</literal> to retrieve
+                  >org.hornetq.jms.management.impl.JMSManagementHelper</literal> to retrieve
                the operation result from the management reply</para>
          </listitem>
       </orderedlist>

Modified: trunk/examples/jms/client-kickoff/readme.html
===================================================================
--- trunk/examples/jms/client-kickoff/readme.html	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/client-kickoff/readme.html	2009-12-11 13:18:01 UTC (rev 8674)
@@ -132,10 +132,6 @@
      
      <ul>
         <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
-        <li>HornetQ defines a set of MBeans for this core 
-            API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
-             package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
-        <li><a href="../../../docs/api/org/jboss/messaging/core/management/ObjectNameBuilder.html">ObjectNameBuilder</a> is a helper class used to build the ObjectName of HornetQ manageable resources</li>
      </ul>
   </body>
 </html>
\ No newline at end of file

Modified: trunk/examples/jms/jmx/readme.html
===================================================================
--- trunk/examples/jms/jmx/readme.html	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/jmx/readme.html	2009-12-11 13:18:01 UTC (rev 8674)
@@ -86,7 +86,7 @@
            <code>TextMessage messageReceived = (TextMessage) messageConsumer.receive(5000);</code>
         </pre>
         
-        <li>We create a <a href="../../../docs/api/org/jboss/messaging/jms/server/management/JMSQueueControl.html">JMSQueueControl</a> proxy to manage the queue on the server</li>
+        <li>We create a <code>JMSQueueControl</code> proxy to manage the queue on the server</li>
         <pre class="prettyprint">
             <code>JMSQueueControl queueControl = (JMSQueueControl)MBeanServerInvocationHandler.newProxyInstance(mbsc,
                                                                                               on,
@@ -156,10 +156,6 @@
      <ul>
         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jmx">Using Management Via JMX chapter</a></li>
         <li><a href="http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html">Java 5 Management guide</a></li>
-        <li>HornetQ defines a set of MBeans for this core 
-            API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
-             package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
-        <li><a href="../../../docs/api/org/jboss/messaging/core/management/ObjectNameBuilder.html">ObjectNameBuilder</a> is a helper class used to build the ObjectName of HornetQ manageable resources</li>
      </ul>
   </body>
 </html>
\ No newline at end of file

Modified: trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java
===================================================================
--- trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/jmx/src/org/hornetq/jms/example/JMXExample.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -32,7 +32,7 @@
 
 import org.hornetq.common.example.HornetQExample;
 import org.hornetq.core.management.ObjectNameBuilder;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
 
 /**
  * An example that shows how to manage HornetQ using JMX.

Modified: trunk/examples/jms/management/readme.html
===================================================================
--- trunk/examples/jms/management/readme.html	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/management/readme.html	2009-12-11 13:18:01 UTC (rev 8674)
@@ -93,7 +93,7 @@
         </pre>
         
         <li>a <em>management</em> message has well-defined properties that HornetQ server needs to know to perform management operations.<br />
-            We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to fill these properties:
+            We use a helper class <code>JMSManagementHelper</code> to fill these properties:
             <ul>
                 <li>The name of the resource to manage <code>jms.queue.exampleQueue</code> 
                     (i.e. <code>jms.queue</code> followed by the name of the queue as defined in <a href="server0/hornetq-jms.xml">hornetq-jms.xml</a>)</li>
@@ -109,7 +109,7 @@
             <code>Message reply = requestor.request(m);</code>
         </pre>
         
-        <li>We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to retrieve the result from the reply message:
+        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
         <pre class="prettyprint">
             <code>int messageCount = (Integer)JMSManagementHelper.getResult(reply);
             System.out.println(queue.getQueueName() + " contains " + messageCount + " messages");</code>
@@ -142,7 +142,7 @@
             System.out.println("operation invocation has succeeded: " + success);</code>
         </pre>
         
-        <li>We use a helper class <a href="../../../docs/api/org/jboss/messaging/jms/server/management/impl/JMSManagementHelper.html">JMSManagementHelper</a> to retrieve the result from the reply message:
+        <li>We use a helper class <code>JMSManagementHelper</code> to retrieve the result from the reply message:
             (in our case, the <code>removeMessage</code> method returns a boolean)</li>
         <pre class="prettyprint">
             <code>boolean messageRemoved = (Boolean)JMSManagementHelper.getResult(reply);
@@ -184,12 +184,6 @@
      
      <ul>
         <li>User Manual's <a href="../../../docs/user-manual/en/html_single/index.html#management.jms">Using Management Via JMS chapter</a></li>
-        <li>HornetQ defines a set of resources for this core 
-            API (<a href="../../../docs/api/org/jboss/messaging/core/management/package-summary.html">org.hornetq.core.management</a>
-             package) and its JMS API (in the <a href="../../../docs/api/org/jboss/messaging/jms/server/management/package-summary.html">org.hornetq.jms.server.management</a> package)
-         <li><a href="../../../docs/api/org/jboss/messaging/core/management/ResourceNames.html">ResourceNames</a> is a helper class used to build the name of HornetQ resources by messages<br />
-            The convention is simple: <code>jms.queue.</code> followed by the name of the queue for a JMS queue, <code>jms.topic.</code> followed by the name of a topic for a JMS topic, etc.<br />
-            The name for the JMS server resource is <code>jms.server</code></li>
-     </p>
+     </ul>
   </body>
 </html>
\ No newline at end of file

Modified: trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java
===================================================================
--- trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/management/src/org/hornetq/jms/example/ManagementExample.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,7 +26,7 @@
 
 import org.hornetq.common.example.HornetQExample;
 import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
 
 /**
  * An example that shows how to manage HornetQ using JMS messages.

Modified: trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java
===================================================================
--- trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/message-counters/src/org/hornetq/jms/example/MessageCounterExample.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -33,7 +33,7 @@
 import org.hornetq.common.example.HornetQExample;
 import org.hornetq.core.management.MessageCounterInfo;
 import org.hornetq.core.management.ObjectNameBuilder;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
 
 /**
  * An example showing how to use message counters to have information on a queue.

Modified: trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java
===================================================================
--- trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/pre-acknowledge/src/org/hornetq/jms/example/PreacknowledgeExample.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -28,7 +28,7 @@
 import org.hornetq.common.example.HornetQExample;
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.client.HornetQSession;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
 
 /**
  * 

Modified: trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java
===================================================================
--- trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/examples/jms/reattach-node/src/org/hornetq/jms/example/ReattachExample.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -24,7 +24,7 @@
 
 import org.hornetq.common.example.HornetQExample;
 import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
 
 /**
  * This examples demonstrates a connection created to a server. Failure of the network connection is then simulated

Modified: trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -16,10 +16,10 @@
 import javax.management.ObjectName;
 
 import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
 import org.hornetq.utils.SimpleString;
 
 /**

Modified: trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQBytesMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -24,7 +24,7 @@
 import org.hornetq.core.logging.Logger;
 
 /**
- * This class implements javax.jms.BytesMessage.
+ * HornetQ implementation of a JMS BytesMessage.
  * 
  * @author Norbert Lataille (Norbert.Lataille at m4x.org)
  * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
@@ -53,7 +53,7 @@
    /*
     * This constructor is used to construct messages prior to sending
     */
-   public HornetQBytesMessage(final ClientSession session)
+   protected HornetQBytesMessage(final ClientSession session)
    {
       super(HornetQBytesMessage.TYPE, session);
    }
@@ -61,7 +61,7 @@
    /*
     * Constructor on receipt at client side
     */
-   public HornetQBytesMessage(final ClientMessage message, final ClientSession session)
+   protected HornetQBytesMessage(final ClientMessage message, final ClientSession session)
    {
       super(message, session);
    }

Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnection.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnection.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnection.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -50,6 +50,8 @@
 import org.hornetq.utils.VersionLoader;
 
 /**
+ * HornetQ implementation of a JMS Connection.
+ * 
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:ataylor at redhat.com">Andy Taylor</a>
@@ -118,7 +120,7 @@
 
    // Constructors ---------------------------------------------------------------------------------
 
-   public HornetQConnection(final String username,
+   protected HornetQConnection(final String username,
                             final String password,
                             final int connectionType,
                             final String clientID,

Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnectionFactory.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -42,6 +42,8 @@
 import org.hornetq.utils.Pair;
 
 /**
+ * HornetQ implementation of a JMS ConnectionFactory.
+ * 
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @version <tt>$Revision$</tt> $Id$

Modified: trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQConnectionMetaData.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -22,7 +22,7 @@
 import org.hornetq.core.version.Version;
 
 /**
- * Connection metadata
+ * HornetQ implementation of a JMS ConnectionMetaData.
  *
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
@@ -44,7 +44,7 @@
    // Constructors --------------------------------------------------
 
    /**
-    * Create a new HornetQRAConnectionMetaData object.
+    * Create a new HornetQConnectionMetaData object.
     */
    public HornetQConnectionMetaData(final Version serverVersion)
    {

Modified: trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMapMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,7 +29,7 @@
 import org.hornetq.utils.TypedProperties;
 
 /**
- * This class implements javax.jms.MapMessage
+ * HornetQ implementation of a JMS MapMessage.
  * 
  * @author Norbert Lataille (Norbert.Lataille at m4x.org)
  * @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
@@ -58,14 +58,14 @@
    /*
     * This constructor is used to construct messages prior to sending
     */
-   public HornetQMapMessage(final ClientSession session)
+   protected HornetQMapMessage(final ClientSession session)
    {
       super(HornetQMapMessage.TYPE, session);
 
       map = new TypedProperties();
    }
 
-   public HornetQMapMessage(final ClientMessage message, final ClientSession session)
+   protected HornetQMapMessage(final ClientMessage message, final ClientSession session)
    {
       super(message, session);
    }

Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -45,7 +45,9 @@
 import org.hornetq.utils.SimpleString;
 
 /**
- * Implementation of a JMS Message JMS Messages only live on the client side - the server only deals with MessageImpl
+ * HornetQ implementation of a JMS Message.
+ * <br>
+ * JMS Messages only live on the client side - the server only deals with MessageImpl
  * instances
  * 
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
@@ -241,7 +243,7 @@
 
    }
 
-   public HornetQMessage(final ClientSession session)
+   protected HornetQMessage(final ClientSession session)
    {
       this(HornetQMessage.TYPE, session);
    }

Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessageConsumer.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -33,10 +33,10 @@
 import org.hornetq.utils.SimpleString;
 
 /**
+ * HornetQ implementation of a JMS MessageConsumer.
+ * 
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @version <tt>$Revision$</tt>
- *
- * $Id$
  */
 public class HornetQMessageConsumer implements MessageConsumer, QueueReceiver, TopicSubscriber
 {
@@ -68,7 +68,7 @@
 
    // Constructors --------------------------------------------------
 
-   public HornetQMessageConsumer(final HornetQSession session,
+   protected HornetQMessageConsumer(final HornetQSession session,
                                  final ClientConsumer consumer,
                                  final boolean noLocal,
                                  final HornetQDestination destination,
@@ -181,7 +181,7 @@
    @Override
    public String toString()
    {
-      return "HornetQRAMessageConsumer->" + consumer;
+      return "HornetQMessageConsumer[" + consumer + "]";
    }
 
    // Package protected ---------------------------------------------

Modified: trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQMessageProducer.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -40,6 +40,8 @@
 import org.hornetq.utils.UUIDGenerator;
 
 /**
+ * HornetQ implementation of a JMS MessageProducer.
+ * 
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:ataylor at redhat.com">Andy Taylor</a>
@@ -83,7 +85,7 @@
 
    // Constructors --------------------------------------------------
 
-   public HornetQMessageProducer(final HornetQConnection jbossConn,
+   protected HornetQMessageProducer(final HornetQConnection jbossConn,
                                  final ClientProducer producer,
                                  final HornetQDestination defaultDestination,
                                  final ClientSession clientSession) throws JMSException

Modified: trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQObjectMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,8 +26,8 @@
 import org.hornetq.core.client.ClientSession;
 
 /**
- * This class implements javax.jms.ObjectMessage
- * 
+ * HornetQ implementation of a JMS ObjectMessage.
+ * <br>
  * Don't used ObjectMessage if you want good performance!
  * 
  * Serialization is slooooow!
@@ -55,12 +55,12 @@
 
    // Constructors --------------------------------------------------
 
-   public HornetQObjectMessage(final ClientSession session)
+   protected HornetQObjectMessage(final ClientSession session)
    {
       super(HornetQObjectMessage.TYPE, session);
    }
 
-   public HornetQObjectMessage(final ClientMessage message, final ClientSession session)
+   protected HornetQObjectMessage(final ClientMessage message, final ClientSession session)
    {
       super(message, session);
    }

Modified: trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQQueueBrowser.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,6 +29,8 @@
 import org.hornetq.utils.SimpleString;
 
 /**
+ * HornetQ implementation of a JMS QueueBrowser.
+ * 
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * @author <a href="mailto:andy.taylor at jboss.org">Andy Taylor</a>
  *
@@ -54,7 +56,7 @@
 
    // Constructors ---------------------------------------------------------------------------------
 
-   public HornetQQueueBrowser(final HornetQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
+   protected HornetQQueueBrowser(final HornetQQueue queue, final String messageSelector, final ClientSession session) throws JMSException
    {
       this.session = session;
       this.queue = queue;

Modified: trunk/src/main/org/hornetq/jms/client/HornetQSession.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQSession.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQSession.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -66,7 +66,8 @@
 import org.hornetq.utils.SimpleString;
 
 /**
- *
+ * HornetQ implementation of a JMS Session.
+ * <br>
  * Note that we *do not* support JMS ASF (Application Server Facilities) optional
  * constructs such as ConnectionConsumer
  *
@@ -116,7 +117,7 @@
 
    // Constructors --------------------------------------------------
 
-   public HornetQSession(final HornetQConnection connection,
+   protected HornetQSession(final HornetQConnection connection,
                          final boolean transacted,
                          final boolean xa,
                          final int ackMode,

Modified: trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQStreamMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,7 +26,7 @@
 import org.hornetq.utils.DataConstants;
 
 /**
- * This class implements javax.jms.StreamMessage.
+ * HornetQ implementation of a JMS StreamMessage.
  * 
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
  * 
@@ -56,12 +56,12 @@
 
    // Constructors --------------------------------------------------
 
-   public HornetQStreamMessage(final ClientSession session)
+   protected HornetQStreamMessage(final ClientSession session)
    {
       super(HornetQStreamMessage.TYPE, session);
    }
 
-   public HornetQStreamMessage(final ClientMessage message, final ClientSession session)
+   protected HornetQStreamMessage(final ClientMessage message, final ClientSession session)
    {
       super(message, session);
    }

Modified: trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/HornetQTextMessage.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -23,7 +23,9 @@
 import org.hornetq.utils.SimpleString;
 
 /**
- * This class implements javax.jms.TextMessage ported from SpyTextMessage in JBossMQ.
+ * HornetQ implementation of a JMS TextMessage.
+ * <br>
+ * This class was ported from SpyTextMessage in JBossMQ.
  * 
  * @author Norbert Lataille (Norbert.Lataille at m4x.org)
  * @author <a href="mailto:jason at planet57.com">Jason Dillon</a>

Modified: trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java
===================================================================
--- trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/client/JMSMessageListenerWrapper.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -41,7 +41,7 @@
 
    private final boolean transactedOrClientAck;
 
-   public JMSMessageListenerWrapper(final HornetQSession session,
+   protected JMSMessageListenerWrapper(final HornetQSession session,
                                     final ClientConsumer consumer,
                                     final MessageListener listener,
                                     final int ackMode)

Copied: trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/ConnectionFactoryControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,147 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import java.util.List;
+
+import org.hornetq.core.client.ClientSessionFactory;
+
+/**
+ * A ConnectionFactoryControl is used to manage a JMS ConnectionFactory.
+ * <br>
+ * HornetQ JMS ConnectionFactory uses an underlying ClientSessionFactory to connect to HornetQ servers.
+ * Please refer to the ClientSessionFactory for a detailed description.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:fox at redhat.com">Tim Fox</a>
+ * 
+ * @see ClientSessionFactory
+ */
+public interface ConnectionFactoryControl
+{
+   /**
+    * Returns the configuration name of this connection factory.
+    */
+   String getName();
+
+   /**
+    * Returns the JNDI bindings associated  to this connection factory.
+    */
+   List<String> getBindings();
+
+   /**
+    * Returns the Client ID of this connection factory (or {@code null}Êif it is not set.
+    */
+   String getClientID();
+
+   /**
+    * @see ClientSessionFactory#getClientFailureCheckPeriod()
+    */
+   long getClientFailureCheckPeriod();
+
+   /**
+    * @see ClientSessionFactory#getCallTimeout()
+    */
+   long getCallTimeout();
+
+   /**
+    * Returns the batch size (in bytes) between acknowledgements when using DUPS_OK_ACKNOWLEDGE mode.
+    * 
+    * @see ClientSessionFactory#getAckBatchSize()
+    * @see javax.jms.Session#DUPS_OK_ACKNOWLEDGE
+    */
+   int getDupsOKBatchSize();
+
+   /**
+    * @see ClientSessionFactory#getConsumerMaxRate()
+    */
+   int getConsumerMaxRate();
+
+   /**
+    * @see ClientSessionFactory#getConsumerWindowSize()
+    */
+   int getConsumerWindowSize();
+
+   /**
+    * @see ClientSessionFactory#getProducerMaxRate()
+    */
+   int getProducerMaxRate();
+
+   /**
+    * @see ClientSessionFactory#getConfirmationWindowSize()
+    */
+   int getConfirmationWindowSize();
+
+   /**
+    * @see ClientSessionFactory#isBlockOnAcknowledge()
+    */
+   boolean isBlockOnAcknowledge();
+
+   /**
+    * @see ClientSessionFactory#isBlockOnDurableSend()
+    */
+   boolean isBlockOnDurableSend();
+
+   /**
+    * @see ClientSessionFactory#isBlockOnNonDurableSend()
+    */
+   boolean isBlockOnNonDurableSend();
+
+   /**
+    * @see ClientSessionFactory#isPreAcknowledge()
+    */
+   boolean isPreAcknowledge();
+
+   /**
+    * @see ClientSessionFactory#getConnectionTTL()
+    */
+   long getConnectionTTL();
+
+   /**
+    * Returns the batch size (in bytes) between acknowledgements when using a transacted session.
+    * 
+    * @see ClientSessionFactory#getAckBatchSize()
+    */
+   long getTransactionBatchSize();
+
+   /**
+    * @see ClientSessionFactory#getMinLargeMessageSize()
+    */
+   long getMinLargeMessageSize();
+
+   /**
+    * @see ClientSessionFactory#isAutoGroup()
+    */
+   boolean isAutoGroup();
+
+   /**
+    * @see ClientSessionFactory#getRetryInterval()
+    */
+   long getRetryInterval();
+
+   /**
+    * @see ClientSessionFactory#getRetryIntervalMultiplier()
+    */
+   double getRetryIntervalMultiplier();
+
+   /**
+    * @see ClientSessionFactory#getReconnectAttempts()
+    */
+   int getReconnectAttempts();
+
+   /**
+    * @see ClientSessionFactory#isFailoverOnServerShutdown()
+    */
+   boolean isFailoverOnServerShutdown();
+}

Copied: trunk/src/main/org/hornetq/jms/management/DestinationControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/DestinationControl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/DestinationControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A DestinationControl is used to manage a JMS Destination.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ */
+public interface DestinationControl
+{
+   // Attributes ----------------------------------------------------
+
+   /**
+    * Returns the name of this destination.
+    */
+   String getName();
+
+   /**
+    * Returns the JNDI binding of this destination.
+    */
+   String getJNDIBinding();
+
+   /**
+    * Returns the HornetQ address corresponding to this destination.
+    */
+   String getAddress();
+
+   /**
+    * Returns whether this destination is temporary.
+    */
+   boolean isTemporary();
+
+   /**
+    * Returns the number of messages currently in this destination.
+    */
+   int getMessageCount() throws Exception;
+
+   // Operations ----------------------------------------------------
+
+   /**
+    * Removed all the messages which matches the specified JMS filter from this destination.
+    * <br>
+    * Using {@code null} or an empty filter will remove <em>all</em> messages from this destination.
+    *
+    * @return the number of removed messages
+    */
+   @Operation(desc = "Remove messages matching the given filter from the destination", impact = MBeanOperationInfo.ACTION)
+   int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+
+}
\ No newline at end of file

Copied: trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/JMSQueueControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,245 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A JMSQueueControl is used to manage a JMS queue.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ */
+public interface JMSQueueControl extends DestinationControl
+{
+   // Attributes ----------------------------------------------------
+
+   /**
+    * Returns the expiry address associated to this queue.
+    */
+   String getExpiryAddress();
+
+   /**
+    * Sets the expiry address associated to this queue to the specified expiryAddress.
+    */
+   void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception;
+
+   /**
+    * Returns the dead-letter address associated to this queue.
+    */
+   String getDeadLetterAddress();
+
+   /**
+    * Sets the dead-letter address associated to this queue to the specified deadLetterAddress.
+    */
+   void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
+
+   /**
+    * Returns the number of messages added to this queue since it was created.
+    */
+   int getMessagesAdded();
+
+   /**
+    * Returns the number of scheduled messages in this queue.
+    */
+   long getScheduledCount();
+
+   /**
+    * Returns the number of consumers consuming messages from this queue.
+    */
+   int getConsumerCount();
+
+   /**
+    * Returns the number of messages that this queue is currently delivering to its consumers.
+    */
+   int getDeliveringCount();
+
+   // Operations ----------------------------------------------------
+
+   /**
+    * Lists all the JMS messages in this queue matching the specified filter.
+    * <br>
+    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+    * <br>
+    * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+    */
+   @Operation(desc = "List all messages in the queue which matches the filter", impact = MBeanOperationInfo.INFO)
+   Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter") String filter) throws Exception;
+
+   /**
+    * Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
+    * <br>
+    * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
+    */
+   @Operation(desc = "List all messages in the queue which matches the filter and return them using JSON", impact = MBeanOperationInfo.INFO)
+   String listMessagesAsJSON(@Parameter(name = "filter", desc = "A JMS Message filter (can be empty)") String filter) throws Exception;
+
+   /**
+    * Counts the number of messages in this queue matching the specified filter.
+    * <br>
+    * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+    */
+   @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
+   int countMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
+
+   /**
+    * Removes the message corresponding to the specified message ID.
+    *
+    * @return {@code true}Êif the message was removed, {@code false} else
+    */
+   @Operation(desc = "Remove the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
+   boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+   /**
+    * Removes all the message corresponding to the specified filter.
+    * <br>
+    * Using {@code null} or an empty filter will remove <em>all</em> messages from this queue.
+    * 
+    * @return the number of removed messages
+    */
+   @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = MBeanOperationInfo.ACTION)
+   int removeMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+
+   /**
+    * Expires all the message corresponding to the specified filter.
+    * <br>
+    * Using {@code null} or an empty filter will expire <em>all</em> messages from this queue.
+    * 
+    * @return the number of expired messages
+    */
+   @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = MBeanOperationInfo.ACTION)
+   int expireMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
+
+   /**
+    * Expires the message corresponding to the specified message ID.
+    *
+    * @return {@code true}Êif the message was expired, {@code false} else
+    */
+   @Operation(desc = "Expire the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
+   boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+   /**
+    * Sends the message corresponding to the specified message ID to this queue's dead letter address.
+    *
+    * @return {@code true}Êif the message was sent to the dead letter address, {@code false} else
+    */
+   @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
+   boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
+
+   /**
+    * Sends all the message corresponding to the specified filter to this queue's dead letter address.
+    * <br>
+    * Using {@code null} or an empty filter will send <em>all</em> messages from this queue.
+    * 
+    * @return the number of sent messages
+    */
+   @Operation(desc = "Send the messages corresponding to the given filter to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
+   int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception;
+
+   /**
+    * Changes the message's priority corresponding to the specified message ID to the specified priority.
+    * 
+    * @param newPriority between 0 and 9 inclusive.
+    *
+    * @return {@code true}Êif the message priority was changed
+    */
+   @Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = MBeanOperationInfo.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;
+
+   /**
+    * Changes the priority for all the message corresponding to the specified filter to the specified priority.
+    * <br>
+    * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
+    * 
+    * @return the number of changed messages
+    */
+   @Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = MBeanOperationInfo.ACTION)
+   int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter") String filter,
+                              @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
+
+   /**
+    * Moves the message corresponding to the specified message ID to the specified other queue.
+    *
+    * @return {@code true}Êif the message was moved, {@code false} else
+    */
+   @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = MBeanOperationInfo.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;
+
+   /**
+    * Moves all the message corresponding to the specified filter  to the specified other queue.
+    * <br>
+    * Using {@code null} or an empty filter will move <em>all</em> messages from this queue.
+    * 
+    * @return the number of moved messages
+    */
+   @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = MBeanOperationInfo.ACTION)
+   int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
+                    @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
+
+   /**
+    * Lists the message counter for this queue.
+    */
+   @Operation(desc = "List the message counters", impact = MBeanOperationInfo.INFO)
+   String listMessageCounter() throws Exception;
+
+   /**
+    * Resets the message counter for this queue.
+    */
+   @Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
+   void resetMessageCounter() throws Exception;
+
+
+   /**
+    * Lists the message counter for this queue as a HTML table.
+    */
+   @Operation(desc = "List the message counters as HTML", impact = MBeanOperationInfo.INFO)
+   String listMessageCounterAsHTML() throws Exception;
+
+   /**
+    * Lists the message counter history for this queue.
+    */
+   @Operation(desc = "List the message counters history", impact = MBeanOperationInfo.INFO)
+   String listMessageCounterHistory() throws Exception;
+
+   /**
+    * Lists the message counter history for this queue as a HTML table.
+    */
+   @Operation(desc = "List the message counters history as HTML", impact = MBeanOperationInfo.INFO)
+   String listMessageCounterHistoryAsHTML() throws Exception;
+
+   /**
+    * Pauses the queue. Messages are no longer delivered to its consumers.
+    */
+   @Operation(desc = "Pause the queue.", impact = MBeanOperationInfo.ACTION)
+   void pause() throws Exception;
+
+   /**
+    * Returns whether the queue is paused.
+    */
+   @Operation(desc = "Returns true if the queue is paused.", impact = MBeanOperationInfo.INFO)
+   boolean isPaused() throws Exception;
+
+   /**
+    * Resumes the queue. Messages are again delivered to its consumers.
+    */
+   @Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
+   void resume() throws Exception;
+
+}

Copied: trunk/src/main/org/hornetq/jms/management/JMSServerControl.java (from rev 8664, trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/JMSServerControl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/JMSServerControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,316 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A JMSSserverControl is used to manage HornetQ JMS server.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ */
+public interface JMSServerControl
+{
+   // Attributes ----------------------------------------------------
+
+   /**
+    * Returns whether this server is started.
+    */
+   boolean isStarted();
+
+   /**
+    * Returns this server's version
+    */
+   String getVersion();
+
+   /**
+    * Returns the names of the JMS topics available on this server.
+    */
+   String[] getTopicNames();
+
+   /**
+    * Returns the names of the JMS queues available on this server.
+    */
+   String[] getQueueNames();
+
+   /**
+    * Returns the names of the JMS connection factories available on this server.
+    */
+   String[] getConnectionFactoryNames();
+
+   // Operations ----------------------------------------------------
+
+   @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.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 = MBeanOperationInfo.ACTION)
+   boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
+
+   @Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.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 = MBeanOperationInfo.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;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                Object[] liveConnectorsTransportClassNames,
+                                Object[] liveConnectorTransportParams,
+                                Object[] backupConnectorsTransportClassNames,
+                                Object[] backupConnectorTransportParams,
+                                String clientID,
+                                Object[] jndiBindings) throws Exception;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+                                @Parameter(name = "clientID") String clientID,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                Object[] liveConnectorsTransportClassNames,
+                                Object[] liveConnectorTransportParams,
+                                Object[] backupConnectorsTransportClassNames,
+                                Object[] backupConnectorTransportParams,
+                                String clientID,
+                                long clientFailureCheckPeriod,
+                                long connectionTTL,
+                                long callTimeout,
+                                boolean cacheLargeMessageClient,
+                                int minLargeMessageSize,
+                                int consumerWindowSize,
+                                int consumerMaxRate,
+                                int confirmationWindowSize,
+                                int producerWindowSize,
+                                int producerMaxRate,
+                                boolean blockOnAcknowledge,
+                                boolean blockOnDurableSend,
+                                boolean blockOnNonDurableSend,
+                                boolean autoGroup,
+                                boolean preAcknowledge,
+                                String loadBalancingPolicyClassName,
+                                int transactionBatchSize,
+                                int dupsOKBatchSize,
+                                boolean useGlobalPools,
+                                int scheduledThreadPoolMaxSize,
+                                int threadPoolMaxSize,
+                                long retryInterval,
+                                double retryIntervalMultiplier,
+                                long maxRetryInterval,
+                                int reconnectAttempts,
+                                boolean failoverOnServerShutdown,
+                                String groupID,
+                                Object[] jndiBindings) throws Exception;
+
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
+                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
+                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
+                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
+                                @Parameter(name = "clientID") String clientID,
+                                @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+                                @Parameter(name = "connectionTTL") long connectionTTL,
+                                @Parameter(name = "callTimeout") long callTimeout,
+                                @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
+                                @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+                                @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+                                @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+                                @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
+                                @Parameter(name = "producerWindowSize") int producerWindowSize,
+                                @Parameter(name = "producerMaxRate") int producerMaxRate,
+                                @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+                                @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
+                                @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
+                                @Parameter(name = "autoGroup") boolean autoGroup,
+                                @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+                                @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+                                @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+                                @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+                                @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+                                @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+                                @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+                                @Parameter(name = "retryInterval") long retryInterval,
+                                @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+                                @Parameter(name = "maxRetryInterval") long maxRetryInterval,
+                                @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+                                @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+                                @Parameter(name = "groupID") String groupID,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                String discoveryAddress,
+                                int discoveryPort,
+                                String clientID,
+                                Object[] bindings) throws Exception;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "discoveryAddress") String discoveryAddress,
+                                @Parameter(name = "discoveryPort") int discoveryPort,
+                                @Parameter(name = "clientID") String clientID,
+                                @Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                String discoveryAddress,
+                                int discoveryPort,
+                                String clientID,
+                                long discoveryRefreshTimeout,
+                                long clientFailureCheckPeriod,
+                                long connectionTTL,
+                                long callTimeout,
+                                boolean cacheLargeMessageClient,
+                                int minLargeMessageSize,
+                                int consumerWindowSize,
+                                int consumerMaxRate,
+                                int confirmationWindowSize,
+                                int producerWindowSize,
+                                int producerMaxRate,
+                                boolean blockOnAcknowledge,
+                                boolean blockOnDurableSend,
+                                boolean blockOnNonDurableSend,
+                                boolean autoGroup,
+                                boolean preAcknowledge,
+                                String loadBalancingPolicyClassName,
+                                int transactionBatchSize,
+                                int dupsOKBatchSize,
+                                long initialWaitTimeout,
+                                boolean useGlobalPools,
+                                int scheduledThreadPoolMaxSize,
+                                int threadPoolMaxSize,
+                                long retryInterval,
+                                double retryIntervalMultiplier,
+                                long maxRetryInterval,
+                                int reconnectAttempts,
+                                boolean failoverOnServerShutdown,
+                                String groupID,
+                                Object[] jndiBindings) throws Exception;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "discoveryAddress") String discoveryAddress,
+                                @Parameter(name = "discoveryPort") int discoveryPort,
+                                @Parameter(name = "clientID") String clientID,
+                                @Parameter(name = "discoveryRefreshTimeout") long discoveryRefreshTimeout,
+                                @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
+                                @Parameter(name = "connectionTTL") long connectionTTL,
+                                @Parameter(name = "callTimeout") long callTimeout,
+                                @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
+                                @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
+                                @Parameter(name = "consumerWindowSize") int consumerWindowSize,
+                                @Parameter(name = "consumerMaxRate") int consumerMaxRate,
+                                @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
+                                @Parameter(name = "producerWindowSize") int producerWindowSize,
+                                @Parameter(name = "producerMaxRate") int producerMaxRate,
+                                @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
+                                @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
+                                @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
+                                @Parameter(name = "autoGroup") boolean autoGroup,
+                                @Parameter(name = "preAcknowledge") boolean preAcknowledge,
+                                @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
+                                @Parameter(name = "transactionBatchSize") int transactionBatchSize,
+                                @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
+                                @Parameter(name = "initialWaitTimeout") long initialWaitTimeout,
+                                @Parameter(name = "useGlobalPools") boolean useGlobalPools,
+                                @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
+                                @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
+                                @Parameter(name = "retryInterval") long retryInterval,
+                                @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
+                                @Parameter(name = "maxRetryInterval") long maxRetryInterval,
+                                @Parameter(name = "reconnectAttempts") int reconnectAttempts,
+                                @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
+                                @Parameter(name = "groupID") String groupID,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                String liveTransportClassName,
+                                Map<String, Object> liveTransportParams,
+                                Object[] jndiBindings) throws Exception;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
+
+   void createConnectionFactory(String name,
+                                String liveTransportClassName,
+                                Map<String, Object> liveTransportParams,
+                                String clientID,
+                                Object[] jndiBindings) throws Exception;
+
+   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void createConnectionFactory(@Parameter(name = "name") String name,
+                                @Parameter(name = "liveTransportClassName") String liveTransportClassName,
+                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
+                                @Parameter(name = "clientID") String clientID,
+                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String 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 = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
+   void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
+
+   @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
+   String[] listRemoteAddresses() throws Exception;
+
+   @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.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 = MBeanOperationInfo.INFO)
+   boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
+
+   @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
+   String[] listConnectionIDs() throws Exception;
+
+   @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
+   String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
+}

Copied: trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/SubscriptionInfo.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,120 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+public class SubscriptionInfo
+{
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final String queueName;
+
+   private final String clientID;
+
+   private final String name;
+
+   private final boolean durable;
+
+   private final String selector;
+
+   private final int messageCount;
+
+   // Static --------------------------------------------------------
+
+   public static SubscriptionInfo[] from(final String jsonString) throws Exception
+   {
+      JSONArray array = new JSONArray(jsonString);
+      SubscriptionInfo[] infos = new SubscriptionInfo[array.length()];
+      for (int i = 0; i < array.length(); i++)
+      {
+         JSONObject sub = array.getJSONObject(i);
+         SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"),
+                                                      sub.optString("clientID", null),
+                                                      sub.optString("name", null),
+                                                      sub.getBoolean("durable"),
+                                                      sub.optString("selector", null),
+                                                      sub.getInt("messageCount"));
+         infos[i] = info;
+      }
+
+      return infos;
+   }
+
+   // Constructors --------------------------------------------------
+
+   private SubscriptionInfo(final String queueName,
+                            final String clientID,
+                            final String name,
+                            final boolean durable,
+                            final String selector,
+                            final int messageCount)
+   {
+      this.queueName = queueName;
+      this.clientID = clientID;
+      this.name = name;
+      this.durable = durable;
+      this.selector = selector;
+      this.messageCount = messageCount;
+   }
+
+   // Public --------------------------------------------------------
+
+   public String getQueueName()
+   {
+      return queueName;
+   }
+
+   public String getClientID()
+   {
+      return clientID;
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public boolean isDurable()
+   {
+      return durable;
+   }
+
+   public String getSelector()
+   {
+      return selector;
+   }
+
+   public int getMessageCount()
+   {
+      return messageCount;
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

Copied: trunk/src/main/org/hornetq/jms/management/TopicControl.java (from rev 8669, trunk/src/main/org/hornetq/jms/server/management/TopicControl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/TopicControl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/TopicControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management;
+
+import java.util.Map;
+
+import javax.management.MBeanOperationInfo;
+
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
+/**
+ * A TopicControl is used to manage a JMS Topic.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ */
+public interface TopicControl extends DestinationControl
+{
+   // Attributes ----------------------------------------------------
+
+   /**
+    * Returns the number of (durable and non-durable) subscribers for this topic.
+    */
+   int getSubscriptionCount();
+
+   /**
+    * Returns the number of <em>durable</em> subscribers for this topic.
+    */
+   int getDurableSubscriptionCount();
+
+   /**
+    * Returns the number of <em>non-durable</em> subscribers for this topic.
+    */
+   int getNonDurableSubscriptionCount();
+
+   /**
+    * Returns the number of messages for all <em>durable</em> subscribers for this topic.
+    */
+   int getDurableMessageCount();
+
+   /**
+    * Returns the number of messages for all <em>non-durable</em> subscribers for this topic.
+    */
+   int getNonDurableMessageCount();
+
+   // Operations ----------------------------------------------------
+
+   /**
+    * Lists all the subscriptions for this topic (both durable and non-durable).
+    */
+   @Operation(desc = "List all subscriptions")
+   Object[] listAllSubscriptions() throws Exception;
+
+   /**
+    * Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
+    * <br>
+    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+    */
+   @Operation(desc = "List all subscriptions")
+   String listAllSubscriptionsAsJSON() throws Exception;
+
+   /**
+    * Lists all the <em>durable</em> subscriptions for this topic.
+    */
+   @Operation(desc = "List only the durable subscriptions")
+   Object[] listDurableSubscriptions() throws Exception;
+
+   /**
+    * Lists all the <em>durable</em> subscriptions  using JSON serialization.
+    * <br>
+    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+    */
+   @Operation(desc = "List only the durable subscriptions")
+   String listDurableSubscriptionsAsJSON() throws Exception;
+
+   /**
+    * Lists all the <em>non-durable</em> subscriptions for this topic.
+    */
+   @Operation(desc = "List only the non durable subscriptions")
+   Object[] listNonDurableSubscriptions() throws Exception;
+
+   /**
+    * Lists all the <em>non-durable</em> subscriptions  using JSON serialization.
+    * <br>
+    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
+    */
+   @Operation(desc = "List only the non durable subscriptions")
+   String listNonDurableSubscriptionsAsJSON() throws Exception;
+
+   /**
+    * Lists all the messages in this queue matching the specified queue representing the subscription.
+    * <br>
+    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
+    */
+   @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;
+
+   /**
+    * Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
+    */
+   @Operation(desc = "List all the message for the given subscription")
+   public String listMessagesForSubscriptionAsJSON(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
+
+   /**
+    * Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
+    * <br>
+    * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
+    */
+   @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 (can be empty)") String filter) throws Exception;
+
+   /**
+    * Drops the subscription specified by the specified client ID and subscription name.
+    */
+   @Operation(desc = "Drop a durable subscription", impact = MBeanOperationInfo.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;
+
+   /**
+    * Drops all subscriptions.
+    */
+   @Operation(desc = "Drop all subscriptions from this topic", impact = MBeanOperationInfo.ACTION)
+   void dropAllSubscriptions() throws Exception;
+}

Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSConnectionFactoryControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,192 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management.impl;
+
+import java.util.List;
+
+import javax.management.MBeanInfo;
+import javax.management.NotCompliantMBeanException;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+public class JMSConnectionFactoryControlImpl extends StandardMBean implements ConnectionFactoryControl
+{
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   private final HornetQConnectionFactory cf;
+
+   private final List<String> bindings;
+
+   private final String name;
+
+   // Static --------------------------------------------------------
+
+   // Constructors --------------------------------------------------
+
+   public JMSConnectionFactoryControlImpl(final HornetQConnectionFactory cf,
+                                          final String name,
+                                          final List<String> bindings) throws NotCompliantMBeanException
+   {
+      super(ConnectionFactoryControl.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 getConfirmationWindowSize()
+   {
+      return cf.getConfirmationWindowSize();
+   }
+
+   public int getDupsOKBatchSize()
+   {
+      return cf.getDupsOKBatchSize();
+   }
+
+   public boolean isBlockOnAcknowledge()
+   {
+      return cf.isBlockOnAcknowledge();
+   }
+
+   public boolean isBlockOnNonDurableSend()
+   {
+      return cf.isBlockOnNonDurableSend();
+   }
+
+   public boolean isBlockOnDurableSend()
+   {
+      return cf.isBlockOnDurableSend();
+   }
+
+   public boolean isPreAcknowledge()
+   {
+      return cf.isPreAcknowledge();
+   }
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public long getConnectionTTL()
+   {
+      return cf.getConnectionTTL();
+   }
+
+   public int getReconnectAttempts()
+   {
+      return cf.getReconnectAttempts();
+   }
+
+   public boolean isFailoverOnServerShutdown()
+   {
+      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();
+   }
+
+   @Override
+   public MBeanInfo getMBeanInfo()
+   {
+      MBeanInfo info = super.getMBeanInfo();
+      return new MBeanInfo(info.getClassName(),
+                           info.getDescription(),
+                           info.getAttributes(),
+                           info.getConstructors(),
+                           MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class),
+                           info.getNotifications());
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java (from rev 8663, trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSManagementHelper.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management.impl;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+import org.hornetq.jms.client.HornetQMessage;
+
+/*
+ * @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 JMSManagementHelper
+{
+   // Constants -----------------------------------------------------
+
+   // Attributes ----------------------------------------------------
+
+   // Static --------------------------------------------------------
+
+   private static org.hornetq.core.message.Message getCoreMessage(final Message jmsMessage)
+   {
+      if (jmsMessage instanceof HornetQMessage == false)
+      {
+         throw new IllegalArgumentException("Cannot send a non JBoss message as a management message " + jmsMessage.getClass()
+                                                                                                                   .getName());
+      }
+
+      return ((HornetQMessage)jmsMessage).getCoreMessage();
+   }
+
+   public static void putAttribute(final Message message, final String resourceName, final String attribute) throws JMSException
+   {
+      ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
+   }
+
+   public static void putOperationInvocation(final Message message,
+                                             final String resourceName,
+                                             final String operationName) throws JMSException
+   {
+      try
+      {
+         ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
+                                                 resourceName,
+                                                 operationName);
+      }
+      catch (Exception e)
+      {
+         throw JMSManagementHelper.convertFromException(e);
+      }
+   }
+
+   private static JMSException convertFromException(final Exception e)
+   {
+      JMSException jmse = new JMSException(e.getMessage());
+
+      jmse.initCause(e);
+
+      return jmse;
+   }
+
+   public static void putOperationInvocation(final Message message,
+                                             final String resourceName,
+                                             final String operationName,
+                                             final Object... parameters) throws JMSException
+   {
+      try
+      {
+         ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
+                                                 resourceName,
+                                                 operationName,
+                                                 parameters);
+      }
+      catch (Exception e)
+      {
+         throw JMSManagementHelper.convertFromException(e);
+      }
+   }
+
+   public static boolean isOperationResult(final Message message) throws JMSException
+   {
+      return ManagementHelper.isOperationResult(JMSManagementHelper.getCoreMessage(message));
+   }
+
+   public static boolean isAttributesResult(final Message message) throws JMSException
+   {
+      return ManagementHelper.isAttributesResult(JMSManagementHelper.getCoreMessage(message));
+   }
+
+   public static boolean hasOperationSucceeded(final Message message) throws JMSException
+   {
+      return ManagementHelper.hasOperationSucceeded(JMSManagementHelper.getCoreMessage(message));
+   }
+
+   public static Object[] getResults(final Message message) throws Exception
+   {
+      return ManagementHelper.getResults(JMSManagementHelper.getCoreMessage(message));
+   }
+
+   public static Object getResult(final Message message) throws Exception
+   {
+      return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message));
+   }
+
+   // Constructors --------------------------------------------------
+
+   // Public --------------------------------------------------------
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSQueueControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,360 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management.impl;
+
+import java.util.Map;
+
+import javax.management.MBeanInfo;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.management.MessageCounterInfo;
+import org.hornetq.core.management.QueueControl;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.messagecounter.MessageCounter;
+import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
+import org.hornetq.jms.HornetQQueue;
+import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.client.SelectorTranslator;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+public class JMSQueueControlImpl extends StandardMBean implements JMSQueueControl
+{
+   // Constants -----------------------------------------------------
+
+   private static final Logger log = Logger.getLogger(JMSQueueControlImpl.class);
+
+   // Attributes ----------------------------------------------------
+
+   private final HornetQQueue managedQueue;
+
+   private final QueueControl coreQueueControl;
+
+   private final String binding;
+
+   private final MessageCounter counter;
+
+   // Static --------------------------------------------------------
+
+   /**
+    * Returns null if the string is null or empty
+    */
+   public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
+   {
+      return selectorStr == null || selectorStr.trim().length() == 0 ? null
+                                                                    : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+   }
+
+   private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
+   {
+      return HornetQMessage.HORNETQ_MESSAGE_ID + " = '" + jmsMessageID + "'";
+   }
+
+   static String toJSON(final Map<String, Object>[] messages)
+   {
+      JSONArray array = new JSONArray();
+      for (Map<String, Object> message : messages)
+      {
+         array.put(new JSONObject(message));
+      }
+      return array.toString();
+   }
+
+   // Constructors --------------------------------------------------
+
+   public JMSQueueControlImpl(final HornetQQueue managedQueue,
+                              final QueueControl coreQueueControl,
+                              final String jndiBinding,
+                              final MessageCounter counter) throws Exception
+   {
+      super(JMSQueueControl.class);
+      this.managedQueue = managedQueue;
+      this.coreQueueControl = coreQueueControl;
+      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(final String deadLetterAddress) throws Exception
+   {
+      coreQueueControl.setDeadLetterAddress(deadLetterAddress);
+   }
+
+   public String getExpiryAddress()
+   {
+      return coreQueueControl.getExpiryAddress();
+   }
+
+   public void setExpiryAddress(final String expiryAddres) throws Exception
+   {
+      coreQueueControl.setExpiryAddress(expiryAddres);
+   }
+
+   public boolean removeMessage(final String messageID) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+      int removed = coreQueueControl.removeMessages(filter);
+      if (removed != 1)
+      {
+         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+      }
+      return true;
+   }
+
+   public int removeMessages(final String filterStr) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.removeMessages(filter);
+   }
+
+   public Map<String, Object>[] listMessages(final String filterStr) throws Exception
+   {
+      try
+      {
+         String filter = JMSQueueControlImpl.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 = HornetQMessage.coreMaptoJMSMap(coreMessage);
+            jmsMessages[i++] = jmsMessage;
+         }
+         return jmsMessages;
+      }
+      catch (HornetQException e)
+      {
+         throw new IllegalStateException(e.getMessage());
+      }
+   }
+
+   public String listMessagesAsJSON(final String filter) throws Exception
+   {
+      return JMSQueueControlImpl.toJSON(listMessages(filter));
+   }
+
+   public int countMessages(final String filterStr) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.countMessages(filter);
+   }
+
+   public boolean expireMessage(final String messageID) throws Exception
+   {
+      String filter = JMSQueueControlImpl.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 = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.expireMessages(filter);
+   }
+
+   public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+      int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+      if (dead != 1)
+      {
+         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+      }
+      return true;
+   }
+
+   public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.sendMessagesToDeadLetterAddress(filter);
+   }
+
+   public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+      int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
+      if (changed != 1)
+      {
+         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+      }
+      return true;
+   }
+
+   public int changeMessagesPriority(final String filterStr, final int newPriority) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.changeMessagesPriority(filter, newPriority);
+   }
+
+   public boolean moveMessage(final String messageID, final String otherQueueName) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
+      HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
+      int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress());
+      if (moved != 1)
+      {
+         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
+      }
+
+      return true;
+   }
+
+   public int moveMessages(final String filterStr, final String otherQueueName) throws Exception
+   {
+      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
+      HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
+      return coreQueueControl.moveMessages(filter, otherQueue.getAddress());
+   }
+
+   public String listMessageCounter()
+   {
+      try
+      {
+         return MessageCounterInfo.toJSon(counter);
+      }
+      catch (Exception e)
+      {
+         throw new IllegalStateException(e);
+      }
+   }
+
+   public void resetMessageCounter() throws Exception
+   {
+      coreQueueControl.resetMessageCounter();
+   }
+
+   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 });
+   }
+
+   public boolean isPaused() throws Exception
+   {
+      return coreQueueControl.isPaused();
+   }
+
+   public void pause() throws Exception
+   {
+      coreQueueControl.pause();
+   }
+
+   public void resume() throws Exception
+   {
+      coreQueueControl.resume();
+   }
+
+   @Override
+   public MBeanInfo getMBeanInfo()
+   {
+      MBeanInfo info = super.getMBeanInfo();
+      return new MBeanInfo(info.getClassName(),
+                           info.getDescription(),
+                           info.getAttributes(),
+                           info.getConstructors(),
+                           MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class),
+                           info.getNotifications());
+   }
+   
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   // Inner classes -------------------------------------------------
+}

Copied: trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSServerControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,820 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.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.MBeanInfo;
+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 javax.management.StandardMBean;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.jms.server.JMSServerManager;
+import org.hornetq.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 extends StandardMBean 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(final Object[] jndiBindings)
+   {
+      List<String> bindings = new ArrayList<String>();
+      for (Object object : jndiBindings)
+      {
+         bindings.add(object.toString().trim());
+      }
+      return bindings;
+   }
+
+   private static String[] toArray(final String commaSeparatedString)
+   {
+      if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
+      {
+         return new String[0];
+      }
+      String[] values = commaSeparatedString.split(",");
+      String[] trimmed = new String[values.length];
+      for (int i = 0; i < values.length; i++)
+      {
+         trimmed[i] = values[i].trim();
+      }
+      return trimmed;
+   }
+
+   private static 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 = null;
+         if (liveConnectorTransportParams.length > i)
+         {
+            liveParams = (Map<String, Object>)liveConnectorTransportParams[i];
+         }
+
+         TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
+                                                                    liveParams);
+
+         Map<String, Object> backupParams = null;
+         if (backupConnectorTransportParams.length > i)
+         {
+            backupParams = (Map<String, Object>)backupConnectorTransportParams[i];
+         }
+
+         TransportConfiguration tcBackup = null;
+         if (backupConnectorsTransportClassNames.length > i)
+         {
+            new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(), backupParams);
+         }
+         Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
+                                                                                                                              tcBackup);
+
+         pairs.add(pair);
+      }
+
+      return pairs;
+   }
+
+   public static MBeanNotificationInfo[] getNotificationInfos()
+   {
+      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,
+                                                                     JMSServerControl.class.getName(),
+                                                                     "Notifications emitted by a JMS Server") };
+   }
+
+   // Constructors --------------------------------------------------
+
+   public JMSServerControlImpl(final JMSServerManager server) throws Exception
+   {
+      super(JMSServerControl.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 = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+                                                                                                                      liveConnectorTransportParams,
+                                                                                                                      backupConnectorsTransportClassNames,
+                                                                                                                      backupConnectorTransportParams);
+      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+      server.createConnectionFactory(name, pairs, jndiBindingsList);
+
+      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String liveTransportClassNames,
+                                       final String liveTransportParams,
+                                       final String backupTransportClassNames,
+                                       final String backupTransportParams,
+                                       final String jndiBindings) throws Exception
+   {
+      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+      createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, bindings);
+   }
+
+   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 = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+                                                                                                                      liveConnectorTransportParams,
+                                                                                                                      backupConnectorsTransportClassNames,
+                                                                                                                      backupConnectorTransportParams);
+
+      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+      server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
+
+      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String liveTransportClassNames,
+                                       final String liveTransportParams,
+                                       final String backupTransportClassNames,
+                                       final String backupTransportParams,
+                                       final String clientID,
+                                       final String jndiBindings) throws Exception
+   {
+      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
+      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
+   }
+
+   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 boolean cacheLargeMessageClient,
+                                       final int minLargeMessageSize,
+                                       final int consumerWindowSize,
+                                       final int consumerMaxRate,
+                                       final int confirmationWindowSize,
+                                       final int producerWindowSize,
+                                       final int producerMaxRate,
+                                       final boolean blockOnAcknowledge,
+                                       final boolean blockOnDurableSend,
+                                       final boolean blockOnNonDurableSend,
+                                       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 long maxRetryInterval,
+                                       final int reconnectAttempts,
+                                       final boolean failoverOnServerShutdown,
+                                       final String groupID,
+                                       final Object[] jndiBindings) throws Exception
+   {
+      List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
+                                                                                                                      liveConnectorTransportParams,
+                                                                                                                      backupConnectorsTransportClassNames,
+                                                                                                                      backupConnectorTransportParams);
+
+      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+      server.createConnectionFactory(name,
+                                     pairs,
+                                     clientID,
+                                     clientFailureCheckPeriod,
+                                     connectionTTL,
+                                     callTimeout,
+                                     cacheLargeMessageClient,
+                                     minLargeMessageSize,
+                                     consumerWindowSize,
+                                     consumerMaxRate,
+                                     confirmationWindowSize,
+                                     producerWindowSize,
+                                     producerMaxRate,
+                                     blockOnAcknowledge,
+                                     blockOnDurableSend,
+                                     blockOnNonDurableSend,
+                                     autoGroup,
+                                     preAcknowledge,
+                                     loadBalancingPolicyClassName,
+                                     transactionBatchSize,
+                                     dupsOKBatchSize,
+                                     useGlobalPools,
+                                     scheduledThreadPoolMaxSize,
+                                     threadPoolMaxSize,
+                                     retryInterval,
+                                     retryIntervalMultiplier,
+                                     maxRetryInterval,
+                                     reconnectAttempts,
+                                     failoverOnServerShutdown,
+                                     groupID,
+                                     jndiBindingsList);
+
+      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String liveTransportClassNames,
+                                       final String liveTransportParams,
+                                       final String backupTransportClassNames,
+                                       final String backupTransportParams,
+                                       final String clientID,
+                                       final long clientFailureCheckPeriod,
+                                       final long connectionTTL,
+                                       final long callTimeout,
+                                       final boolean cacheLargeMessageClient,
+                                       final int minLargeMessageSize,
+                                       final int consumerWindowSize,
+                                       final int consumerMaxRate,
+                                       final int confirmationWindowSize,
+                                       final int producerWindowSize,
+                                       final int producerMaxRate,
+                                       final boolean blockOnAcknowledge,
+                                       final boolean blockOnDurableSend,
+                                       final boolean blockOnNonDurableSend,
+                                       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 long maxRetryInterval,
+                                       final int reconnectAttempts,
+                                       final boolean failoverOnServerShutdown,
+                                       final String groupID,
+                                       final String jndiBindings) throws Exception
+   {
+      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
+      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
+      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
+      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);
+      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name,
+                              liveClassNames,
+                              liveParams,
+                              backupClassNames,
+                              backupParams,
+                              clientID,
+                              clientFailureCheckPeriod,
+                              connectionTTL,
+                              callTimeout,
+                              cacheLargeMessageClient,
+                              minLargeMessageSize,
+                              consumerWindowSize,
+                              consumerMaxRate,
+                              confirmationWindowSize,
+                              producerWindowSize,
+                              producerMaxRate,
+                              blockOnAcknowledge,
+                              blockOnDurableSend,
+                              blockOnNonDurableSend,
+                              autoGroup,
+                              preAcknowledge,
+                              loadBalancingPolicyClassName,
+                              transactionBatchSize,
+                              dupsOKBatchSize,
+                              useGlobalPools,
+                              scheduledThreadPoolMaxSize,
+                              threadPoolMaxSize,
+                              retryInterval,
+                              retryIntervalMultiplier,
+                              maxRetryInterval,
+                              reconnectAttempts,
+                              failoverOnServerShutdown,
+                              groupID,
+                              bindings);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String discoveryAddress,
+                                       final int discoveryPort,
+                                       final String clientID,
+                                       final Object[] jndiBindings) throws Exception
+   {
+      List<String> jndiBindingsList = JMSServerControlImpl.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 String jndiBindings) throws Exception
+   {
+      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, bindings);
+   }
+
+   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 boolean cacheLargeMessageClient,
+                                       final int minLargeMessageSize,
+                                       final int consumerWindowSize,
+                                       final int consumerMaxRate,
+                                       final int confirmationWindowSize,
+                                       final int producerWindowSize,
+                                       final int producerMaxRate,
+                                       final boolean blockOnAcknowledge,
+                                       final boolean blockOnDurableSend,
+                                       final boolean blockOnNonDurableSend,
+                                       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 long maxRetryInterval,
+                                       final int reconnectAttempts,
+                                       final boolean failoverOnServerShutdown,
+                                       final String groupID,
+                                       final Object[] jndiBindings) throws Exception
+   {
+      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+
+      server.createConnectionFactory(name,
+                                     discoveryAddress,
+                                     discoveryPort,
+                                     clientID,
+                                     discoveryRefreshTimeout,
+                                     clientFailureCheckPeriod,
+                                     connectionTTL,
+                                     callTimeout,
+                                     cacheLargeMessageClient,
+                                     minLargeMessageSize,
+                                     consumerWindowSize,
+                                     consumerMaxRate,
+                                     confirmationWindowSize,
+                                     producerWindowSize,
+                                     producerMaxRate,
+                                     blockOnAcknowledge,
+                                     blockOnDurableSend,
+                                     blockOnNonDurableSend,
+                                     autoGroup,
+                                     preAcknowledge,
+                                     loadBalancingPolicyClassName,
+                                     transactionBatchSize,
+                                     dupsOKBatchSize,
+                                     initialWaitTimeout,
+                                     useGlobalPools,
+                                     scheduledThreadPoolMaxSize,
+                                     threadPoolMaxSize,
+                                     retryInterval,
+                                     retryIntervalMultiplier,
+                                     maxRetryInterval,
+                                     reconnectAttempts,
+                                     failoverOnServerShutdown,
+                                     groupID,
+                                     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 boolean cacheLargeMessageClient,
+                                       final int minLargeMessageSize,
+                                       final int consumerWindowSize,
+                                       final int consumerMaxRate,
+                                       final int confirmationWindowSize,
+                                       final int producerWindowSize,
+                                       final int producerMaxRate,
+                                       final boolean blockOnAcknowledge,
+                                       final boolean blockOnDurableSend,
+                                       final boolean blockOnNonDurableSend,
+                                       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 long maxRetryInterval,
+                                       final int reconnectAttempts,
+                                       final boolean failoverOnServerShutdown,
+                                       final String groupID,
+                                       final String jndiBindings) throws Exception
+   {
+      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name,
+                              discoveryAddress,
+                              discoveryPort,
+                              clientID,
+                              discoveryRefreshTimeout,
+                              clientFailureCheckPeriod,
+                              connectionTTL,
+                              callTimeout,
+                              cacheLargeMessageClient,
+                              minLargeMessageSize,
+                              consumerWindowSize,
+                              consumerMaxRate,
+                              confirmationWindowSize,
+                              producerWindowSize,
+                              producerMaxRate,
+                              blockOnAcknowledge,
+                              blockOnDurableSend,
+                              blockOnNonDurableSend,
+                              autoGroup,
+                              preAcknowledge,
+                              loadBalancingPolicyClassName,
+                              transactionBatchSize,
+                              dupsOKBatchSize,
+                              initialWaitTimeout,
+                              useGlobalPools,
+                              scheduledThreadPoolMaxSize,
+                              threadPoolMaxSize,
+                              retryInterval,
+                              retryIntervalMultiplier,
+                              maxRetryInterval,
+                              reconnectAttempts,
+                              failoverOnServerShutdown,
+                              groupID,
+                              bindings);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String liveTransportClassName,
+                                       final Map<String, Object> liveTransportParams,
+                                       final Object[] jndiBindings) throws Exception
+   {
+      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
+      TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
+
+      server.createConnectionFactory(name, liveTC, jndiBindingsList);
+
+      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
+   }
+
+   public void createConnectionFactory(final String name,
+                                       final String liveTransportClassName,
+                                       final String liveTransportParams,
+                                       final String jndiBindings) throws Exception
+   {
+      Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+      String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name, liveTransportClassName, params, bindings);
+   }
+
+   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 = JMSServerControlImpl.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 String liveTransportParams,
+                                       final String clientID,
+                                       final String jndiBindings) throws Exception
+   {
+      Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
+      String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
+
+      createConnectionFactory(name, liveTransportClassName, params, clientID, bindings);
+   }
+
+   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 = JMSServerControlImpl.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 = JMSServerControlImpl.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();
+   }
+
+   public String[] getQueueNames()
+   {
+      Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
+      String[] names = new String[queueControls.length];
+      for (int i = 0; i < queueControls.length; i++)
+      {
+         JMSQueueControl queueControl = (JMSQueueControl)queueControls[i];
+         names[i] = queueControl.getName();
+      }
+      return names;
+   }
+
+   public String[] getTopicNames()
+   {
+      Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
+      String[] names = new String[topicControls.length];
+      for (int i = 0; i < topicControls.length; i++)
+      {
+         TopicControl topicControl = (TopicControl)topicControls[i];
+         names[i] = topicControl.getName();
+      }
+      return names;
+   }
+
+   public String[] getConnectionFactoryNames()
+   {
+      Object[] cfControls = server.getHornetQServer()
+                                  .getManagementService()
+                                  .getResources(ConnectionFactoryControl.class);
+      String[] names = new String[cfControls.length];
+      for (int i = 0; i < cfControls.length; i++)
+      {
+         ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
+         names[i] = cfControl.getName();
+      }
+      return names;
+   }
+
+   // 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()
+   {
+      return JMSServerControlImpl.getNotificationInfos();
+   }
+
+   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);
+   }
+
+   @Override
+   public MBeanInfo getMBeanInfo()
+   {
+      MBeanInfo info = super.getMBeanInfo();
+      return new MBeanInfo(info.getClassName(),
+                           info.getDescription(),
+                           info.getAttributes(),
+                           info.getConstructors(),
+                           MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
+                           info.getNotifications());
+   }
+
+   // 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/hornetq/jms/management/impl/JMSTopicControlImpl.java (from rev 8665, trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/jms/management/impl/JMSTopicControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -0,0 +1,371 @@
+/*
+ * Copyright 2009 Red Hat, Inc.
+ * Red Hat licenses this file to you under the Apache License, version
+ * 2.0 (the "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.  See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package org.hornetq.jms.management.impl;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+import javax.management.MBeanInfo;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.management.AddressControl;
+import org.hornetq.core.management.HornetQServerControl;
+import org.hornetq.core.management.QueueControl;
+import org.hornetq.core.management.ResourceNames;
+import org.hornetq.core.management.impl.MBeanInfoHelper;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.jms.HornetQTopic;
+import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.client.SelectorTranslator;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.utils.Pair;
+import org.hornetq.utils.json.JSONArray;
+import org.hornetq.utils.json.JSONObject;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+public class JMSTopicControlImpl extends StandardMBean implements TopicControl
+{
+   // Constants -----------------------------------------------------
+
+   private static final Logger log = Logger.getLogger(JMSTopicControlImpl.class);
+
+   // Attributes ----------------------------------------------------
+
+   private final HornetQTopic managedTopic;
+
+   private final String binding;
+
+   private final AddressControl addressControl;
+
+   private final ManagementService managementService;
+
+   // Static --------------------------------------------------------
+
+   public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
+   {
+      return selectorStr == null || selectorStr.trim().length() == 0 ? null
+                                                                    : SelectorTranslator.convertToHornetQFilterString(selectorStr);
+   }
+
+   // Constructors --------------------------------------------------
+
+   public JMSTopicControlImpl(final HornetQTopic topic,
+                              final AddressControl addressControl,
+                              final String jndiBinding,
+                              final ManagementService managementService) throws Exception
+   {
+      super(TopicControl.class);
+      managedTopic = topic;
+      this.addressControl = addressControl;
+      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 String listAllSubscriptionsAsJSON() throws Exception
+   {
+      return listSubscribersInfosAsJSON(DurabilityType.ALL);
+   }
+
+   public Object[] listDurableSubscriptions()
+   {
+      return listSubscribersInfos(DurabilityType.DURABLE);
+   }
+
+   public String listDurableSubscriptionsAsJSON() throws Exception
+   {
+      return listSubscribersInfosAsJSON(DurabilityType.DURABLE);
+   }
+
+   public Object[] listNonDurableSubscriptions()
+   {
+      return listSubscribersInfos(DurabilityType.NON_DURABLE);
+   }
+
+   public String listNonDurableSubscriptionsAsJSON() throws Exception
+   {
+      return listSubscribersInfosAsJSON(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.listMessages(null);
+
+      Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
+
+      int i = 0;
+
+      for (Map<String, Object> coreMessage : coreMessages)
+      {
+         jmsMessages[i++] = HornetQMessage.coreMaptoJMSMap(coreMessage);
+      }
+      return jmsMessages;
+   }
+
+   public String listMessagesForSubscriptionAsJSON(final String queueName) throws Exception
+   {
+      return JMSQueueControlImpl.toJSON(listMessagesForSubscription(queueName));
+   }
+
+   public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
+   {
+      String queueName = HornetQTopic.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 = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
+      return coreQueueControl.listMessages(filter).length;
+   }
+
+   public int removeMessages(final String filterStr) throws Exception
+   {
+      String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
+      int count = 0;
+      String[] queues = addressControl.getQueueNames();
+      for (String queue : queues)
+      {
+         QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
+         count += coreQueueControl.removeMessages(filter);
+      }
+
+      return count;
+   }
+
+   public void dropDurableSubscription(final String clientID, final String subscriptionName) throws Exception
+   {
+      String queueName = HornetQTopic.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);
+      }
+      HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
+      serverControl.destroyQueue(queueName);
+   }
+
+   public void dropAllSubscriptions() throws Exception
+   {
+      HornetQServerControl serverControl = (HornetQServerControl)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 = HornetQTopic.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 String listSubscribersInfosAsJSON(final DurabilityType durability) throws Exception
+   {
+      List<QueueControl> queues = getQueues(durability);
+      JSONArray array = new JSONArray();
+
+      for (QueueControl queue : queues)
+      {
+         String clientID = null;
+         String subName = null;
+
+         if (queue.isDurable())
+         {
+            Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
+                                                                                                   .toString());
+            clientID = pair.a;
+            subName = pair.b;
+         }
+
+         String filter = queue.getFilter() != null ? queue.getFilter() : null;
+
+         JSONObject info = new JSONObject();
+         info.put("queueName", queue.getName());
+         info.put("clientID", clientID);
+         info.put("selector", filter);
+         info.put("name", subName);
+         info.put("durable", queue.isDurable());
+         info.put("messageCount", queue.getMessageCount());
+         array.put(info);
+      }
+
+      return array.toString();
+   }
+
+   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();
+      }
+   }
+
+   @Override
+   public MBeanInfo getMBeanInfo()
+   {
+      MBeanInfo info = super.getMBeanInfo();
+      return new MBeanInfo(info.getClassName(),
+                           info.getDescription(),
+                           info.getAttributes(),
+                           info.getConstructors(),
+                           MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class),
+                           info.getNotifications());
+   }
+
+   // Inner classes -------------------------------------------------
+
+   private enum DurabilityType
+   {
+      ALL, DURABLE, NON_DURABLE
+   }
+}

Deleted: trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/ConnectionFactoryControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,70 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.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 getConfirmationWindowSize();
-
-   boolean isBlockOnAcknowledge();
-
-   boolean isBlockOnDurableSend();
-
-   boolean isBlockOnNonDurableSend();
-
-   boolean isPreAcknowledge();
-
-   long getConnectionTTL();
-
-   long getTransactionBatchSize();
-
-   long getMinLargeMessageSize();
-
-   boolean isAutoGroup();
-
-   long getRetryInterval();
-
-   double getRetryIntervalMultiplier();
-
-   int getReconnectAttempts();
-
-   boolean isFailoverOnNodeShutdown();
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,67 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A DestinationControl is used to manage a JMS Destination.
- * 
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- */
-public interface DestinationControl
-{
-   // Attributes ----------------------------------------------------
-
-   /**
-    * Returns the name of this destination.
-    */
-   String getName();
-
-   /**
-    * Returns the JNDI binding of this destination.
-    */
-   String getJNDIBinding();
-
-   /**
-    * Returns the HornetQ address corresponding to this destination.
-    */
-   String getAddress();
-
-   /**
-    * Returns whether this destination is temporary.
-    */
-   boolean isTemporary();
-
-   /**
-    * Returns the number of messages currently in this destination.
-    */
-   int getMessageCount() throws Exception;
-
-   // Operations ----------------------------------------------------
-
-   /**
-    * Removed all the messages which matches the specified JMS filter from this destination.
-    * <br>
-    * Using {@code null} or an empty filter will remove <em>all</em> messages from this destination.
-    *
-    * @return the number of removed messages
-    */
-   @Operation(desc = "Remove messages matching the given filter from the destination", impact = MBeanOperationInfo.ACTION)
-   int removeMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
-
-}
\ No newline at end of file

Modified: trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSManagementService.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -18,6 +18,7 @@
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.HornetQTopic;
 import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.JMSServerControl;
 import org.hornetq.jms.server.JMSServerManager;
 
 /**

Deleted: trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,245 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A JMSQueueControl is used to manage a JMS queue.
- * 
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- */
-public interface JMSQueueControl extends DestinationControl
-{
-   // Attributes ----------------------------------------------------
-
-   /**
-    * Returns the expiry address associated to this queue.
-    */
-   String getExpiryAddress();
-
-   /**
-    * Sets the expiry address associated to this queue to the specified expiryAddress.
-    */
-   void setExpiryAddress(@Parameter(name = "expiryAddress", desc = "Expiry address of the queue") String expiryAddress) throws Exception;
-
-   /**
-    * Returns the dead-letter address associated to this queue.
-    */
-   String getDeadLetterAddress();
-
-   /**
-    * Sets the dead-letter address associated to this queue to the specified deadLetterAddress.
-    */
-   void setDeadLetterAddress(@Parameter(name = "deadLetterAddress", desc = "Dead-letter address of the queue") String deadLetterAddress) throws Exception;
-
-   /**
-    * Returns the number of messages added to this queue since it was created.
-    */
-   int getMessagesAdded();
-
-   /**
-    * Returns the number of scheduled messages in this queue.
-    */
-   long getScheduledCount();
-
-   /**
-    * Returns the number of consumers consuming messages from this queue.
-    */
-   int getConsumerCount();
-
-   /**
-    * Returns the number of messages that this queue is currently delivering to its consumers.
-    */
-   int getDeliveringCount();
-
-   // Operations ----------------------------------------------------
-
-   /**
-    * Lists all the JMS messages in this queue matching the specified filter.
-    * <br>
-    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
-    * <br>
-    * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
-    */
-   @Operation(desc = "List all messages in the queue which matches the filter", impact = MBeanOperationInfo.INFO)
-   Map<String, Object>[] listMessages(@Parameter(name = "filter", desc = "A JMS Message filter") String filter) throws Exception;
-
-   /**
-    * Lists all the JMS messages in this queue matching the specified filter using JSON serialization.
-    * <br>
-    * Using {@code null} or an empty filter will list <em>all</em> messages from this queue.
-    */
-   @Operation(desc = "List all messages in the queue which matches the filter and return them using JSON", impact = MBeanOperationInfo.INFO)
-   String listMessagesAsJSON(@Parameter(name = "filter", desc = "A JMS Message filter (can be empty)") String filter) throws Exception;
-
-   /**
-    * Counts the number of messages in this queue matching the specified filter.
-    * <br>
-    * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
-    */
-   @Operation(desc = "Returns the number of the messages in the queue matching the given filter", impact = MBeanOperationInfo.INFO)
-   int countMessages(@Parameter(name = "filter", desc = "A JMS message filter (can be empty)") String filter) throws Exception;
-
-   /**
-    * Removes the message corresponding to the specified message ID.
-    *
-    * @return {@code true}Êif the message was removed, {@code false} else
-    */
-   @Operation(desc = "Remove the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
-   boolean removeMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
-   /**
-    * Removes all the message corresponding to the specified filter.
-    * <br>
-    * Using {@code null} or an empty filter will remove <em>all</em> messages from this queue.
-    * 
-    * @return the number of removed messages
-    */
-   @Operation(desc = "Remove the messages corresponding to the given filter (and returns the number of removed messages)", impact = MBeanOperationInfo.ACTION)
-   int removeMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
-
-   /**
-    * Expires all the message corresponding to the specified filter.
-    * <br>
-    * Using {@code null} or an empty filter will expire <em>all</em> messages from this queue.
-    * 
-    * @return the number of expired messages
-    */
-   @Operation(desc = "Expire the messages corresponding to the given filter (and returns the number of expired messages)", impact = MBeanOperationInfo.ACTION)
-   int expireMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter) throws Exception;
-
-   /**
-    * Expires the message corresponding to the specified message ID.
-    *
-    * @return {@code true}Êif the message was expired, {@code false} else
-    */
-   @Operation(desc = "Expire the message corresponding to the given messageID", impact = MBeanOperationInfo.ACTION)
-   boolean expireMessage(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
-   /**
-    * Sends the message corresponding to the specified message ID to this queue's dead letter address.
-    *
-    * @return {@code true}Êif the message was sent to the dead letter address, {@code false} else
-    */
-   @Operation(desc = "Send the message corresponding to the given messageID to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
-   boolean sendMessageToDeadLetterAddress(@Parameter(name = "messageID", desc = "A message ID") String messageID) throws Exception;
-
-   /**
-    * Sends all the message corresponding to the specified filter to this queue's dead letter address.
-    * <br>
-    * Using {@code null} or an empty filter will send <em>all</em> messages from this queue.
-    * 
-    * @return the number of sent messages
-    */
-   @Operation(desc = "Send the messages corresponding to the given filter to this queue's Dead Letter Address", impact = MBeanOperationInfo.ACTION)
-   int sendMessagesToDeadLetterAddress(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filterStr) throws Exception;
-
-   /**
-    * Changes the message's priority corresponding to the specified message ID to the specified priority.
-    * 
-    * @param newPriority between 0 and 9 inclusive.
-    *
-    * @return {@code true}Êif the message priority was changed
-    */
-   @Operation(desc = "Change the priority of the message corresponding to the given messageID", impact = MBeanOperationInfo.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;
-
-   /**
-    * Changes the priority for all the message corresponding to the specified filter to the specified priority.
-    * <br>
-    * Using {@code null} or an empty filter will change <em>all</em> messages from this queue.
-    * 
-    * @return the number of changed messages
-    */
-   @Operation(desc = "Change the priority of the messages corresponding to the given filter", impact = MBeanOperationInfo.ACTION)
-   int changeMessagesPriority(@Parameter(name = "filter", desc = "A message filter") String filter,
-                              @Parameter(name = "newPriority", desc = "the new priority (between 0 and 9)") int newPriority) throws Exception;
-
-   /**
-    * Moves the message corresponding to the specified message ID to the specified other queue.
-    *
-    * @return {@code true}Êif the message was moved, {@code false} else
-    */
-   @Operation(desc = "Move the message corresponding to the given messageID to another queue", impact = MBeanOperationInfo.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;
-
-   /**
-    * Moves all the message corresponding to the specified filter  to the specified other queue.
-    * <br>
-    * Using {@code null} or an empty filter will move <em>all</em> messages from this queue.
-    * 
-    * @return the number of moved messages
-    */
-   @Operation(desc = "Move the messages corresponding to the given filter (and returns the number of moved messages)", impact = MBeanOperationInfo.ACTION)
-   int moveMessages(@Parameter(name = "filter", desc = "A message filter (can be empty)") String filter,
-                    @Parameter(name = "otherQueueName", desc = "The name of the queue to move the messages to") String otherQueueName) throws Exception;
-
-   /**
-    * Lists the message counter for this queue.
-    */
-   @Operation(desc = "List the message counters", impact = MBeanOperationInfo.INFO)
-   String listMessageCounter() throws Exception;
-
-   /**
-    * Resets the message counter for this queue.
-    */
-   @Operation(desc = "Reset the message counters", impact = MBeanOperationInfo.INFO)
-   void resetMessageCounter() throws Exception;
-
-
-   /**
-    * Lists the message counter for this queue as a HTML table.
-    */
-   @Operation(desc = "List the message counters as HTML", impact = MBeanOperationInfo.INFO)
-   String listMessageCounterAsHTML() throws Exception;
-
-   /**
-    * Lists the message counter history for this queue.
-    */
-   @Operation(desc = "List the message counters history", impact = MBeanOperationInfo.INFO)
-   String listMessageCounterHistory() throws Exception;
-
-   /**
-    * Lists the message counter history for this queue as a HTML table.
-    */
-   @Operation(desc = "List the message counters history as HTML", impact = MBeanOperationInfo.INFO)
-   String listMessageCounterHistoryAsHTML() throws Exception;
-
-   /**
-    * Pauses the queue. Messages are no longer delivered to its consumers.
-    */
-   @Operation(desc = "Pause the queue.", impact = MBeanOperationInfo.ACTION)
-   void pause() throws Exception;
-
-   /**
-    * Returns whether the queue is paused.
-    */
-   @Operation(desc = "Returns true if the queue is paused.", impact = MBeanOperationInfo.INFO)
-   boolean isPaused() throws Exception;
-
-   /**
-    * Resumes the queue. Messages are again delivered to its consumers.
-    */
-   @Operation(desc = "Resume the queue.", impact = MBeanOperationInfo.ACTION)
-   void resume() throws Exception;
-
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,302 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.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();
-
-   String[] getTopicNames();
-
-   String[] getQueueNames();
-
-   String[] getConnectionFactoryNames();
-
-   // Operations ----------------------------------------------------
-
-   @Operation(desc = "Create a JMS Queue", impact = MBeanOperationInfo.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 = MBeanOperationInfo.ACTION)
-   boolean destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
-
-   @Operation(desc = "Create a JMS Topic", impact = MBeanOperationInfo.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 = MBeanOperationInfo.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;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
-                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
-                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
-                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                Object[] liveConnectorsTransportClassNames,
-                                Object[] liveConnectorTransportParams,
-                                Object[] backupConnectorsTransportClassNames,
-                                Object[] backupConnectorTransportParams,
-                                String clientID,
-                                Object[] jndiBindings) throws Exception;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
-                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
-                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
-                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
-                                @Parameter(name = "clientID") String clientID,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                Object[] liveConnectorsTransportClassNames,
-                                Object[] liveConnectorTransportParams,
-                                Object[] backupConnectorsTransportClassNames,
-                                Object[] backupConnectorTransportParams,
-                                String clientID,
-                                long clientFailureCheckPeriod,
-                                long connectionTTL,
-                                long callTimeout,
-                                boolean cacheLargeMessageClient,
-                                int minLargeMessageSize,
-                                int consumerWindowSize,
-                                int consumerMaxRate,
-                                int confirmationWindowSize,
-                                int producerWindowSize,
-                                int producerMaxRate,
-                                boolean blockOnAcknowledge,
-                                boolean blockOnDurableSend,
-                                boolean blockOnNonDurableSend,
-                                boolean autoGroup,
-                                boolean preAcknowledge,
-                                String loadBalancingPolicyClassName,
-                                int transactionBatchSize,
-                                int dupsOKBatchSize,
-                                boolean useGlobalPools,
-                                int scheduledThreadPoolMaxSize,
-                                int threadPoolMaxSize,
-                                long retryInterval,
-                                double retryIntervalMultiplier,
-                                long maxRetryInterval,
-                                int reconnectAttempts,
-                                boolean failoverOnServerShutdown,
-                                String groupID,
-                                Object[] jndiBindings) throws Exception;
-
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "liveTransportClassNames", desc = "comma-separated list of class names for transport to live servers") String liveTransportClassNames,
-                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value parameters for the live transports (enclosed between { } for each transport)") String liveTransportParams,
-                                @Parameter(name = "backupTransportClassNames", desc = "comma-separated list of class names for transport to backup servers") String backupTransportClassNames,
-                                @Parameter(name = "backupTransportParams", desc = "comma-separated list of key=value parameters for the backup transports (enclosed between { } for each transport)") String backupTransportParams,
-                                @Parameter(name = "clientID") String clientID,
-                                @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
-                                @Parameter(name = "connectionTTL") long connectionTTL,
-                                @Parameter(name = "callTimeout") long callTimeout,
-                                @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
-                                @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
-                                @Parameter(name = "consumerWindowSize") int consumerWindowSize,
-                                @Parameter(name = "consumerMaxRate") int consumerMaxRate,
-                                @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
-                                @Parameter(name = "producerWindowSize") int producerWindowSize,
-                                @Parameter(name = "producerMaxRate") int producerMaxRate,
-                                @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
-                                @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
-                                @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
-                                @Parameter(name = "autoGroup") boolean autoGroup,
-                                @Parameter(name = "preAcknowledge") boolean preAcknowledge,
-                                @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
-                                @Parameter(name = "transactionBatchSize") int transactionBatchSize,
-                                @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
-                                @Parameter(name = "useGlobalPools") boolean useGlobalPools,
-                                @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
-                                @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
-                                @Parameter(name = "retryInterval") long retryInterval,
-                                @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
-                                @Parameter(name = "maxRetryInterval") long maxRetryInterval,
-                                @Parameter(name = "reconnectAttempts") int reconnectAttempts,
-                                @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
-                                @Parameter(name = "groupID") String groupID,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                String discoveryAddress,
-                                int discoveryPort,
-                                String clientID,
-                                Object[] bindings) throws Exception;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "discoveryAddress") String discoveryAddress,
-                                @Parameter(name = "discoveryPort") int discoveryPort,
-                                @Parameter(name = "clientID") String clientID,
-                                @Parameter(name = "jndiBindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                String discoveryAddress,
-                                int discoveryPort,
-                                String clientID,
-                                long discoveryRefreshTimeout,
-                                long clientFailureCheckPeriod,
-                                long connectionTTL,
-                                long callTimeout,
-                                boolean cacheLargeMessageClient,
-                                int minLargeMessageSize,
-                                int consumerWindowSize,
-                                int consumerMaxRate,
-                                int confirmationWindowSize,
-                                int producerWindowSize,
-                                int producerMaxRate,
-                                boolean blockOnAcknowledge,
-                                boolean blockOnDurableSend,
-                                boolean blockOnNonDurableSend,
-                                boolean autoGroup,
-                                boolean preAcknowledge,
-                                String loadBalancingPolicyClassName,
-                                int transactionBatchSize,
-                                int dupsOKBatchSize,
-                                long initialWaitTimeout,
-                                boolean useGlobalPools,
-                                int scheduledThreadPoolMaxSize,
-                                int threadPoolMaxSize,
-                                long retryInterval,
-                                double retryIntervalMultiplier,
-                                long maxRetryInterval,
-                                int reconnectAttempts,
-                                boolean failoverOnServerShutdown,
-                                String groupID,
-                                Object[] jndiBindings) throws Exception;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "discoveryAddress") String discoveryAddress,
-                                @Parameter(name = "discoveryPort") int discoveryPort,
-                                @Parameter(name = "clientID") String clientID,
-                                @Parameter(name = "discoveryRefreshTimeout") long discoveryRefreshTimeout,
-                                @Parameter(name = "clientFailureCheckPeriod") long clientFailureCheckPeriod,
-                                @Parameter(name = "connectionTTL") long connectionTTL,
-                                @Parameter(name = "callTimeout") long callTimeout,
-                                @Parameter(name = "cacheLargemessageClient") boolean cacheLargeMessageClient,
-                                @Parameter(name = "minLargeMessageSize") int minLargeMessageSize,
-                                @Parameter(name = "consumerWindowSize") int consumerWindowSize,
-                                @Parameter(name = "consumerMaxRate") int consumerMaxRate,
-                                @Parameter(name = "confirmationWindowSize") int confirmationWindowSize,
-                                @Parameter(name = "producerWindowSize") int producerWindowSize,
-                                @Parameter(name = "producerMaxRate") int producerMaxRate,
-                                @Parameter(name = "blockOnAcknowledge") boolean blockOnAcknowledge,
-                                @Parameter(name = "blockOnDurableSend") boolean blockOnDurableSend,
-                                @Parameter(name = "blockOnNonDurableSend") boolean blockOnNonDurableSend,
-                                @Parameter(name = "autoGroup") boolean autoGroup,
-                                @Parameter(name = "preAcknowledge") boolean preAcknowledge,
-                                @Parameter(name = "loadBalancingPolicyClassName") String loadBalancingPolicyClassName,
-                                @Parameter(name = "transactionBatchSize") int transactionBatchSize,
-                                @Parameter(name = "dupsOKBatchSize") int dupsOKBatchSize,
-                                @Parameter(name = "initialWaitTimeout") long initialWaitTimeout,
-                                @Parameter(name = "useGlobalPools") boolean useGlobalPools,
-                                @Parameter(name = "scheduledThreadPoolMaxSize") int scheduledThreadPoolMaxSize,
-                                @Parameter(name = "threadPoolMaxSize") int threadPoolMaxSize,
-                                @Parameter(name = "retryInterval") long retryInterval,
-                                @Parameter(name = "retryIntervalMultiplier") double retryIntervalMultiplier,
-                                @Parameter(name = "maxRetryInterval") long maxRetryInterval,
-                                @Parameter(name = "reconnectAttempts") int reconnectAttempts,
-                                @Parameter(name = "failoverOnServerShutdown") boolean failoverOnServerShutdown,
-                                @Parameter(name = "groupID") String groupID,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                String liveTransportClassName,
-                                Map<String, Object> liveTransportParams,
-                                Object[] jndiBindings) throws Exception;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "liveTransportClassName") String liveTransportClassName,
-                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String jndiBindings) throws Exception;
-
-   void createConnectionFactory(String name,
-                                String liveTransportClassName,
-                                Map<String, Object> liveTransportParams,
-                                String clientID,
-                                Object[] jndiBindings) throws Exception;
-
-   @Operation(desc = "Create a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void createConnectionFactory(@Parameter(name = "name") String name,
-                                @Parameter(name = "liveTransportClassName") String liveTransportClassName,
-                                @Parameter(name = "liveTransportParams", desc = "comma-separated list of key=value for the transport parameters") String liveTransportParams,
-                                @Parameter(name = "clientID") String clientID,
-                                @Parameter(name = "jndiBindings", desc = "comma-separated list of JNDI bindings") String 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 = "Destroy a JMS ConnectionFactory", impact = MBeanOperationInfo.ACTION)
-   void destroyConnectionFactory(@Parameter(name = "name", desc = "Name of the ConnectionFactory to destroy") String name) throws Exception;
-
-   @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
-   String[] listRemoteAddresses() throws Exception;
-
-   @Operation(desc = "List the client addresses which match the given IP Address", impact = MBeanOperationInfo.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 = MBeanOperationInfo.INFO)
-   boolean closeConnectionsForAddress(@Parameter(desc = "an IP address", name = "ipAddress") String ipAddress) throws Exception;
-
-   @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
-   String[] listConnectionIDs() throws Exception;
-
-   @Operation(desc = "List the sessions for the given connectionID", impact = MBeanOperationInfo.INFO)
-   String[] listSessions(@Parameter(desc = "a connection ID", name = "connectionID") String connectionID) throws Exception;
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/SubscriptionInfo.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,120 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management;
-
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public class SubscriptionInfo
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final String queueName;
-
-   private final String clientID;
-
-   private final String name;
-
-   private final boolean durable;
-
-   private final String selector;
-
-   private final int messageCount;
-
-   // Static --------------------------------------------------------
-
-   public static SubscriptionInfo[] from(final String jsonString) throws Exception
-   {
-      JSONArray array = new JSONArray(jsonString);
-      SubscriptionInfo[] infos = new SubscriptionInfo[array.length()];
-      for (int i = 0; i < array.length(); i++)
-      {
-         JSONObject sub = array.getJSONObject(i);
-         SubscriptionInfo info = new SubscriptionInfo(sub.getString("queueName"),
-                                                      sub.optString("clientID", null),
-                                                      sub.optString("name", null),
-                                                      sub.getBoolean("durable"),
-                                                      sub.optString("selector", null),
-                                                      sub.getInt("messageCount"));
-         infos[i] = info;
-      }
-
-      return infos;
-   }
-
-   // Constructors --------------------------------------------------
-
-   private SubscriptionInfo(final String queueName,
-                            final String clientID,
-                            final String name,
-                            final boolean durable,
-                            final String selector,
-                            final int messageCount)
-   {
-      this.queueName = queueName;
-      this.clientID = clientID;
-      this.name = name;
-      this.durable = durable;
-      this.selector = selector;
-      this.messageCount = messageCount;
-   }
-
-   // Public --------------------------------------------------------
-
-   public String getQueueName()
-   {
-      return queueName;
-   }
-
-   public String getClientID()
-   {
-      return clientID;
-   }
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public boolean isDurable()
-   {
-      return durable;
-   }
-
-   public String getSelector()
-   {
-      return selector;
-   }
-
-   public int getMessageCount()
-   {
-      return messageCount;
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/TopicControl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/TopicControl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,137 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management;
-
-import java.util.Map;
-
-import javax.management.MBeanOperationInfo;
-
-import org.hornetq.core.server.management.Operation;
-import org.hornetq.core.server.management.Parameter;
-
-/**
- * A TopicControl is used to manage a JMS Topic.
- * 
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- */
-public interface TopicControl extends DestinationControl
-{
-   // Attributes ----------------------------------------------------
-
-   /**
-    * Returns the number of (durable and non-durable) subscribers for this topic.
-    */
-   int getSubscriptionCount();
-
-   /**
-    * Returns the number of <em>durable</em> subscribers for this topic.
-    */
-   int getDurableSubscriptionCount();
-
-   /**
-    * Returns the number of <em>non-durable</em> subscribers for this topic.
-    */
-   int getNonDurableSubscriptionCount();
-
-   /**
-    * Returns the number of messages for all <em>durable</em> subscribers for this topic.
-    */
-   int getDurableMessageCount();
-
-   /**
-    * Returns the number of messages for all <em>non-durable</em> subscribers for this topic.
-    */
-   int getNonDurableMessageCount();
-
-   // Operations ----------------------------------------------------
-
-   /**
-    * Lists all the subscriptions for this topic (both durable and non-durable).
-    */
-   @Operation(desc = "List all subscriptions")
-   Object[] listAllSubscriptions() throws Exception;
-
-   /**
-    * Lists all the subscriptions for this topic (both durable and non-durable) using JSON serialization.
-    * <br>
-    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
-    */
-   @Operation(desc = "List all subscriptions")
-   String listAllSubscriptionsAsJSON() throws Exception;
-
-   /**
-    * Lists all the <em>durable</em> subscriptions for this topic.
-    */
-   @Operation(desc = "List only the durable subscriptions")
-   Object[] listDurableSubscriptions() throws Exception;
-
-   /**
-    * Lists all the <em>durable</em> subscriptions  using JSON serialization.
-    * <br>
-    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
-    */
-   @Operation(desc = "List only the durable subscriptions")
-   String listDurableSubscriptionsAsJSON() throws Exception;
-
-   /**
-    * Lists all the <em>non-durable</em> subscriptions for this topic.
-    */
-   @Operation(desc = "List only the non durable subscriptions")
-   Object[] listNonDurableSubscriptions() throws Exception;
-
-   /**
-    * Lists all the <em>non-durable</em> subscriptions  using JSON serialization.
-    * <br>
-    * Java objects can be recreated from JSON serialization using {@link SubscriptionInfo#from(String)}.
-    */
-   @Operation(desc = "List only the non durable subscriptions")
-   String listNonDurableSubscriptionsAsJSON() throws Exception;
-
-   /**
-    * Lists all the messages in this queue matching the specified queue representing the subscription.
-    * <br>
-    * 1 Map represents 1 message, keys are the message's properties and headers, values are the corresponding values.
-    */
-   @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;
-
-   /**
-    * Lists all the messages in this queue matching the specified queue representing the subscription using JSON serialization.
-    */
-   @Operation(desc = "List all the message for the given subscription")
-   public String listMessagesForSubscriptionAsJSON(@Parameter(name = "queueName", desc = "the name of the queue representing a subscription") String queueName) throws Exception;
-
-   /**
-    * Counts the number of messages in the subscription specified by the specified client ID and subscription name. Only messages matching the filter will be counted.
-    * <br>
-    * Using {@code null} or an empty filter will count <em>all</em> messages from this queue.
-    */
-   @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 (can be empty)") String filter) throws Exception;
-
-   /**
-    * Drops the subscription specified by the specified client ID and subscription name.
-    */
-   @Operation(desc = "Drop a durable subscription", impact = MBeanOperationInfo.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;
-
-   /**
-    * Drops all subscriptions.
-    */
-   @Operation(desc = "Drop all subscriptions from this topic", impact = MBeanOperationInfo.ACTION)
-   void dropAllSubscriptions() throws Exception;
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSConnectionFactoryControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,192 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management.impl;
-
-import java.util.List;
-
-import javax.management.MBeanInfo;
-import javax.management.NotCompliantMBeanException;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public class JMSConnectionFactoryControlImpl extends StandardMBean implements ConnectionFactoryControl
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final HornetQConnectionFactory cf;
-
-   private final List<String> bindings;
-
-   private final String name;
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   public JMSConnectionFactoryControlImpl(final HornetQConnectionFactory cf,
-                                          final String name,
-                                          final List<String> bindings) throws NotCompliantMBeanException
-   {
-      super(ConnectionFactoryControl.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 getConfirmationWindowSize()
-   {
-      return cf.getConfirmationWindowSize();
-   }
-
-   public int getDupsOKBatchSize()
-   {
-      return cf.getDupsOKBatchSize();
-   }
-
-   public boolean isBlockOnAcknowledge()
-   {
-      return cf.isBlockOnAcknowledge();
-   }
-
-   public boolean isBlockOnNonDurableSend()
-   {
-      return cf.isBlockOnNonDurableSend();
-   }
-
-   public boolean isBlockOnDurableSend()
-   {
-      return cf.isBlockOnDurableSend();
-   }
-
-   public boolean isPreAcknowledge()
-   {
-      return cf.isPreAcknowledge();
-   }
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public long getConnectionTTL()
-   {
-      return cf.getConnectionTTL();
-   }
-
-   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();
-   }
-
-   @Override
-   public MBeanInfo getMBeanInfo()
-   {
-      MBeanInfo info = super.getMBeanInfo();
-      return new MBeanInfo(info.getClassName(),
-                           info.getDescription(),
-                           info.getAttributes(),
-                           info.getConstructors(),
-                           MBeanInfoHelper.getMBeanOperationsInfo(ConnectionFactoryControl.class),
-                           info.getNotifications());
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementHelper.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,131 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management.impl;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.jms.client.HornetQMessage;
-
-/*
- * @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 JMSManagementHelper
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   private static org.hornetq.core.message.Message getCoreMessage(final Message jmsMessage)
-   {
-      if (jmsMessage instanceof HornetQMessage == false)
-      {
-         throw new IllegalArgumentException("Cannot send a non JBoss message as a management message " + jmsMessage.getClass()
-                                                                                                                   .getName());
-      }
-
-      return ((HornetQMessage)jmsMessage).getCoreMessage();
-   }
-
-   public static void putAttribute(final Message message, final String resourceName, final String attribute) throws JMSException
-   {
-      ManagementHelper.putAttribute(JMSManagementHelper.getCoreMessage(message), resourceName, attribute);
-   }
-
-   public static void putOperationInvocation(final Message message,
-                                             final String resourceName,
-                                             final String operationName) throws JMSException
-   {
-      try
-      {
-         ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
-                                                 resourceName,
-                                                 operationName);
-      }
-      catch (Exception e)
-      {
-         throw JMSManagementHelper.convertFromException(e);
-      }
-   }
-
-   private static JMSException convertFromException(final Exception e)
-   {
-      JMSException jmse = new JMSException(e.getMessage());
-
-      jmse.initCause(e);
-
-      return jmse;
-   }
-
-   public static void putOperationInvocation(final Message message,
-                                             final String resourceName,
-                                             final String operationName,
-                                             final Object... parameters) throws JMSException
-   {
-      try
-      {
-         ManagementHelper.putOperationInvocation(JMSManagementHelper.getCoreMessage(message),
-                                                 resourceName,
-                                                 operationName,
-                                                 parameters);
-      }
-      catch (Exception e)
-      {
-         throw JMSManagementHelper.convertFromException(e);
-      }
-   }
-
-   public static boolean isOperationResult(final Message message) throws JMSException
-   {
-      return ManagementHelper.isOperationResult(JMSManagementHelper.getCoreMessage(message));
-   }
-
-   public static boolean isAttributesResult(final Message message) throws JMSException
-   {
-      return ManagementHelper.isAttributesResult(JMSManagementHelper.getCoreMessage(message));
-   }
-
-   public static boolean hasOperationSucceeded(final Message message) throws JMSException
-   {
-      return ManagementHelper.hasOperationSucceeded(JMSManagementHelper.getCoreMessage(message));
-   }
-
-   public static Object[] getResults(final Message message) throws Exception
-   {
-      return ManagementHelper.getResults(JMSManagementHelper.getCoreMessage(message));
-   }
-
-   public static Object getResult(final Message message) throws Exception
-   {
-      return ManagementHelper.getResult(JMSManagementHelper.getCoreMessage(message));
-   }
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Modified: trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -26,12 +26,16 @@
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.HornetQTopic;
 import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
+import org.hornetq.jms.management.impl.JMSConnectionFactoryControlImpl;
+import org.hornetq.jms.management.impl.JMSQueueControlImpl;
+import org.hornetq.jms.management.impl.JMSServerControlImpl;
+import org.hornetq.jms.management.impl.JMSTopicControlImpl;
 import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
 import org.hornetq.jms.server.management.JMSManagementService;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
 
 /*
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>

Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSQueueControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,360 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management.impl;
-
-import java.util.Map;
-
-import javax.management.MBeanInfo;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.MessageCounterInfo;
-import org.hornetq.core.management.QueueControl;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.core.messagecounter.MessageCounter;
-import org.hornetq.core.messagecounter.impl.MessageCounterHelper;
-import org.hornetq.jms.HornetQQueue;
-import org.hornetq.jms.client.HornetQMessage;
-import org.hornetq.jms.client.SelectorTranslator;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public class JMSQueueControlImpl extends StandardMBean implements JMSQueueControl
-{
-   // Constants -----------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(JMSQueueControlImpl.class);
-
-   // Attributes ----------------------------------------------------
-
-   private final HornetQQueue managedQueue;
-
-   private final QueueControl coreQueueControl;
-
-   private final String binding;
-
-   private final MessageCounter counter;
-
-   // Static --------------------------------------------------------
-
-   /**
-    * Returns null if the string is null or empty
-    */
-   public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
-   {
-      return selectorStr == null || selectorStr.trim().length() == 0 ? null
-                                                                    : SelectorTranslator.convertToHornetQFilterString(selectorStr);
-   }
-
-   private static String createFilterForJMSMessageID(final String jmsMessageID) throws Exception
-   {
-      return HornetQMessage.HORNETQ_MESSAGE_ID + " = '" + jmsMessageID + "'";
-   }
-
-   static String toJSON(final Map<String, Object>[] messages)
-   {
-      JSONArray array = new JSONArray();
-      for (Map<String, Object> message : messages)
-      {
-         array.put(new JSONObject(message));
-      }
-      return array.toString();
-   }
-
-   // Constructors --------------------------------------------------
-
-   public JMSQueueControlImpl(final HornetQQueue managedQueue,
-                              final QueueControl coreQueueControl,
-                              final String jndiBinding,
-                              final MessageCounter counter) throws Exception
-   {
-      super(JMSQueueControl.class);
-      this.managedQueue = managedQueue;
-      this.coreQueueControl = coreQueueControl;
-      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(final String deadLetterAddress) throws Exception
-   {
-      coreQueueControl.setDeadLetterAddress(deadLetterAddress);
-   }
-
-   public String getExpiryAddress()
-   {
-      return coreQueueControl.getExpiryAddress();
-   }
-
-   public void setExpiryAddress(final String expiryAddres) throws Exception
-   {
-      coreQueueControl.setExpiryAddress(expiryAddres);
-   }
-
-   public boolean removeMessage(final String messageID) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
-      int removed = coreQueueControl.removeMessages(filter);
-      if (removed != 1)
-      {
-         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
-      }
-      return true;
-   }
-
-   public int removeMessages(final String filterStr) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.removeMessages(filter);
-   }
-
-   public Map<String, Object>[] listMessages(final String filterStr) throws Exception
-   {
-      try
-      {
-         String filter = JMSQueueControlImpl.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 = HornetQMessage.coreMaptoJMSMap(coreMessage);
-            jmsMessages[i++] = jmsMessage;
-         }
-         return jmsMessages;
-      }
-      catch (HornetQException e)
-      {
-         throw new IllegalStateException(e.getMessage());
-      }
-   }
-
-   public String listMessagesAsJSON(final String filter) throws Exception
-   {
-      return JMSQueueControlImpl.toJSON(listMessages(filter));
-   }
-
-   public int countMessages(final String filterStr) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.countMessages(filter);
-   }
-
-   public boolean expireMessage(final String messageID) throws Exception
-   {
-      String filter = JMSQueueControlImpl.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 = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.expireMessages(filter);
-   }
-
-   public boolean sendMessageToDeadLetterAddress(final String messageID) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
-      int dead = coreQueueControl.sendMessagesToDeadLetterAddress(filter);
-      if (dead != 1)
-      {
-         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
-      }
-      return true;
-   }
-
-   public int sendMessagesToDeadLetterAddress(final String filterStr) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.sendMessagesToDeadLetterAddress(filter);
-   }
-
-   public boolean changeMessagePriority(final String messageID, final int newPriority) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
-      int changed = coreQueueControl.changeMessagesPriority(filter, newPriority);
-      if (changed != 1)
-      {
-         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
-      }
-      return true;
-   }
-
-   public int changeMessagesPriority(final String filterStr, final int newPriority) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.changeMessagesPriority(filter, newPriority);
-   }
-
-   public boolean moveMessage(final String messageID, final String otherQueueName) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterForJMSMessageID(messageID);
-      HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
-      int moved = coreQueueControl.moveMessages(filter, otherQueue.getAddress());
-      if (moved != 1)
-      {
-         throw new IllegalArgumentException("No message found for JMSMessageID: " + messageID);
-      }
-
-      return true;
-   }
-
-   public int moveMessages(final String filterStr, final String otherQueueName) throws Exception
-   {
-      String filter = JMSQueueControlImpl.createFilterFromJMSSelector(filterStr);
-      HornetQQueue otherQueue = new HornetQQueue(otherQueueName);
-      return coreQueueControl.moveMessages(filter, otherQueue.getAddress());
-   }
-
-   public String listMessageCounter()
-   {
-      try
-      {
-         return MessageCounterInfo.toJSon(counter);
-      }
-      catch (Exception e)
-      {
-         throw new IllegalStateException(e);
-      }
-   }
-
-   public void resetMessageCounter() throws Exception
-   {
-      coreQueueControl.resetMessageCounter();
-   }
-
-   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 });
-   }
-
-   public boolean isPaused() throws Exception
-   {
-      return coreQueueControl.isPaused();
-   }
-
-   public void pause() throws Exception
-   {
-      coreQueueControl.pause();
-   }
-
-   public void resume() throws Exception
-   {
-      coreQueueControl.resume();
-   }
-
-   @Override
-   public MBeanInfo getMBeanInfo()
-   {
-      MBeanInfo info = super.getMBeanInfo();
-      return new MBeanInfo(info.getClassName(),
-                           info.getDescription(),
-                           info.getAttributes(),
-                           info.getConstructors(),
-                           MBeanInfoHelper.getMBeanOperationsInfo(JMSQueueControl.class),
-                           info.getNotifications());
-   }
-   
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Deleted: trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSServerControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,820 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.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.MBeanInfo;
-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 javax.management.StandardMBean;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.core.config.TransportConfiguration;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
-import org.hornetq.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 extends StandardMBean 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(final Object[] jndiBindings)
-   {
-      List<String> bindings = new ArrayList<String>();
-      for (Object object : jndiBindings)
-      {
-         bindings.add(object.toString().trim());
-      }
-      return bindings;
-   }
-
-   private static String[] toArray(final String commaSeparatedString)
-   {
-      if (commaSeparatedString == null || commaSeparatedString.trim().length() == 0)
-      {
-         return new String[0];
-      }
-      String[] values = commaSeparatedString.split(",");
-      String[] trimmed = new String[values.length];
-      for (int i = 0; i < values.length; i++)
-      {
-         trimmed[i] = values[i].trim();
-      }
-      return trimmed;
-   }
-
-   private static 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 = null;
-         if (liveConnectorTransportParams.length > i)
-         {
-            liveParams = (Map<String, Object>)liveConnectorTransportParams[i];
-         }
-
-         TransportConfiguration tcLive = new TransportConfiguration(liveConnectorsTransportClassNames[i].toString(),
-                                                                    liveParams);
-
-         Map<String, Object> backupParams = null;
-         if (backupConnectorTransportParams.length > i)
-         {
-            backupParams = (Map<String, Object>)backupConnectorTransportParams[i];
-         }
-
-         TransportConfiguration tcBackup = null;
-         if (backupConnectorsTransportClassNames.length > i)
-         {
-            new TransportConfiguration(backupConnectorsTransportClassNames[i].toString(), backupParams);
-         }
-         Pair<TransportConfiguration, TransportConfiguration> pair = new Pair<TransportConfiguration, TransportConfiguration>(tcLive,
-                                                                                                                              tcBackup);
-
-         pairs.add(pair);
-      }
-
-      return pairs;
-   }
-
-   public static MBeanNotificationInfo[] getNotificationInfos()
-   {
-      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,
-                                                                     JMSServerControl.class.getName(),
-                                                                     "Notifications emitted by a JMS Server") };
-   }
-
-   // Constructors --------------------------------------------------
-
-   public JMSServerControlImpl(final JMSServerManager server) throws Exception
-   {
-      super(JMSServerControl.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 = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
-                                                                                                                      liveConnectorTransportParams,
-                                                                                                                      backupConnectorsTransportClassNames,
-                                                                                                                      backupConnectorTransportParams);
-      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
-      server.createConnectionFactory(name, pairs, jndiBindingsList);
-
-      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String liveTransportClassNames,
-                                       final String liveTransportParams,
-                                       final String backupTransportClassNames,
-                                       final String backupTransportParams,
-                                       final String jndiBindings) throws Exception
-   {
-      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
-      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
-      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
-      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
-      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-      createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, bindings);
-   }
-
-   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 = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
-                                                                                                                      liveConnectorTransportParams,
-                                                                                                                      backupConnectorsTransportClassNames,
-                                                                                                                      backupConnectorTransportParams);
-
-      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
-      server.createConnectionFactory(name, pairs, clientID, jndiBindingsList);
-
-      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String liveTransportClassNames,
-                                       final String liveTransportParams,
-                                       final String backupTransportClassNames,
-                                       final String backupTransportParams,
-                                       final String clientID,
-                                       final String jndiBindings) throws Exception
-   {
-      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
-      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
-      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
-      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);;
-      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name, liveClassNames, liveParams, backupClassNames, backupParams, clientID, bindings);
-   }
-
-   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 boolean cacheLargeMessageClient,
-                                       final int minLargeMessageSize,
-                                       final int consumerWindowSize,
-                                       final int consumerMaxRate,
-                                       final int confirmationWindowSize,
-                                       final int producerWindowSize,
-                                       final int producerMaxRate,
-                                       final boolean blockOnAcknowledge,
-                                       final boolean blockOnDurableSend,
-                                       final boolean blockOnNonDurableSend,
-                                       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 long maxRetryInterval,
-                                       final int reconnectAttempts,
-                                       final boolean failoverOnServerShutdown,
-                                       final String groupID,
-                                       final Object[] jndiBindings) throws Exception
-   {
-      List<Pair<TransportConfiguration, TransportConfiguration>> pairs = JMSServerControlImpl.convertToConnectorPairs(liveConnectorsTransportClassNames,
-                                                                                                                      liveConnectorTransportParams,
-                                                                                                                      backupConnectorsTransportClassNames,
-                                                                                                                      backupConnectorTransportParams);
-
-      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
-      server.createConnectionFactory(name,
-                                     pairs,
-                                     clientID,
-                                     clientFailureCheckPeriod,
-                                     connectionTTL,
-                                     callTimeout,
-                                     cacheLargeMessageClient,
-                                     minLargeMessageSize,
-                                     consumerWindowSize,
-                                     consumerMaxRate,
-                                     confirmationWindowSize,
-                                     producerWindowSize,
-                                     producerMaxRate,
-                                     blockOnAcknowledge,
-                                     blockOnDurableSend,
-                                     blockOnNonDurableSend,
-                                     autoGroup,
-                                     preAcknowledge,
-                                     loadBalancingPolicyClassName,
-                                     transactionBatchSize,
-                                     dupsOKBatchSize,
-                                     useGlobalPools,
-                                     scheduledThreadPoolMaxSize,
-                                     threadPoolMaxSize,
-                                     retryInterval,
-                                     retryIntervalMultiplier,
-                                     maxRetryInterval,
-                                     reconnectAttempts,
-                                     failoverOnServerShutdown,
-                                     groupID,
-                                     jndiBindingsList);
-
-      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String liveTransportClassNames,
-                                       final String liveTransportParams,
-                                       final String backupTransportClassNames,
-                                       final String backupTransportParams,
-                                       final String clientID,
-                                       final long clientFailureCheckPeriod,
-                                       final long connectionTTL,
-                                       final long callTimeout,
-                                       final boolean cacheLargeMessageClient,
-                                       final int minLargeMessageSize,
-                                       final int consumerWindowSize,
-                                       final int consumerMaxRate,
-                                       final int confirmationWindowSize,
-                                       final int producerWindowSize,
-                                       final int producerMaxRate,
-                                       final boolean blockOnAcknowledge,
-                                       final boolean blockOnDurableSend,
-                                       final boolean blockOnNonDurableSend,
-                                       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 long maxRetryInterval,
-                                       final int reconnectAttempts,
-                                       final boolean failoverOnServerShutdown,
-                                       final String groupID,
-                                       final String jndiBindings) throws Exception
-   {
-      Object[] liveClassNames = JMSServerControlImpl.toArray(liveTransportClassNames);
-      Object[] liveParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(liveTransportParams);
-      Object[] backupClassNames = JMSServerControlImpl.toArray(backupTransportClassNames);
-      Object[] backupParams = ManagementHelper.fromCommaSeparatedArrayOfCommaSeparatedKeyValues(backupTransportParams);
-      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name,
-                              liveClassNames,
-                              liveParams,
-                              backupClassNames,
-                              backupParams,
-                              clientID,
-                              clientFailureCheckPeriod,
-                              connectionTTL,
-                              callTimeout,
-                              cacheLargeMessageClient,
-                              minLargeMessageSize,
-                              consumerWindowSize,
-                              consumerMaxRate,
-                              confirmationWindowSize,
-                              producerWindowSize,
-                              producerMaxRate,
-                              blockOnAcknowledge,
-                              blockOnDurableSend,
-                              blockOnNonDurableSend,
-                              autoGroup,
-                              preAcknowledge,
-                              loadBalancingPolicyClassName,
-                              transactionBatchSize,
-                              dupsOKBatchSize,
-                              useGlobalPools,
-                              scheduledThreadPoolMaxSize,
-                              threadPoolMaxSize,
-                              retryInterval,
-                              retryIntervalMultiplier,
-                              maxRetryInterval,
-                              reconnectAttempts,
-                              failoverOnServerShutdown,
-                              groupID,
-                              bindings);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String discoveryAddress,
-                                       final int discoveryPort,
-                                       final String clientID,
-                                       final Object[] jndiBindings) throws Exception
-   {
-      List<String> jndiBindingsList = JMSServerControlImpl.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 String jndiBindings) throws Exception
-   {
-      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name, discoveryAddress, discoveryPort, clientID, bindings);
-   }
-
-   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 boolean cacheLargeMessageClient,
-                                       final int minLargeMessageSize,
-                                       final int consumerWindowSize,
-                                       final int consumerMaxRate,
-                                       final int confirmationWindowSize,
-                                       final int producerWindowSize,
-                                       final int producerMaxRate,
-                                       final boolean blockOnAcknowledge,
-                                       final boolean blockOnDurableSend,
-                                       final boolean blockOnNonDurableSend,
-                                       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 long maxRetryInterval,
-                                       final int reconnectAttempts,
-                                       final boolean failoverOnServerShutdown,
-                                       final String groupID,
-                                       final Object[] jndiBindings) throws Exception
-   {
-      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-
-      server.createConnectionFactory(name,
-                                     discoveryAddress,
-                                     discoveryPort,
-                                     clientID,
-                                     discoveryRefreshTimeout,
-                                     clientFailureCheckPeriod,
-                                     connectionTTL,
-                                     callTimeout,
-                                     cacheLargeMessageClient,
-                                     minLargeMessageSize,
-                                     consumerWindowSize,
-                                     consumerMaxRate,
-                                     confirmationWindowSize,
-                                     producerWindowSize,
-                                     producerMaxRate,
-                                     blockOnAcknowledge,
-                                     blockOnDurableSend,
-                                     blockOnNonDurableSend,
-                                     autoGroup,
-                                     preAcknowledge,
-                                     loadBalancingPolicyClassName,
-                                     transactionBatchSize,
-                                     dupsOKBatchSize,
-                                     initialWaitTimeout,
-                                     useGlobalPools,
-                                     scheduledThreadPoolMaxSize,
-                                     threadPoolMaxSize,
-                                     retryInterval,
-                                     retryIntervalMultiplier,
-                                     maxRetryInterval,
-                                     reconnectAttempts,
-                                     failoverOnServerShutdown,
-                                     groupID,
-                                     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 boolean cacheLargeMessageClient,
-                                       final int minLargeMessageSize,
-                                       final int consumerWindowSize,
-                                       final int consumerMaxRate,
-                                       final int confirmationWindowSize,
-                                       final int producerWindowSize,
-                                       final int producerMaxRate,
-                                       final boolean blockOnAcknowledge,
-                                       final boolean blockOnDurableSend,
-                                       final boolean blockOnNonDurableSend,
-                                       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 long maxRetryInterval,
-                                       final int reconnectAttempts,
-                                       final boolean failoverOnServerShutdown,
-                                       final String groupID,
-                                       final String jndiBindings) throws Exception
-   {
-      Object[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name,
-                              discoveryAddress,
-                              discoveryPort,
-                              clientID,
-                              discoveryRefreshTimeout,
-                              clientFailureCheckPeriod,
-                              connectionTTL,
-                              callTimeout,
-                              cacheLargeMessageClient,
-                              minLargeMessageSize,
-                              consumerWindowSize,
-                              consumerMaxRate,
-                              confirmationWindowSize,
-                              producerWindowSize,
-                              producerMaxRate,
-                              blockOnAcknowledge,
-                              blockOnDurableSend,
-                              blockOnNonDurableSend,
-                              autoGroup,
-                              preAcknowledge,
-                              loadBalancingPolicyClassName,
-                              transactionBatchSize,
-                              dupsOKBatchSize,
-                              initialWaitTimeout,
-                              useGlobalPools,
-                              scheduledThreadPoolMaxSize,
-                              threadPoolMaxSize,
-                              retryInterval,
-                              retryIntervalMultiplier,
-                              maxRetryInterval,
-                              reconnectAttempts,
-                              failoverOnServerShutdown,
-                              groupID,
-                              bindings);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String liveTransportClassName,
-                                       final Map<String, Object> liveTransportParams,
-                                       final Object[] jndiBindings) throws Exception
-   {
-      List<String> jndiBindingsList = JMSServerControlImpl.convert(jndiBindings);
-      TransportConfiguration liveTC = new TransportConfiguration(liveTransportClassName, liveTransportParams);
-
-      server.createConnectionFactory(name, liveTC, jndiBindingsList);
-
-      sendNotification(NotificationType.CONNECTION_FACTORY_CREATED, name);
-   }
-
-   public void createConnectionFactory(final String name,
-                                       final String liveTransportClassName,
-                                       final String liveTransportParams,
-                                       final String jndiBindings) throws Exception
-   {
-      Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
-      String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name, liveTransportClassName, params, bindings);
-   }
-
-   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 = JMSServerControlImpl.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 String liveTransportParams,
-                                       final String clientID,
-                                       final String jndiBindings) throws Exception
-   {
-      Map<String, Object> params = ManagementHelper.fromCommaSeparatedKeyValues(liveTransportParams);
-      String[] bindings = JMSServerControlImpl.toArray(jndiBindings);
-
-      createConnectionFactory(name, liveTransportClassName, params, clientID, bindings);
-   }
-
-   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 = JMSServerControlImpl.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 = JMSServerControlImpl.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();
-   }
-
-   public String[] getQueueNames()
-   {
-      Object[] queueControls = server.getHornetQServer().getManagementService().getResources(JMSQueueControl.class);
-      String[] names = new String[queueControls.length];
-      for (int i = 0; i < queueControls.length; i++)
-      {
-         JMSQueueControl queueControl = (JMSQueueControl)queueControls[i];
-         names[i] = queueControl.getName();
-      }
-      return names;
-   }
-
-   public String[] getTopicNames()
-   {
-      Object[] topicControls = server.getHornetQServer().getManagementService().getResources(TopicControl.class);
-      String[] names = new String[topicControls.length];
-      for (int i = 0; i < topicControls.length; i++)
-      {
-         TopicControl topicControl = (TopicControl)topicControls[i];
-         names[i] = topicControl.getName();
-      }
-      return names;
-   }
-
-   public String[] getConnectionFactoryNames()
-   {
-      Object[] cfControls = server.getHornetQServer()
-                                  .getManagementService()
-                                  .getResources(ConnectionFactoryControl.class);
-      String[] names = new String[cfControls.length];
-      for (int i = 0; i < cfControls.length; i++)
-      {
-         ConnectionFactoryControl cfControl = (ConnectionFactoryControl)cfControls[i];
-         names[i] = cfControl.getName();
-      }
-      return names;
-   }
-
-   // 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()
-   {
-      return JMSServerControlImpl.getNotificationInfos();
-   }
-
-   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);
-   }
-
-   @Override
-   public MBeanInfo getMBeanInfo()
-   {
-      MBeanInfo info = super.getMBeanInfo();
-      return new MBeanInfo(info.getClassName(),
-                           info.getDescription(),
-                           info.getAttributes(),
-                           info.getConstructors(),
-                           MBeanInfoHelper.getMBeanOperationsInfo(JMSServerControl.class),
-                           info.getNotifications());
-   }
-
-   // 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/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1,371 +0,0 @@
-/*
- * Copyright 2009 Red Hat, Inc.
- * Red Hat licenses this file to you under the Apache License, version
- * 2.0 (the "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *    http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.  See the License for the specific language governing
- * permissions and limitations under the License.
- */
-
-package org.hornetq.jms.server.management.impl;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-import javax.management.MBeanInfo;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.exception.HornetQException;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.AddressControl;
-import org.hornetq.core.management.HornetQServerControl;
-import org.hornetq.core.management.QueueControl;
-import org.hornetq.core.management.ResourceNames;
-import org.hornetq.core.management.impl.MBeanInfoHelper;
-import org.hornetq.core.server.management.ManagementService;
-import org.hornetq.jms.HornetQTopic;
-import org.hornetq.jms.client.HornetQMessage;
-import org.hornetq.jms.client.SelectorTranslator;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
-import org.hornetq.utils.Pair;
-import org.hornetq.utils.json.JSONArray;
-import org.hornetq.utils.json.JSONObject;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public class JMSTopicControlImpl extends StandardMBean implements TopicControl
-{
-   // Constants -----------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(JMSTopicControlImpl.class);
-
-   // Attributes ----------------------------------------------------
-
-   private final HornetQTopic managedTopic;
-
-   private final String binding;
-
-   private final AddressControl addressControl;
-
-   private final ManagementService managementService;
-
-   // Static --------------------------------------------------------
-
-   public static String createFilterFromJMSSelector(final String selectorStr) throws HornetQException
-   {
-      return selectorStr == null || selectorStr.trim().length() == 0 ? null
-                                                                    : SelectorTranslator.convertToHornetQFilterString(selectorStr);
-   }
-
-   // Constructors --------------------------------------------------
-
-   public JMSTopicControlImpl(final HornetQTopic topic,
-                              final AddressControl addressControl,
-                              final String jndiBinding,
-                              final ManagementService managementService) throws Exception
-   {
-      super(TopicControl.class);
-      managedTopic = topic;
-      this.addressControl = addressControl;
-      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 String listAllSubscriptionsAsJSON() throws Exception
-   {
-      return listSubscribersInfosAsJSON(DurabilityType.ALL);
-   }
-
-   public Object[] listDurableSubscriptions()
-   {
-      return listSubscribersInfos(DurabilityType.DURABLE);
-   }
-
-   public String listDurableSubscriptionsAsJSON() throws Exception
-   {
-      return listSubscribersInfosAsJSON(DurabilityType.DURABLE);
-   }
-
-   public Object[] listNonDurableSubscriptions()
-   {
-      return listSubscribersInfos(DurabilityType.NON_DURABLE);
-   }
-
-   public String listNonDurableSubscriptionsAsJSON() throws Exception
-   {
-      return listSubscribersInfosAsJSON(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.listMessages(null);
-
-      Map<String, Object>[] jmsMessages = new Map[coreMessages.length];
-
-      int i = 0;
-
-      for (Map<String, Object> coreMessage : coreMessages)
-      {
-         jmsMessages[i++] = HornetQMessage.coreMaptoJMSMap(coreMessage);
-      }
-      return jmsMessages;
-   }
-
-   public String listMessagesForSubscriptionAsJSON(final String queueName) throws Exception
-   {
-      return JMSQueueControlImpl.toJSON(listMessagesForSubscription(queueName));
-   }
-
-   public int countMessagesForSubscription(final String clientID, final String subscriptionName, final String filterStr) throws Exception
-   {
-      String queueName = HornetQTopic.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 = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
-      return coreQueueControl.listMessages(filter).length;
-   }
-
-   public int removeMessages(final String filterStr) throws Exception
-   {
-      String filter = JMSTopicControlImpl.createFilterFromJMSSelector(filterStr);
-      int count = 0;
-      String[] queues = addressControl.getQueueNames();
-      for (String queue : queues)
-      {
-         QueueControl coreQueueControl = (QueueControl)managementService.getResource(ResourceNames.CORE_QUEUE + queue);
-         count += coreQueueControl.removeMessages(filter);
-      }
-
-      return count;
-   }
-
-   public void dropDurableSubscription(final String clientID, final String subscriptionName) throws Exception
-   {
-      String queueName = HornetQTopic.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);
-      }
-      HornetQServerControl serverControl = (HornetQServerControl)managementService.getResource(ResourceNames.CORE_SERVER);
-      serverControl.destroyQueue(queueName);
-   }
-
-   public void dropAllSubscriptions() throws Exception
-   {
-      HornetQServerControl serverControl = (HornetQServerControl)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 = HornetQTopic.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 String listSubscribersInfosAsJSON(final DurabilityType durability) throws Exception
-   {
-      List<QueueControl> queues = getQueues(durability);
-      JSONArray array = new JSONArray();
-
-      for (QueueControl queue : queues)
-      {
-         String clientID = null;
-         String subName = null;
-
-         if (queue.isDurable())
-         {
-            Pair<String, String> pair = HornetQTopic.decomposeQueueNameForDurableSubscription(queue.getName()
-                                                                                                   .toString());
-            clientID = pair.a;
-            subName = pair.b;
-         }
-
-         String filter = queue.getFilter() != null ? queue.getFilter() : null;
-
-         JSONObject info = new JSONObject();
-         info.put("queueName", queue.getName());
-         info.put("clientID", clientID);
-         info.put("selector", filter);
-         info.put("name", subName);
-         info.put("durable", queue.isDurable());
-         info.put("messageCount", queue.getMessageCount());
-         array.put(info);
-      }
-
-      return array.toString();
-   }
-
-   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();
-      }
-   }
-
-   @Override
-   public MBeanInfo getMBeanInfo()
-   {
-      MBeanInfo info = super.getMBeanInfo();
-      return new MBeanInfo(info.getClassName(),
-                           info.getDescription(),
-                           info.getAttributes(),
-                           info.getConstructors(),
-                           MBeanInfoHelper.getMBeanOperationsInfo(TopicControl.class),
-                           info.getNotifications());
-   }
-
-   // Inner classes -------------------------------------------------
-
-   private enum DurabilityType
-   {
-      ALL, DURABLE, NON_DURABLE
-   }
-}

Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/message/MessageHeaderTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -1381,6 +1381,15 @@
          // TODO Auto-generated method stub
          return false;
       }
+
+      /* (non-Javadoc)
+       * @see org.hornetq.core.client.ClientSession#createQueue(org.hornetq.utils.SimpleString, org.hornetq.utils.SimpleString)
+       */
+      public void createQueue(SimpleString address, SimpleString queueName) throws HornetQException
+      {
+         // TODO Auto-generated method stub
+         
+      }
    }
 
 }

Modified: trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/jms-tests/src/org/hornetq/jms/tests/tools/container/LocalTestServer.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,9 +34,9 @@
 import org.hornetq.core.security.Role;
 import org.hornetq.core.server.HornetQServer;
 import org.hornetq.integration.bootstrap.HornetQBootstrapServer;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
 import org.hornetq.jms.server.JMSServerManager;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
 import org.hornetq.utils.Pair;
 import org.jboss.kernel.plugins.config.property.PropertyKernelConfig;
 

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -49,10 +49,10 @@
 import org.hornetq.jms.bridge.QualityOfServiceMode;
 import org.hornetq.jms.client.HornetQConnectionFactory;
 import org.hornetq.jms.client.HornetQMessage;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.TopicControl;
 import org.hornetq.jms.server.JMSServerManager;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.TopicControl;
 import org.hornetq.tests.unit.util.InVMContext;
 import org.hornetq.tests.util.UnitTestCase;
 

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSMessagingProxy.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -19,7 +19,7 @@
 import javax.jms.QueueSession;
 import javax.jms.Session;
 
-import org.hornetq.jms.server.management.impl.JMSManagementHelper;
+import org.hornetq.jms.management.impl.JMSManagementHelper;
 
 /**
  * A MBeanUsingCoreMessage

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -37,8 +37,8 @@
 import org.hornetq.core.settings.impl.AddressSettings;
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.client.HornetQConnectionFactory;
+import org.hornetq.jms.management.JMSQueueControl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSQueueControl;
 import org.hornetq.tests.integration.management.ManagementControlHelper;
 import org.hornetq.tests.integration.management.ManagementTestBase;
 import org.hornetq.tests.unit.util.InVMContext;

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSQueueControlUsingJMSTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -25,7 +25,7 @@
 import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSQueueControl;
 
 /**
  * 

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,8 +34,8 @@
 import org.hornetq.core.server.HornetQServer;
 import org.hornetq.integration.transports.netty.NettyAcceptorFactory;
 import org.hornetq.integration.transports.netty.NettyConnectorFactory;
+import org.hornetq.jms.management.JMSServerControl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSServerControl;
 import org.hornetq.tests.integration.management.ManagementControlHelper;
 import org.hornetq.tests.integration.management.ManagementTestBase;
 import org.hornetq.tests.unit.util.InVMContext;

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -34,9 +34,9 @@
 import org.hornetq.core.remoting.impl.invm.TransportConstants;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
+import org.hornetq.jms.management.JMSServerControl;
 import org.hornetq.jms.server.JMSServerManager;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.JMSServerControl;
 import org.hornetq.tests.integration.management.ManagementControlHelper;
 import org.hornetq.tests.integration.management.ManagementTestBase;
 import org.hornetq.tests.unit.util.InVMContext;

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -25,7 +25,7 @@
 import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.client.HornetQConnectionFactory;
-import org.hornetq.jms.server.management.JMSServerControl;
+import org.hornetq.jms.management.JMSServerControl;
 
 /**
  * A JMSServerControlUsingCoreTest

Modified: trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/server/management/TopicControlTest.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -28,9 +28,9 @@
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
 import org.hornetq.jms.HornetQTopic;
+import org.hornetq.jms.management.SubscriptionInfo;
+import org.hornetq.jms.management.TopicControl;
 import org.hornetq.jms.server.impl.JMSServerManagerImpl;
-import org.hornetq.jms.server.management.SubscriptionInfo;
-import org.hornetq.jms.server.management.TopicControl;
 import org.hornetq.tests.integration.management.ManagementControlHelper;
 import org.hornetq.tests.integration.management.ManagementTestBase;
 import org.hornetq.tests.util.RandomUtil;

Modified: trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java	2009-12-11 11:17:40 UTC (rev 8673)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ManagementControlHelper.java	2009-12-11 13:18:01 UTC (rev 8674)
@@ -29,10 +29,10 @@
 import org.hornetq.core.management.HornetQServerControl;
 import org.hornetq.core.management.ObjectNameBuilder;
 import org.hornetq.core.management.QueueControl;
-import org.hornetq.jms.server.management.ConnectionFactoryControl;
-import org.hornetq.jms.server.management.JMSQueueControl;
-import org.hornetq.jms.server.management.JMSServerControl;
-import org.hornetq.jms.server.management.TopicControl;
+import org.hornetq.jms.management.ConnectionFactoryControl;
+import org.hornetq.jms.management.JMSQueueControl;
+import org.hornetq.jms.management.JMSServerControl;
+import org.hornetq.jms.management.TopicControl;
 import org.hornetq.utils.SimpleString;
 
 /**



More information about the hornetq-commits mailing list