[hornetq-commits] JBoss hornetq SVN: r8664 - in trunk: examples/common/config and 32 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Dec 10 10:25:41 EST 2009


Author: jmesnil
Date: 2009-12-10 10:25:39 -0500 (Thu, 10 Dec 2009)
New Revision: 8664

Added:
   trunk/src/main/org/hornetq/core/server/management/
   trunk/src/main/org/hornetq/core/server/management/ManagementService.java
   trunk/src/main/org/hornetq/core/server/management/Notification.java
   trunk/src/main/org/hornetq/core/server/management/NotificationListener.java
   trunk/src/main/org/hornetq/core/server/management/NotificationService.java
   trunk/src/main/org/hornetq/core/server/management/Operation.java
   trunk/src/main/org/hornetq/core/server/management/Parameter.java
   trunk/src/main/org/hornetq/core/server/management/impl/
   trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java
Removed:
   trunk/src/main/org/hornetq/core/management/ManagementService.java
   trunk/src/main/org/hornetq/core/management/Notification.java
   trunk/src/main/org/hornetq/core/management/NotificationListener.java
   trunk/src/main/org/hornetq/core/management/NotificationService.java
   trunk/src/main/org/hornetq/core/management/Operation.java
   trunk/src/main/org/hornetq/core/management/Parameter.java
   trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
Modified:
   trunk/docs/user-manual/en/configuration-index.xml
   trunk/docs/user-manual/en/management.xml
   trunk/examples/common/config/hornetq-example-beans.xml
   trunk/src/config/common/schema/hornetq-configuration.xsd
   trunk/src/main/org/hornetq/core/client/ClientMessage.java
   trunk/src/main/org/hornetq/core/cluster/DiscoveryGroup.java
   trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
   trunk/src/main/org/hornetq/core/config/Configuration.java
   trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
   trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
   trunk/src/main/org/hornetq/core/management/AcceptorControl.java
   trunk/src/main/org/hornetq/core/management/AddressControl.java
   trunk/src/main/org/hornetq/core/management/BridgeControl.java
   trunk/src/main/org/hornetq/core/management/BroadcastGroupControl.java
   trunk/src/main/org/hornetq/core/management/ClusterConnectionControl.java
   trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
   trunk/src/main/org/hornetq/core/management/DiscoveryGroupControl.java
   trunk/src/main/org/hornetq/core/management/DivertControl.java
   trunk/src/main/org/hornetq/core/management/HornetQComponentControl.java
   trunk/src/main/org/hornetq/core/management/HornetQServerControl.java
   trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
   trunk/src/main/org/hornetq/core/management/QueueControl.java
   trunk/src/main/org/hornetq/core/management/ResourceNames.java
   trunk/src/main/org/hornetq/core/management/RoleInfo.java
   trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
   trunk/src/main/org/hornetq/core/management/impl/MBeanInfoHelper.java
   trunk/src/main/org/hornetq/core/message/Message.java
   trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
   trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
   trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
   trunk/src/main/org/hornetq/core/remoting/spi/Acceptor.java
   trunk/src/main/org/hornetq/core/security/impl/SecurityStoreImpl.java
   trunk/src/main/org/hornetq/core/server/HornetQServer.java
   trunk/src/main/org/hornetq/core/server/cluster/Bridge.java
   trunk/src/main/org/hornetq/core/server/cluster/BroadcastGroup.java
   trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
   trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java
   trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
   trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
   trunk/src/main/org/hornetq/core/server/group/GroupingHandler.java
   trunk/src/main/org/hornetq/core/server/group/impl/LocalGroupingHandler.java
   trunk/src/main/org/hornetq/core/server/group/impl/RemoteGroupingHandler.java
   trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
   trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
   trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
   trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.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/TopicControl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java
   trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
   trunk/tests/config/ConfigurationTest-full-config.xml
   trunk/tests/src/org/hornetq/tests/integration/SimpleNotificationService.java
   trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusteredGroupingTest.java
   trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
   trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java
   trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
   trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java
   trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
   trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
   trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
Log:
HORNETQ-185 + HORNETQ-186: API review + javadoc

* move ManagementService + related interfaces to org.hornetq.core.server.management
  (as they are not part of the client management API)
* removed unused management-request-timeout from configuration
* added javadoc for org.hornetq.core.management API


Modified: trunk/docs/user-manual/en/configuration-index.xml
===================================================================
--- trunk/docs/user-manual/en/configuration-index.xml	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/docs/user-manual/en/configuration-index.xml	2009-12-10 15:25:39 UTC (rev 8664)
@@ -250,14 +250,6 @@
                             <entry>hornetq.notifications</entry>
                         </row>
                         <row>
-                            <entry><link linkend="management.replication"
-                                    >management-request-timeout</link></entry>
-                            <entry>Long</entry>
-                            <entry>how long (in ms) to wait for a reply to a management
-                                request</entry>
-                            <entry>5000</entry>
-                        </row>
-                        <row>
                             <entry><link linkend="configuring.message.counters"
                                     >message-counter-enabled</link></entry>
                             <entry>Boolean</entry>

Modified: trunk/docs/user-manual/en/management.xml
===================================================================
--- trunk/docs/user-manual/en/management.xml	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/docs/user-manual/en/management.xml	2009-12-10 15:25:39 UTC (rev 8664)
@@ -737,15 +737,6 @@
       <para>It is strongly suggested to change these values from their default. If they are not
          changed from the default, HornetQ will detect this and pester you with a warning on every
          start-up.</para>
-      <para>HornetQ internally uses Core messages to replicate management operations between the
-         live and backup server when JMX is used. By default, there is a timeout of 5s (5000ms) to
-         send a management request from the live server to the backup server and wait for a reply.
-         If a reply is not received before the timeout is hit, HornetQ considers the replication has
-         failed. This timeout can be configured in <literal
-         >hornetq-configuration.xml</literal>:</para>
-      <programlisting>
-         &lt;management-request-timeout&gt;5000&lt;/management-request-timeout&gt;
-      </programlisting>
    </section>
    <section id="management.notifications">
       <title>Management Notifications</title>

Modified: trunk/examples/common/config/hornetq-example-beans.xml
===================================================================
--- trunk/examples/common/config/hornetq-example-beans.xml	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/examples/common/config/hornetq-example-beans.xml	2009-12-10 15:25:39 UTC (rev 8664)
@@ -138,7 +138,7 @@
       </constructor>
    </bean>
 
-   <bean name="ManagementService" class="org.hornetq.core.management.impl.ManagementServiceImpl">
+   <bean name="ManagementService" class="org.hornetq.core.server.management.impl.ManagementServiceImpl">
       <constructor>
          <parameter>
             <inject bean="MBeanServer"/>

Modified: trunk/src/config/common/schema/hornetq-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/hornetq-configuration.xsd	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/config/common/schema/hornetq-configuration.xsd	2009-12-10 15:25:39 UTC (rev 8664)
@@ -37,8 +37,6 @@
                 </xsd:element>				
                 <xsd:element maxOccurs="1" minOccurs="0" name="log-delegate-factory-class-name" type="xsd:string">
                 </xsd:element>
-                <xsd:element maxOccurs="1" minOccurs="0" name="management-request-timeout" type="xsd:long">
-                </xsd:element>              
 				<xsd:element maxOccurs="1" minOccurs="0" name="jmx-management-enabled" type="xsd:boolean">
 				</xsd:element>
 				<xsd:element maxOccurs="1" minOccurs="0" name="jmx-domain" type="xsd:string">

Modified: trunk/src/main/org/hornetq/core/client/ClientMessage.java
===================================================================
--- trunk/src/main/org/hornetq/core/client/ClientMessage.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/client/ClientMessage.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -63,7 +63,7 @@
 
    /** 
     * Sets the OutputStream that will receive the content of a message received in a non blocking way.
-    * 
+    * <br> 
     * This method is used when consuming large messages
     * 
     * @throws HornetQException
@@ -73,8 +73,7 @@
    /** 
     * Saves the content of the message to the OutputStream.
     * It will block until the entire content is transfered to the OutputStream.
-    *  
-    * This method is used for when consuming large messages
+    * <br> 
     * 
     * @throws HornetQException
     */
@@ -88,13 +87,12 @@
     * @param timeMilliseconds - 0 means wait forever
     * @return true if it reached the end
     * @throws HornetQException
- 
     */
    boolean waitOutputStreamCompletion(long timeMilliseconds) throws HornetQException;
 
    /** 
-    * Sets the body's IntputStream.
-    * 
+    * Sets the body's IntputStream. 
+    * <br> 
     * This method is used when sending large messages
     * 
     * @throws HornetQException

Modified: trunk/src/main/org/hornetq/core/cluster/DiscoveryGroup.java
===================================================================
--- trunk/src/main/org/hornetq/core/cluster/DiscoveryGroup.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/cluster/DiscoveryGroup.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -15,7 +15,7 @@
 
 import java.util.Map;
 
-import org.hornetq.core.management.NotificationService;
+import org.hornetq.core.server.management.NotificationService;
 
 /**
  * A DiscoveryGroup

Modified: trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/cluster/impl/DiscoveryGroupImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -30,9 +30,9 @@
 import org.hornetq.core.cluster.DiscoveryListener;
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.Pair;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.TypedProperties;

Modified: trunk/src/main/org/hornetq/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/Configuration.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/config/Configuration.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -165,10 +165,6 @@
 
    void setManagementClusterPassword(String password);
 
-   long getManagementRequestTimeout();
-
-   void setManagementRequestTimeout(long timeout);
-
    int getIDCacheSize();
 
    void setIDCacheSize(int idCacheSize);

Modified: trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/config/impl/ConfigurationImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -140,8 +140,6 @@
 
    public static final String DEFAULT_MANAGEMENT_CLUSTER_PASSWORD = "CHANGE ME!!";
 
-   public static final long DEFAULT_MANAGEMENT_REQUEST_TIMEOUT = 5000;
-
    public static final long DEFAULT_BROADCAST_PERIOD = 1000;
 
    public static final long DEFAULT_BROADCAST_REFRESH_TIMEOUT = 10000;
@@ -308,8 +306,6 @@
 
    protected String managementClusterPassword = ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_PASSWORD;
 
-   protected long managementRequestTimeout = ConfigurationImpl.DEFAULT_MANAGEMENT_REQUEST_TIMEOUT;
-
    protected long serverDumpInterval = ConfigurationImpl.DEFAULT_SERVER_DUMP_INTERVAL;
 
    // percentage of free memory which triggers warning from the memory manager
@@ -872,16 +868,6 @@
       managementClusterPassword = clusterPassword;
    }
 
-   public long getManagementRequestTimeout()
-   {
-      return managementRequestTimeout;
-   }
-
-   public void setManagementRequestTimeout(final long managementRequestTimeout)
-   {
-      this.managementRequestTimeout = managementRequestTimeout;
-   }
-
    public int getJournalCompactMinFiles()
    {
       return journalCompactMinFiles;
@@ -1220,10 +1206,6 @@
       {
          return false;
       }
-      if (managementRequestTimeout != other.managementRequestTimeout)
-      {
-         return false;
-      }
       if (messageCounterEnabled != other.messageCounterEnabled)
       {
          return false;

Modified: trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/config/impl/FileConfiguration.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -180,11 +180,6 @@
                                                              managementClusterUser,
                                                              Validators.NOT_NULL_OR_EMPTY);
 
-      managementRequestTimeout = XMLConfigurationUtil.getLong(e,
-                                                              "management-request-timeout",
-                                                              managementRequestTimeout,
-                                                              Validators.GT_ZERO);
-
       logDelegateFactoryClassName = XMLConfigurationUtil.getString(e,
                                                                    "log-delegate-factory-class-name",
                                                                    logDelegateFactoryClassName,

Modified: trunk/src/main/org/hornetq/core/management/AcceptorControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/AcceptorControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/AcceptorControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -15,17 +15,33 @@
 
 import java.util.Map;
 
+import org.hornetq.core.remoting.spi.Acceptor;
+import org.hornetq.core.remoting.spi.AcceptorFactory;
+
 /**
- * A AcceptorMBean
+ * An AcceptorControl is used to manage Acceptors.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
- *
+ * 
+ * @see Acceptor
  */
 public interface AcceptorControl extends HornetQComponentControl
 {
+   /**
+    * Returns the name of the acceptor
+    */
    String getName();
 
+   /**
+    * Returns the class name of the AcceptorFactory implementation
+    * used by this acceptor.
+    * 
+    * @see AcceptorFactory
+    */
    String getFactoryClassName();
 
+   /**
+    * Returns the parameters used to configure this acceptor
+    */
    Map<String, Object> getParameters();
 }

Modified: trunk/src/main/org/hornetq/core/management/AddressControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/AddressControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/AddressControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -13,33 +13,67 @@
 
 package org.hornetq.core.management;
 
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
+
 /**
+ * An AddressControl is used to manage an address.
+ * 
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
  */
 public interface AddressControl
 {
    // Attributes ----------------------------------------------------
 
+   /**
+    * Returns the managed address.
+    */
    String getAddress();
 
+   /**
+    * Returns the roles (name and permissions) associated to this address.
+    */
    Object[] getRoles() throws Exception;
 
+   /**
+    * Returns the roles  (name and permissions) associated to this address
+    * using JSON serialization.
+    */
    String getRolesAsJSON() throws Exception;
 
+   /**
+    * Returns the names of the queues bound to this address.
+    */
    String[] getQueueNames() throws Exception;
 
+   /**
+    * Returns the number of pages used by this address.
+    */
    int getNumberOfPages() throws Exception;
 
+   /**
+    * Returns the number of bytes used by each page for this address.
+    */
    long getNumberOfBytesPerPage() throws Exception;
 
    // Operations ----------------------------------------------------
 
+   /**
+    * Adds a role to this address.
+    * 
+    * @param name name of the role
+    * @param send can the user send to this address?
+    * @param consume can the user consume from a queue bound to this address?
+    * @param createDurableQueue can the user create a durable queue bound to this address?
+    * @param deleteDurableQueue can the user delete a durable queue bound to this address?
+    * @param createNonDurableQueue can the user create a non-durable queue bound to this address?
+    * @param deleteNonDurableQueue can the user delete a non-durable queue bound to this address?
+    * @param manage can the user send management messages to this address?
+    * @throws Exception if an exception occurred while adding the role
+    */
    @Operation(desc = "Add a Role to this address")
    void addRole(@Parameter(name = "name", desc = "Name of the role to add") String name,
-                @Parameter(name = "send", desc = "Can the user send to an address?") boolean send,
+                @Parameter(name = "send", desc = "Can the user send to this address?") boolean send,
                 @Parameter(name = "consume", desc = "Can the user consume from this address?") boolean consume,
                 @Parameter(name = "createDurableQueue", desc = "Can the user create a durable queue?") boolean createDurableQueue,
                 @Parameter(name = "deleteDurableQueue", desc = "Can the user delete a durable queue?") boolean deleteDurableQueue,
@@ -47,6 +81,11 @@
                 @Parameter(name = "deleteNonDurableQueue", desc = "Can the user delete a temp queue?") boolean deleteNonDurableQueue,
                 @Parameter(name = "manage", desc = "Can the user send management messages?") boolean manage) throws Exception;
 
+   /**
+    * Removes the role corresponding to the specified name from this address.
+    * 
+    * @throws Exception if an exception occurred while removing the role
+    */
    @Operation(desc = "Remove a Role from this address")
    void removeRole(@Parameter(name = "name", desc = "Name of the role to remove") String name) throws Exception;
 }

Modified: trunk/src/main/org/hornetq/core/management/BridgeControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/BridgeControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/BridgeControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -13,35 +13,75 @@
 
 package org.hornetq.core.management;
 
+
 /**
- * A BridgeControlMBean
+ * A BridgeControl is used to manage a Bridge.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  *
  */
 public interface BridgeControl extends HornetQComponentControl
 {
+   /**
+    * Returns the name of this bridge
+    */
    String getName();
 
+   /**
+    * Returns the name of the queue this bridge is consuming messages from.
+    */
    String getQueueName();
 
+   /**
+    * Returns the address this bridge will forward messages to.
+    */
    String getForwardingAddress();
 
+   /**
+    * Returns the filter string associated to this bridge.
+    */
    String getFilterString();
 
+   /**
+    * Return the name of the Transformer implementation associated to this bridge.
+    * 
+    * @see org.hornetq.core.server.cluster.Transformer
+    */
    String getTransformerClassName();
 
+   /**
+    * Returns the pair of connectors used by this bridge.
+    */
    String[] getConnectorPair() throws Exception;
 
+   /**
+    * Returns the name of the discovery group used by this bridge.
+    */
    String getDiscoveryGroupName();
 
+   /**
+    * Returns the retry interval used by this bridge.
+    */
    long getRetryInterval();
 
+   /**
+    * Returns the retry interval multiplier used by this bridge.
+    */
    double getRetryIntervalMultiplier();
 
+   /**
+    * Returns the number of reconnection attempts used by this bridge.
+    */
    int getReconnectAttempts();
 
+   /**
+    * Returns whether the session used by this bridge will failover if
+    * the target server is normally shutdown.
+    */
    boolean isFailoverOnServerShutdown();
 
+   /**
+    * Returns whether this bridge is using duplicate detection.
+    */
    boolean isUseDuplicateDetection();
 }

Modified: trunk/src/main/org/hornetq/core/management/BroadcastGroupControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/BroadcastGroupControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/BroadcastGroupControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,24 +14,46 @@
 package org.hornetq.core.management;
 
 /**
- * A BroadcastGroupControlMBean
+ * A BroadcastGroupControl is used to manage a broadcast group.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  *
  */
 public interface BroadcastGroupControl extends HornetQComponentControl
 {
+   /**
+    * Returns the configuration name of this broadcast group.
+    */
    String getName();
 
+   /**
+    * Returns the local port this broadcast group is bound to.
+    */
    int getLocalBindPort();
 
+   /**
+    * Returns the address this broadcast group is broadcasting to.
+    */
    String getGroupAddress();
 
+   /**
+    * Returns the port this broadcast group is broadcasting to.
+    */
    int getGroupPort();
 
+   /**
+    * Returns the period used by this broadcast group.
+    */
    long getBroadcastPeriod();
 
+   /**
+    * Returns the pairs of live-backup connectors that are broadcasted by this broadcast group.
+    */
    Object[] getConnectorPairs();
 
+   /**
+    * Returns the pairs of live-backup connectors that are broadcasted by this broadcast group
+    * using JSON serialization.
+    */
    String getConnectorPairsAsJSON() throws Exception;
 }

Modified: trunk/src/main/org/hornetq/core/management/ClusterConnectionControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ClusterConnectionControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/ClusterConnectionControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -16,32 +16,68 @@
 import java.util.Map;
 
 /**
- * A ClusterConnectionControlMBean
+ * A ClusterConnectionControl is used to manage a cluster connection.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  *
  */
 public interface ClusterConnectionControl extends HornetQComponentControl
 {
+   /**
+    * Returns the configuration name of this cluster connection.
+    */
    String getName();
 
+   /**
+    * Returns the address used by this cluster connection.
+    */
    String getAddress();
 
+   /**
+    * Returns the node ID used by this cluster connection.
+    */
    String getNodeID();
 
+   /**
+    * Return whether this cluster connection use duplicate detection.
+    */
    boolean isDuplicateDetection();
 
+   /**
+    * Return whether this cluster connection forward messages when it has no local consumers.
+    */
    boolean isForwardWhenNoConsumers();
 
+   /**
+    * Returns the maximum number of hops used by this cluster connection.
+    */
    int getMaxHops();
 
+   /**
+    * Returns the pairs of live-backup connectors used by this cluster connection.
+    */
    Object[] getStaticConnectorNamePairs();
 
+   /**
+    * Returns the pairs of live-backup connectors used by this cluster connection
+    * using JSON serialization.
+    */
    String getStaticConnectorNamePairsAsJSON() throws Exception;
 
+   /**
+    * Returns the name of the discovery group used by this cluster connection.
+    */
    String getDiscoveryGroupName();
 
+   /**
+    * Returns the connection retry interval used by this cluster connection.
+    */
    long getRetryInterval();
 
+   /**
+    * Returns a map of the nodes connected to this cluster connection.
+    * <br>
+    * keys are node IDs, values are the addresses used to connect to the nodes.
+    */
    Map<String, String> getNodes() throws Exception;
 }

Modified: trunk/src/main/org/hornetq/core/management/DayCounterInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/DayCounterInfo.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/DayCounterInfo.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -22,9 +22,6 @@
 
 /**
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
  */
 public class DayCounterInfo
 {
@@ -87,6 +84,8 @@
 
    // Public --------------------------------------------------------
 
+   /**
+    */
    public String getDate()
    {
       return date;

Modified: trunk/src/main/org/hornetq/core/management/DiscoveryGroupControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/DiscoveryGroupControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/DiscoveryGroupControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,18 +14,30 @@
 package org.hornetq.core.management;
 
 /**
- * A DiscoveryGroupControlMBean
+ * A DiscoveryGroupControl is used to manage a discovery group.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  *
  */
 public interface DiscoveryGroupControl extends HornetQComponentControl
 {
+   /**
+    * Returns the configuration name of this discovery group.
+    */
    String getName();
 
+   /**
+    * Returns the address that this discovery group is listening to.
+    */
    String getGroupAddress();
 
+   /**
+    * Returns the port that this discovery group is listening to.
+    */
    int getGroupPort();
 
+   /**
+    * Returns the refresh timeout used by this discovery group.
+    */
    long getRefreshTimeout();
 }

Modified: trunk/src/main/org/hornetq/core/management/DivertControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/DivertControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/DivertControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,24 +14,49 @@
 package org.hornetq.core.management;
 
 /**
+ * A DivertControl is used to manage a divert.
+ * 
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
  */
 public interface DivertControl
 {
+   /**
+    * Returns the filter used by this divert.
+    */
    String getFilter();
 
+   /**
+    * Returns whether this divert is exclusive.
+    * <br>
+    * if {@code true} messages will be exclusively diverted and will not be routed to the origin address,
+    * else messages will be routed both to the origin address and the forwarding address.
+    */
    boolean isExclusive();
 
+   /**
+    * Returns the cluster-wide unique name of this divert.
+    */
    String getUniqueName();
 
+   /**
+    * Returns the routing name of this divert.
+    */
    String getRoutingName();
 
+   /**
+    * Returns the origin address used by this divert.
+    */
    String getAddress();
 
+   /**
+    * Returns the forwarding address used by this divert.
+    */
    String getForwardingAddress();
 
+   /**
+    * Return the name of the Transformer implementation associated to this bridge.
+    * 
+    * @see org.hornetq.core.server.cluster.Transformer
+    */
    String getTransformerClassName();
 }

Modified: trunk/src/main/org/hornetq/core/management/HornetQComponentControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/HornetQComponentControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/HornetQComponentControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,15 +14,24 @@
 package org.hornetq.core.management;
 
 /**
- * A HornetQComponentControl
+ * A HornetQComponentControl is used to manage the lifecycle of a HornetQ components.
  *
  * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
  */
 public interface HornetQComponentControl
 {
+   /**
+    * Returns {@code true} if this component is started, {@code false} else.
+    */
    boolean isStarted();
 
+   /**
+    * Starts this component.
+    */
    void start() throws Exception;
 
+   /**
+    * Stops this component.
+    */
    void stop() throws Exception;
 }

Modified: trunk/src/main/org/hornetq/core/management/HornetQServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/HornetQServerControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/HornetQServerControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -15,188 +15,462 @@
 
 import javax.management.MBeanOperationInfo;
 
-import org.hornetq.core.config.Configuration;
+import org.hornetq.core.exception.HornetQException;
+import org.hornetq.core.remoting.Interceptor;
+import org.hornetq.core.server.management.Operation;
+import org.hornetq.core.server.management.Parameter;
 
 /**
- * This interface describes the core management interface exposed by the server
+ * A HornetQServerControl is used to manage HornetQ servers.
  */
 public interface HornetQServerControl
 {
    // Attributes ----------------------------------------------------
 
+   /**
+    * Returns the name of the connector used to connect to the backup.
+    * <br>
+    * If this server has no backup or is itself a backup, the value is {@code null}.
+    */
    String getBackupConnectorName();
 
+   /**
+    * Returns this server's version.
+    */
    String getVersion();
 
+   /**
+    * Returns the number of connections connected to this server.
+    */
    int getConnectionCount();
 
+   /**
+    * Return whether this server is started.
+    */
    boolean isStarted();
 
+   /**
+    * Returns the list of interceptors used by this server.
+    * 
+    * @see Interceptor
+    */
    String[] getInterceptorClassNames();
 
+   /**
+    * Returns whether this server is clustered.
+    */
    boolean isClustered();
 
+   /**
+    * Returns the maximum number of threads in the <em>scheduled</em> thread pool.
+    */
    int getScheduledThreadPoolMaxSize();
 
+   /**
+    * Returns the maximum number of threads in the thread pool.
+    */
    int getThreadPoolMaxSize();
 
+   /**
+    * Returns the interval time (in milliseconds) to invalidate security credentials.
+    */
    long getSecurityInvalidationInterval();
 
+   /**
+    * Returns whether security is enabled for this server.
+    */
    boolean isSecurityEnabled();
 
+   /**
+    * Returns the file system directory used to store bindings.
+    */
    String getBindingsDirectory();
 
+   /**
+    * Returns the file system directory used to store journal log.
+    */
    String getJournalDirectory();
 
+   /**
+    * Returns the type of journal used by this server (either {@code NIO} or {@code ASYNCIO}).
+    */
    String getJournalType();
 
+   /**
+    * Returns whether the journal is synchronized when receiving transactional data.
+    */
    boolean isJournalSyncTransactional();
 
+   /**
+    * Returns whether the journal is synchronized when receiving non-transactional data.
+    */
    boolean isJournalSyncNonTransactional();
 
+   /**
+    * Returns the size (in bytes) of each journal files.
+    */
    int getJournalFileSize();
 
+   /**
+    * Returns the number of journal files to pre-create.
+    */
    int getJournalMinFiles();
 
+   /**
+    * Returns the maximum number of write requests that can be in the AIO queue at any given time.
+    */
    int getJournalMaxIO();
 
+   /**
+    * Returns the size of the internal buffer on the journal.
+    */
    int getJournalBufferSize();
 
+   /**
+    * Returns the timeout (in nanoseconds) used to flush internal buffers on the journal.
+    */
    int getJournalBufferTimeout();
 
+   /**
+    * Returns the minimal number of journal files before compacting.
+    */
    int getJournalCompactMinFiles();
 
+   /**
+    * Return the percentage of live data before compacting the journal.
+    */
    int getJournalCompactPercentage();
 
+   /**
+    * Returns whether this server is using persistence and store data.
+    */
    boolean isPersistenceEnabled();
 
+   /**
+    * Returns whether the bindings directory is created on this server startup.
+    */
    boolean isCreateBindingsDir();
 
+   /**
+    * Returns whether the journal directory is created on this server startup.
+    */
    boolean isCreateJournalDir();
 
-   Configuration getConfiguration();
-
+   /**
+    * Returns whether message counter is enabled for this server.
+    */
    boolean isMessageCounterEnabled();
 
+   /**
+    * Returns the maximum number of days kept in memory for message counter.
+    */
    int getMessageCounterMaxDayCount();
 
+   /**
+    * Sets the maximum number of days kept in memory for message counter.
+    * 
+    * @count value must be greater than 0
+    */
    void setMessageCounterMaxDayCount(int count) throws Exception;
 
+   /**
+    * Returns the sample period (in milliseconds) to take message counter snapshot.
+    */
    long getMessageCounterSamplePeriod();
 
+   /**
+    * Sets the sample period to take message counter snapshot.
+    * 
+    * @param newPeriod value must be greater than 1000ms
+    */
    void setMessageCounterSamplePeriod(long newPeriod) throws Exception;
 
+   /**
+    * Returns {@code true} if this server is a backup, {@code false} if it is a live server.
+    * <br>
+    * If a backup server has been activated, returns {@code false}.
+    */
    boolean isBackup();
 
+   /**
+    * Returns whether this server shares its data store with a corresponding live or backup server.
+    */
    boolean isSharedStore();
 
+   /**
+    * Returns the file system directory used to store paging files.
+    */
    String getPagingDirectory();
 
+   /**
+    * Returns whether delivery count is persisted before messages are delivered to the consumers.
+    */
    boolean isPersistDeliveryCountBeforeDelivery();
 
+   /**
+    * Returns the connection time to live.
+    * <br>
+    * This value overrides the connection time to live <em>sent by the client</em>.
+    */
    long getConnectionTTLOverride();
 
+   /**
+    * Returns the management address of this server.
+    * <br>
+    * Clients can send management messages to this address to manage this server.
+    */
    String getManagementAddress();
 
+   /**
+    * Returns the management notification address of this server.
+    * <br>
+    * Clients can bind queues to this address to receive management notifications emitted by this server.
+    */
    String getManagementNotificationAddress();
 
-   long getManagementRequestTimeout();
-
+   /**
+    * Returns the size of the cache for pre-creating message IDs.
+    */
    int getIDCacheSize();
 
+   /**
+    * Returns whether message ID cache is persisted.
+    */
    boolean isPersistIDCache();
 
+   /**
+    * Returns the file system directory used to store large messages.
+    */
    String getLargeMessagesDirectory();
 
+   /**
+    * Returns whether wildcard routing is supported by this server.
+    */
    boolean isWildcardRoutingEnabled();
 
+   /**
+    * Returns the timeout (in milliseconds) after which transactions is removed 
+    * from the resource manager after it was created.
+    */
    long getTransactionTimeout();
 
+   /**
+    * Returns the frequency (in milliseconds)  to scan transactions to detect which transactions 
+    * have timed out.
+    */
    long getTransactionTimeoutScanPeriod();
 
+   /**
+    * Returns the frequency (in milliseconds)  to scan messages to detect which messages 
+    * have expired.
+    */
    long getMessageExpiryScanPeriod();
 
+   /**
+    * Returns the priority of the thread used to scan message expiration.
+    */
    long getMessageExpiryThreadPriority();
 
+   /**
+    * Returns the connectors configured for this server.
+    */
    Object[] getConnectors() throws Exception;
 
+   /**
+    * Returns the connectors configured for this server using JSON serialization.
+    */
    String getConnectorsAsJSON() throws Exception;
 
+   /**
+    * Returns the addresses created on this server.
+    */
    String[] getAddressNames();
 
+   /**
+    * Returns the names of the queues created on this server.
+    */
    String[] getQueueNames();
 
    // Operations ----------------------------------------------------
 
+   /**
+    * Create a durable queue.
+    * <br>
+    * This method throws a {@link HornetQException#QUEUE_EXISTS}) exception if the queue already exits.
+    * 
+    * @param address address to bind the queue to
+    * @param name name of the queue
+    */
    @Operation(desc = "Create a queue with the specified address", impact = MBeanOperationInfo.ACTION)
    void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name) throws Exception;
 
+   /**
+    * Create a queue.
+    * <br>
+    * This method throws a {@link HornetQException#QUEUE_EXISTS}) exception if the queue already exits.
+    * 
+    * @param address address to bind the queue to
+    * @param name name of the queue
+    * @param filter of the queue
+    * @param durable whether the queue is durable
+    */
    @Operation(desc = "Create a queue", impact = MBeanOperationInfo.ACTION)
    void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name,
                     @Parameter(name = "filter", desc = "Filter of the queue") String filter,
                     @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
 
+   /**
+    * Create a queue.
+    * <br>
+    * This method throws a {@link HornetQException#QUEUE_EXISTS}) exception if the queue already exits.
+    * 
+    * @param address address to bind the queue to
+    * @param name name of the queue
+    * @param durable whether the queue is durable
+    */
    @Operation(desc = "Create a queue with the specified address, name and durability", impact = MBeanOperationInfo.ACTION)
    void createQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name,
                     @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
 
+   /**
+    * Deploy a durable queue.
+    * <br>
+    * This method will do nothing if the queue with the given name already exists on the server.
+    * 
+    * @param address address to bind the queue to
+    * @param name name of the queue
+    * @param filter of the queue
+    */
    @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
    void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name,
-                    String filterString) throws Exception;
+                    @Parameter(name = "filter", desc = "Filter of the queue")String filter) throws Exception;
 
+   /**
+    * Deploy a queue.
+    * <br>
+    * This method will do nothing if the queue with the given name already exists on the server.
+    * 
+    * @param address address to bind the queue to
+    * @param name name of the queue
+    * @param filter of the queue
+    * @param durable whether the queue is durable
+    */
    @Operation(desc = "Deploy a queue", impact = MBeanOperationInfo.ACTION)
    void deployQueue(@Parameter(name = "address", desc = "Address of the queue") String address,
                     @Parameter(name = "name", desc = "Name of the queue") String name,
                     @Parameter(name = "filter", desc = "Filter of the queue") String filter,
                     @Parameter(name = "durable", desc = "Is the queue durable?") boolean durable) throws Exception;
 
+   /**
+    * Destroys the queue corresponding to the specified name.
+    */
    @Operation(desc = "Destroy a queue", impact = MBeanOperationInfo.ACTION)
    void destroyQueue(@Parameter(name = "name", desc = "Name of the queue to destroy") String name) throws Exception;
 
+   /**
+    * Enables message counters for this server.
+    */
    @Operation(desc = "Enable message counters", impact = MBeanOperationInfo.ACTION)
    void enableMessageCounters() throws Exception;
 
+   /**
+    * Disables message counters for this server.
+    */
    @Operation(desc = "Disable message counters", impact = MBeanOperationInfo.ACTION)
    void disableMessageCounters() throws Exception;
 
+   /**
+    * Reset all message counters.
+    */
    @Operation(desc = "Reset all message counters", impact = MBeanOperationInfo.ACTION)
    void resetAllMessageCounters() throws Exception;
 
+   /**
+    * Reset histories for all message counters.
+    */
    @Operation(desc = "Reset all message counters history", impact = MBeanOperationInfo.ACTION)
    void resetAllMessageCounterHistories() throws Exception;
 
+   /**
+    * List all the prepared transaction, sorted by date, oldest first.
+    * <br>
+    * The Strings are Base-64 representation of the transaction XID and can be
+    * used to heuristically commit or rollback the transactions.
+    * 
+    * @see #commitPreparedTransaction(String), {@link #rollbackPreparedTransaction(String)}
+    */
    @Operation(desc = "List all the prepared transaction, sorted by date, oldest first")
    String[] listPreparedTransactions() throws Exception;
 
+   /**
+    * List transactions which have been heuristically committed.
+    */
    String[] listHeuristicCommittedTransactions() throws Exception;
 
+   /**
+    * List transactions which have been heuristically rolled back.
+    */
    String[] listHeuristicRolledBackTransactions() throws Exception;
 
+   /**
+    * Heuristically commits a prepared transaction.
+    * 
+    * @param transactionAsBase64 base 64 representation of a prepare transaction
+    * @return {@code true} if the transaction was successfully committed, {@code false} else
+    * 
+    * @see #listPreparedTransactions()
+    */
    @Operation(desc = "Commit a prepared transaction")
    boolean commitPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
 
+   /**
+    * Heuristically rolls back a prepared transaction.
+    * 
+    * @param transactionAsBase64 base 64 representation of a prepare transaction
+    * @return {@code true} if the transaction was successfully rolled back, {@code false} else
+    * 
+    * @see #listPreparedTransactions()
+    */
    @Operation(desc = "Rollback a prepared transaction")
    boolean rollbackPreparedTransaction(@Parameter(desc = "the Base64 representation of a transaction", name = "transactionAsBase64") String transactionAsBase64) throws Exception;
 
+   /**
+    * Lists the addresses of all the clients connected to this address.
+    */
    @Operation(desc = "List the client addresses", impact = MBeanOperationInfo.INFO)
    String[] listRemoteAddresses() throws Exception;
 
+   /**
+    * Lists the addresses of the clients connected to this address which matches the specified IP address.
+    */
    @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;
 
+   /**
+    * Closes all the connections of clients connected to this server which matches the specified IP address.
+    */
    @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;
 
+   /**
+    * Lists all the IDs of the connections connected to this server.
+    */
    @Operation(desc = "List all the connection IDs", impact = MBeanOperationInfo.INFO)
    String[] listConnectionIDs() throws Exception;
 
+   /**
+    * Lists all the sessions IDs for the specified connection ID.
+    */
    @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;
 
+   /**
+    * This method is used by HornetQ clustering and must not be called by HornetQ clients.
+    */
    void sendQueueInfoToQueue(String queueName, String address) throws Exception;
 
 }

Deleted: trunk/src/main/org/hornetq/core/management/ManagementService.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ManagementService.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/ManagementService.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -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.core.management;
-
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-
-import javax.management.ObjectName;
-
-import org.hornetq.core.cluster.DiscoveryGroup;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.TransportConfiguration;
-import org.hornetq.core.config.cluster.BridgeConfiguration;
-import org.hornetq.core.config.cluster.BroadcastGroupConfiguration;
-import org.hornetq.core.config.cluster.ClusterConnectionConfiguration;
-import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
-import org.hornetq.core.config.cluster.DivertConfiguration;
-import org.hornetq.core.management.impl.HornetQServerControlImpl;
-import org.hornetq.core.messagecounter.MessageCounterManager;
-import org.hornetq.core.paging.PagingManager;
-import org.hornetq.core.persistence.StorageManager;
-import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.remoting.server.RemotingService;
-import org.hornetq.core.remoting.spi.Acceptor;
-import org.hornetq.core.security.Role;
-import org.hornetq.core.server.Divert;
-import org.hornetq.core.server.HornetQComponent;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.Queue;
-import org.hornetq.core.server.QueueFactory;
-import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.cluster.Bridge;
-import org.hornetq.core.server.cluster.BroadcastGroup;
-import org.hornetq.core.server.cluster.ClusterConnection;
-import org.hornetq.core.settings.HierarchicalRepository;
-import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.core.transaction.ResourceManager;
-import org.hornetq.utils.SimpleString;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public interface ManagementService extends NotificationService, HornetQComponent
-{
-   // Configuration
-
-   MessageCounterManager getMessageCounterManager();
-
-   String getClusterUser();
-
-   String getClusterPassword();
-
-   SimpleString getManagementAddress();
-
-   SimpleString getManagementNotificationAddress();
-
-   ObjectNameBuilder getObjectNameBuilder();
-
-   // Resource Registration
-
-   void setStorageManager(StorageManager storageManager);
-
-   HornetQServerControlImpl registerServer(PostOffice postOffice,
-                                           StorageManager storageManager,
-                                           Configuration configuration,
-                                           HierarchicalRepository<AddressSettings> addressSettingsRepository,
-                                           HierarchicalRepository<Set<Role>> securityRepository,
-                                           ResourceManager resourceManager,
-                                           RemotingService remotingService,
-                                           HornetQServer messagingServer,
-                                           QueueFactory queueFactory,
-                                           ScheduledExecutorService scheduledThreadPool,
-                                           final PagingManager pagingManager,
-                                           boolean backup) throws Exception;
-
-   void unregisterServer() throws Exception;
-
-   void registerInJMX(ObjectName objectName, Object managedResource) throws Exception;
-
-   void unregisterFromJMX(final ObjectName objectName) throws Exception;
-
-   void registerInRegistry(String resourceName, Object managedResource);
-
-   void unregisterFromRegistry(final String resourceName);
-
-   void registerAddress(SimpleString address) throws Exception;
-
-   void unregisterAddress(SimpleString address) throws Exception;
-
-   void registerQueue(Queue queue, SimpleString address, StorageManager storageManager) throws Exception;
-
-   void unregisterQueue(SimpleString name, SimpleString address) throws Exception;
-
-   void registerAcceptor(Acceptor acceptor, TransportConfiguration configuration) throws Exception;
-
-   void unregisterAcceptors();
-
-   void registerDivert(Divert divert, DivertConfiguration config) throws Exception;
-
-   void unregisterDivert(SimpleString name) throws Exception;
-
-   void registerBroadcastGroup(BroadcastGroup broadcastGroup, BroadcastGroupConfiguration configuration) throws Exception;
-
-   void unregisterBroadcastGroup(String name) throws Exception;
-
-   void registerDiscoveryGroup(DiscoveryGroup discoveryGroup, DiscoveryGroupConfiguration configuration) throws Exception;
-
-   void unregisterDiscoveryGroup(String name) throws Exception;
-
-   void registerBridge(Bridge bridge, BridgeConfiguration configuration) throws Exception;
-
-   void unregisterBridge(String name) throws Exception;
-
-   void registerCluster(ClusterConnection cluster, ClusterConnectionConfiguration configuration) throws Exception;
-
-   void unregisterCluster(String name) throws Exception;
-
-   Object getResource(String resourceName);
-
-   Object[] getResources(Class<?> resourceType);
-
-   ServerMessage handleMessage(ServerMessage message) throws Exception;
-}

Deleted: trunk/src/main/org/hornetq/core/management/Notification.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/Notification.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/Notification.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,62 +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.core.management;
-
-import org.hornetq.utils.TypedProperties;
-
-/**
- * A Notification
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
- * Created 22 Jan 2009 16:41:12
- *
- *
- */
-public class Notification
-{
-   private final NotificationType type;
-
-   private final TypedProperties properties;
-
-   private final String uid;
-
-   public Notification(final String uid, final NotificationType type, final TypedProperties properties)
-   {
-      this.uid = uid;
-      this.type = type;
-      this.properties = properties;
-   }
-
-   public NotificationType getType()
-   {
-      return type;
-   }
-
-   public TypedProperties getProperties()
-   {
-      return properties;
-   }
-
-   public String getUID()
-   {
-      return uid;
-   }
-
-   @Override
-   public String toString()
-   {
-      return "Notification[uid=" + uid + ", type=" + type + ", properties=" + properties + "]";
-   }
-}

Deleted: trunk/src/main/org/hornetq/core/management/NotificationListener.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/NotificationListener.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/NotificationListener.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,28 +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.core.management;
-
-/**
- * A NotificationListener
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- * 
- * Created 22 Jan 2009 16:48:27
- *
- *
- */
-public interface NotificationListener
-{
-   void onNotification(Notification notification);
-}

Deleted: trunk/src/main/org/hornetq/core/management/NotificationService.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/NotificationService.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/NotificationService.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,47 +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.core.management;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-
-/**
- * A NotificationService
- *
- * @author jmesnil
- *
- *
- */
-public interface NotificationService
-{
-   /** 
-    * the message corresponding to a notification will always contain the properties:
-    * <ul>
-    *   <li><code>ManagementHelper.HDR_NOTIFICATION_TYPE</code> - the type of notification (SimpleString)</li>
-    *   <li><code>ManagementHelper.HDR_NOTIFICATION_MESSAGE</code> - a message contextual to the notification (SimpleString)</li>
-    *   <li><code>ManagementHelper.HDR_NOTIFICATION_TIMESTAMP</code> - the timestamp when the notification occured (long)</li>
-    * </ul>
-    * 
-    * in addition to the properties defined in <code>props</code>
-    * 
-    * @see ManagementHelper
-    */
-   void sendNotification(Notification notification) throws Exception;
-
-   void enableNotifications(boolean enable);
-
-   void addNotificationListener(NotificationListener listener);
-
-   void removeNotificationListener(NotificationListener listener);
-
-}

Modified: trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/ObjectNameBuilder.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -16,10 +16,14 @@
 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.utils.SimpleString;
 
 /**
- * A ObjectNameBuilder
+ * Helper class to build ObjectNames for HornetQ resources.
  *
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  *
@@ -29,6 +33,9 @@
 
    // Constants -----------------------------------------------------
 
+   /**
+    * Default JMX domain for HornetQ resources.
+    */
    public static ObjectNameBuilder DEFAULT = new ObjectNameBuilder(ConfigurationImpl.DEFAULT_JMX_DOMAIN);
 
    public static final String JMS_MODULE = "JMS";
@@ -55,16 +62,29 @@
 
    // Public --------------------------------------------------------
 
+   /**
+    * Returns the ObjectName used by the single HornetQServerControl.
+    */
    public ObjectName getHornetQServerObjectName() throws Exception
    {
       return ObjectName.getInstance(domain + ":module=Core,type=Server");
    }
 
+   /**
+    * Returns the ObjectName used by AddressControl.
+    * 
+    * @see AddressControl
+    */
    public ObjectName getAddressObjectName(final SimpleString address) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "Address", address.toString());
    }
 
+   /**
+    * Returns the ObjectName used by QueueControl.
+    * 
+    * @see QueueControl
+    */
    public ObjectName getQueueObjectName(final SimpleString address, final SimpleString name) throws Exception
    {
       return ObjectName.getInstance(String.format("%s:module=%s,type=%s,address=%s,name=%s",
@@ -75,51 +95,101 @@
                                                   ObjectName.quote(name.toString())));
    }
 
+   /**
+    * Returns the ObjectName used by DivertControl.
+    * 
+    * @see DivertControl
+    */
    public ObjectName getDivertObjectName(final SimpleString name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "Divert", name.toString());
    }
 
+   /**
+    * Returns the ObjectName used by AcceptorControl.
+    * 
+    * @see AcceptorControl
+    */
    public ObjectName getAcceptorObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "Acceptor", name);
    }
 
+   /**
+    * Returns the ObjectName used by BroadcastGroupControl.
+    * 
+    * @see BroadcastGroupControl
+    */
    public ObjectName getBroadcastGroupObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "BroadcastGroup", name);
    }
 
+   /**
+    * Returns the ObjectName used by BridgeControl.
+    * 
+    * @see BridgeControl
+    */
    public ObjectName getBridgeObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "JMSBridge", name);
    }
 
+   /**
+    * Returns the ObjectName used by ClusterConnectionControl.
+    * 
+    * @see ClusterConnectionControl
+    */
    public ObjectName getClusterConnectionObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "ClusterConnection", name);
    }
 
+   /**
+    * Returns the ObjectName used by DiscoveryGroupControl.
+    * 
+    * @see DiscoveryGroupControl
+    */
    public ObjectName getDiscoveryGroupObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.CORE_MODULE, "DiscoveryGroup", name);
    }
 
+   /**
+    * Returns the ObjectName used by JMSServerControl.
+    * 
+    * @see JMSServerControl
+    */
    public ObjectName getJMSServerObjectName() throws Exception
    {
       return ObjectName.getInstance(domain + ":module=JMS,type=Server");
    }
 
+   /**
+    * Returns the ObjectName used by JMSQueueControl.
+    * 
+    * @see JMSQueueControl
+    */
    public ObjectName getJMSQueueObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.JMS_MODULE, "Queue", name);
    }
 
+   /**
+    * Returns the ObjectName used by TopicControl.
+    * 
+    * @see TopicControl
+    */
    public ObjectName getJMSTopicObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.JMS_MODULE, "Topic", name);
    }
 
+   /**
+    * Returns the ObjectName used by ConnectionFactoryControl.
+    * 
+    * @see ConnectionFactoryControl
+    */
    public ObjectName getConnectionFactoryObjectName(final String name) throws Exception
    {
       return createObjectName(ObjectNameBuilder.JMS_MODULE, "ConnectionFactory", name);

Deleted: trunk/src/main/org/hornetq/core/management/Operation.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/Operation.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/Operation.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,43 +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.core.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import javax.management.MBeanOperationInfo;
-
-/**
- * Info for a MBean Operation.
- * 
- * This annotation is used only for methods which can be invoked
- * through a GUI.
- * 
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target(ElementType.METHOD)
- at Inherited
-public @interface Operation
-{
-   String desc();
-
-   int impact() default MBeanOperationInfo.INFO;
-}

Deleted: trunk/src/main/org/hornetq/core/management/Parameter.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/Parameter.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/Parameter.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,36 +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.core.management;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Info for a MBean Operation Parameter.
- * 
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target(ElementType.PARAMETER)
-public @interface Parameter
-{
-   String name();
-
-   String desc() default "N/A";
-}

Modified: trunk/src/main/org/hornetq/core/management/QueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/QueueControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/QueueControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -17,6 +17,9 @@
 
 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>
  * 

Modified: trunk/src/main/org/hornetq/core/management/ResourceNames.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/ResourceNames.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/ResourceNames.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,11 +14,9 @@
 package org.hornetq.core.management;
 
 /**
- * A ResourceNames
+ * Helper class used to build resource names used by management messages.
  *
- * @author jmesnil
- *
- *
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
  */
 public class ResourceNames
 {

Modified: trunk/src/main/org/hornetq/core/management/RoleInfo.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/RoleInfo.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/RoleInfo.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -17,6 +17,9 @@
 import org.hornetq.utils.json.JSONObject;
 
 /**
+ * Helper class to create Java Objects from the
+ * JSON serialization returned by {@link AddressControl#getRolesAsJSON()}.
+ * 
  * @author <a href="jmesnil at redhat.com">Jeff Mesnil</a>
  */
 public class RoleInfo
@@ -37,6 +40,10 @@
 
    final private boolean manage;
 
+   /**
+    * Returns an array of RoleInfo corresponding to the JSON serialization returned
+    * by {@link AddressControl#getRolesAsJSON()}.
+    */
    public static final RoleInfo[] from(final String jsonString) throws Exception
    {
       JSONArray array = new JSONArray(jsonString);
@@ -76,41 +83,65 @@
       this.manage = manage;
    }
 
+   /**
+    * Returns the name of the role.
+    */
    public String getName()
    {
       return name;
    }
 
+   /**
+    * Returns whether this role can send messages to the address.
+    */
    public boolean isSend()
    {
       return send;
    }
 
+   /**
+    * Returns whether this role can consume messages from queues bound to the address.
+    */
    public boolean isConsume()
    {
       return consume;
    }
 
+   /**
+    * Returns whether this role can create durable queues bound to the address.
+    */
    public boolean isCreateDurableQueue()
    {
       return createDurableQueue;
    }
 
+   /**
+    * Returns whether this role can delete durable queues bound to the address.
+    */
    public boolean isDeleteDurableQueue()
    {
       return deleteDurableQueue;
    }
 
+   /**
+    * Returns whether this role can create non-durable queues bound to the address.
+    */
    public boolean isCreateNonDurableQueue()
    {
       return createNonDurableQueue;
    }
 
+   /**
+    * Returns whether this role can delete non-durable queues bound to the address.
+    */
    public boolean isDeleteNonDurableQueue()
    {
       return deleteNonDurableQueue;
    }
 
+   /**
+    * Returns whether this role can send management messages to the address.
+    */
    public boolean isManage()
    {
       return manage;

Modified: trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/impl/HornetQServerControlImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1173,11 +1173,6 @@
       return configuration.getManagementNotificationAddress().toString();
    }
 
-   public long getManagementRequestTimeout()
-   {
-      return configuration.getManagementRequestTimeout();
-   }
-
    public long getMessageExpiryScanPeriod()
    {
       return configuration.getMessageExpiryScanPeriod();

Modified: trunk/src/main/org/hornetq/core/management/impl/MBeanInfoHelper.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/MBeanInfoHelper.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/impl/MBeanInfoHelper.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -21,8 +21,8 @@
 import javax.management.MBeanOperationInfo;
 import javax.management.MBeanParameterInfo;
 
-import org.hornetq.core.management.Operation;
-import org.hornetq.core.management.Parameter;
+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>

Deleted: trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -1,862 +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.core.management.impl;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-
-import javax.management.MBeanServer;
-import javax.management.NotificationBroadcasterSupport;
-import javax.management.ObjectName;
-import javax.management.StandardMBean;
-
-import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.core.cluster.DiscoveryGroup;
-import org.hornetq.core.config.Configuration;
-import org.hornetq.core.config.TransportConfiguration;
-import org.hornetq.core.config.cluster.BridgeConfiguration;
-import org.hornetq.core.config.cluster.BroadcastGroupConfiguration;
-import org.hornetq.core.config.cluster.ClusterConnectionConfiguration;
-import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
-import org.hornetq.core.config.cluster.DivertConfiguration;
-import org.hornetq.core.config.impl.ConfigurationImpl;
-import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.AcceptorControl;
-import org.hornetq.core.management.BridgeControl;
-import org.hornetq.core.management.BroadcastGroupControl;
-import org.hornetq.core.management.ClusterConnectionControl;
-import org.hornetq.core.management.DiscoveryGroupControl;
-import org.hornetq.core.management.DivertControl;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationListener;
-import org.hornetq.core.management.ObjectNameBuilder;
-import org.hornetq.core.management.ResourceNames;
-import org.hornetq.core.messagecounter.MessageCounter;
-import org.hornetq.core.messagecounter.MessageCounterManager;
-import org.hornetq.core.messagecounter.impl.MessageCounterManagerImpl;
-import org.hornetq.core.paging.PagingManager;
-import org.hornetq.core.persistence.StorageManager;
-import org.hornetq.core.postoffice.PostOffice;
-import org.hornetq.core.remoting.server.RemotingService;
-import org.hornetq.core.remoting.spi.Acceptor;
-import org.hornetq.core.security.Role;
-import org.hornetq.core.server.Divert;
-import org.hornetq.core.server.HornetQServer;
-import org.hornetq.core.server.Queue;
-import org.hornetq.core.server.QueueFactory;
-import org.hornetq.core.server.ServerMessage;
-import org.hornetq.core.server.cluster.Bridge;
-import org.hornetq.core.server.cluster.BroadcastGroup;
-import org.hornetq.core.server.cluster.ClusterConnection;
-import org.hornetq.core.server.impl.ServerMessageImpl;
-import org.hornetq.core.settings.HierarchicalRepository;
-import org.hornetq.core.settings.impl.AddressSettings;
-import org.hornetq.core.transaction.ResourceManager;
-import org.hornetq.utils.SimpleString;
-import org.hornetq.utils.TypedProperties;
-
-/*
- * @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 class ManagementServiceImpl implements ManagementService
-{
-   // Constants -----------------------------------------------------
-
-   private static final Logger log = Logger.getLogger(ManagementServiceImpl.class);
-
-   private final MBeanServer mbeanServer;
-
-   private final boolean jmxManagementEnabled;
-
-   private final Map<String, Object> registry;
-
-   private final NotificationBroadcasterSupport broadcaster;
-
-   private PostOffice postOffice;
-
-   private PagingManager pagingManager;
-
-   private StorageManager storageManager;
-
-   private HornetQServer messagingServer;
-
-   private HierarchicalRepository<Set<Role>> securityRepository;
-
-   private HierarchicalRepository<AddressSettings> addressSettingsRepository;
-
-   private HornetQServerControlImpl messagingServerControl;
-
-   private MessageCounterManager messageCounterManager;
-
-   private final SimpleString managementNotificationAddress;
-
-   private final SimpleString managementAddress;
-
-   private final String managementClusterUser;
-
-   private final String managementClusterPassword;
-
-   private final long managementRequestTimeout;
-
-   private boolean started = false;
-
-   private final boolean messageCounterEnabled;
-
-   private boolean notificationsEnabled;
-
-   private final Set<NotificationListener> listeners = new org.hornetq.utils.ConcurrentHashSet<NotificationListener>();
-
-   private final ObjectNameBuilder objectNameBuilder;
-
-   // Static --------------------------------------------------------
-
-   private static void checkDefaultManagementClusterCredentials(final String user, final String password)
-   {
-      if (ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_USER.equals(user) && ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_PASSWORD.equals(password))
-      {
-         ManagementServiceImpl.log.warn("It has been detected that the cluster admin user and password which are used to " + "replicate management operation from one node to the other have not been changed from the installation default. "
-                                        + "Please see the HornetQ user guide for instructions on how to do this.");
-      }
-   }
-
-   // Constructor ----------------------------------------------------
-
-   public ManagementServiceImpl(final MBeanServer mbeanServer, final Configuration configuration)
-   {
-      this.mbeanServer = mbeanServer;
-      jmxManagementEnabled = configuration.isJMXManagementEnabled();
-      messageCounterEnabled = configuration.isMessageCounterEnabled();
-      managementAddress = configuration.getManagementAddress();
-      managementNotificationAddress = configuration.getManagementNotificationAddress();
-      managementClusterUser = configuration.getManagementClusterUser();
-      managementClusterPassword = configuration.getManagementClusterPassword();
-      managementRequestTimeout = configuration.getManagementRequestTimeout();
-
-      ManagementServiceImpl.checkDefaultManagementClusterCredentials(managementClusterUser, managementClusterPassword);
-
-      registry = new HashMap<String, Object>();
-      broadcaster = new NotificationBroadcasterSupport();
-      notificationsEnabled = true;
-      objectNameBuilder = ObjectNameBuilder.create(configuration.getJMXDomain());
-   }
-
-   // Public --------------------------------------------------------
-
-   // ManagementService implementation -------------------------
-
-   public ObjectNameBuilder getObjectNameBuilder()
-   {
-      return objectNameBuilder;
-   }
-
-   public MessageCounterManager getMessageCounterManager()
-   {
-      return messageCounterManager;
-   }
-
-   public void setStorageManager(final StorageManager storageManager)
-   {
-      this.storageManager = storageManager;
-   }
-
-   public HornetQServerControlImpl registerServer(final PostOffice postOffice,
-                                                  final StorageManager storageManager,
-                                                  final Configuration configuration,
-                                                  final HierarchicalRepository<AddressSettings> addressSettingsRepository,
-                                                  final HierarchicalRepository<Set<Role>> securityRepository,
-                                                  final ResourceManager resourceManager,
-                                                  final RemotingService remotingService,
-                                                  final HornetQServer messagingServer,
-                                                  final QueueFactory queueFactory,
-                                                  final ScheduledExecutorService scheduledThreadPool,
-                                                  final PagingManager pagingManager,
-                                                  final boolean backup) throws Exception
-   {
-      this.postOffice = postOffice;
-      this.addressSettingsRepository = addressSettingsRepository;
-      this.securityRepository = securityRepository;
-      this.storageManager = storageManager;
-      this.messagingServer = messagingServer;
-      this.pagingManager = pagingManager;
-
-      messageCounterManager = new MessageCounterManagerImpl(scheduledThreadPool);
-      messageCounterManager.setMaxDayCount(configuration.getMessageCounterMaxDayHistory());
-      messageCounterManager.reschedule(configuration.getMessageCounterSamplePeriod());
-
-      messagingServerControl = new HornetQServerControlImpl(postOffice,
-                                                            configuration,
-                                                            resourceManager,
-                                                            remotingService,
-                                                            messagingServer,
-                                                            messageCounterManager,
-                                                            storageManager,
-                                                            broadcaster);
-      ObjectName objectName = objectNameBuilder.getHornetQServerObjectName();
-      registerInJMX(objectName, messagingServerControl);
-      registerInRegistry(ResourceNames.CORE_SERVER, messagingServerControl);
-
-      return messagingServerControl;
-   }
-
-   public synchronized void unregisterServer() throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getHornetQServerObjectName();
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_SERVER);
-   }
-
-   public synchronized void registerAddress(final SimpleString address) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
-      AddressControlImpl addressControl = new AddressControlImpl(address,
-                                                                 postOffice,
-                                                                 pagingManager,
-                                                                 storageManager,
-                                                                 securityRepository);
-
-      registerInJMX(objectName, addressControl);
-
-      registerInRegistry(ResourceNames.CORE_ADDRESS + address, addressControl);
-
-      if (ManagementServiceImpl.log.isDebugEnabled())
-      {
-         ManagementServiceImpl.log.debug("registered address " + objectName);
-      }
-   }
-
-   public synchronized void unregisterAddress(final SimpleString address) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
-
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_ADDRESS + address);
-   }
-
-   public synchronized void registerQueue(final Queue queue,
-                                          final SimpleString address,
-                                          final StorageManager storageManager) throws Exception
-   {
-      QueueControlImpl queueControl = new QueueControlImpl(queue,
-                                                           address.toString(),
-                                                           postOffice,
-                                                           storageManager,
-                                                           addressSettingsRepository);
-      if (messageCounterManager != null)
-      {
-         MessageCounter counter = new MessageCounter(queue.getName().toString(),
-                                                     null,
-                                                     queueControl,
-                                                     false,
-                                                     queue.isDurable(),
-                                                     messageCounterManager.getMaxDayCount());
-         queueControl.setMessageCounter(counter);
-         messageCounterManager.registerMessageCounter(queue.getName().toString(), counter);
-      }
-      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName());
-      registerInJMX(objectName, queueControl);
-      registerInRegistry(ResourceNames.CORE_QUEUE + queue.getName(), queueControl);
-
-      if (ManagementServiceImpl.log.isDebugEnabled())
-      {
-         ManagementServiceImpl.log.debug("registered queue " + objectName);
-      }
-   }
-
-   public synchronized void unregisterQueue(final SimpleString name, final SimpleString address) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_QUEUE + name);
-      messageCounterManager.unregisterMessageCounter(name.toString());
-   }
-
-   public synchronized void registerDivert(final Divert divert, final DivertConfiguration config) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getDivertObjectName(divert.getUniqueName());
-      DivertControl divertControl = new DivertControlImpl(divert, storageManager, config);
-      registerInJMX(objectName, new StandardMBean(divertControl, DivertControl.class));
-      registerInRegistry(ResourceNames.CORE_DIVERT + config.getName(), divertControl);
-
-      if (ManagementServiceImpl.log.isDebugEnabled())
-      {
-         ManagementServiceImpl.log.debug("registered divert " + objectName);
-      }
-   }
-
-   public synchronized void unregisterDivert(final SimpleString name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getDivertObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_DIVERT + name);
-   }
-
-   public synchronized void registerAcceptor(final Acceptor acceptor, final TransportConfiguration configuration) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getAcceptorObjectName(configuration.getName());
-      AcceptorControl control = new AcceptorControlImpl(acceptor, storageManager, configuration);
-      registerInJMX(objectName, new StandardMBean(control, AcceptorControl.class));
-      registerInRegistry(ResourceNames.CORE_ACCEPTOR + configuration.getName(), control);
-   }
-
-   public void unregisterAcceptors()
-   {
-      List<String> acceptors = new ArrayList<String>();
-      for (String resourceName : registry.keySet())
-      {
-         if (resourceName.startsWith(ResourceNames.CORE_ACCEPTOR))
-         {
-            acceptors.add(resourceName);
-         }
-      }
-
-      for (String acceptor : acceptors)
-      {
-         String name = acceptor.substring(ResourceNames.CORE_ACCEPTOR.length());
-         try
-         {
-            unregisterAcceptor(name);
-         }
-         catch (Exception e)
-         {
-            e.printStackTrace();
-         }
-      }
-   }
-
-   public synchronized void unregisterAcceptor(final String name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getAcceptorObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_ACCEPTOR + name);
-   }
-
-   public synchronized void registerBroadcastGroup(final BroadcastGroup broadcastGroup,
-                                                   final BroadcastGroupConfiguration configuration) throws Exception
-   {
-      broadcastGroup.setNotificationService(this);
-      ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(configuration.getName());
-      BroadcastGroupControl control = new BroadcastGroupControlImpl(broadcastGroup, storageManager, configuration);
-      registerInJMX(objectName, new StandardMBean(control, BroadcastGroupControl.class));
-      registerInRegistry(ResourceNames.CORE_BROADCAST_GROUP + configuration.getName(), control);
-   }
-
-   public synchronized void unregisterBroadcastGroup(final String name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_BROADCAST_GROUP + name);
-   }
-
-   public synchronized void registerDiscoveryGroup(final DiscoveryGroup discoveryGroup,
-                                                   final DiscoveryGroupConfiguration configuration) throws Exception
-   {
-      discoveryGroup.setNotificationService(this);
-      ObjectName objectName = objectNameBuilder.getDiscoveryGroupObjectName(configuration.getName());
-      DiscoveryGroupControl control = new DiscoveryGroupControlImpl(discoveryGroup, storageManager, configuration);
-      registerInJMX(objectName, new StandardMBean(control, DiscoveryGroupControl.class));
-      registerInRegistry(ResourceNames.CORE_DISCOVERY_GROUP + configuration.getName(), control);
-   }
-
-   public synchronized void unregisterDiscoveryGroup(final String name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getDiscoveryGroupObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_DISCOVERY_GROUP + name);
-   }
-
-   public synchronized void registerBridge(final Bridge bridge, final BridgeConfiguration configuration) throws Exception
-   {
-      bridge.setNotificationService(this);
-      ObjectName objectName = objectNameBuilder.getBridgeObjectName(configuration.getName());
-      BridgeControl control = new BridgeControlImpl(bridge, storageManager, configuration);
-      registerInJMX(objectName, new StandardMBean(control, BridgeControl.class));
-      registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
-   }
-
-   public synchronized void unregisterBridge(final String name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getBridgeObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_BRIDGE + name);
-   }
-
-   public synchronized void registerCluster(final ClusterConnection cluster,
-                                            final ClusterConnectionConfiguration configuration) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
-      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
-      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
-      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
-   }
-
-   public synchronized void unregisterCluster(final String name) throws Exception
-   {
-      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(name);
-      unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + name);
-   }
-
-   public ServerMessage handleMessage(final ServerMessage message) throws Exception
-   {
-      // a reply message is sent with the result stored in the message body.
-      ServerMessage reply = new ServerMessageImpl(storageManager.generateUniqueID(), 512);
-
-      String resourceName = message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME);
-      if (ManagementServiceImpl.log.isDebugEnabled())
-      {
-         ManagementServiceImpl.log.debug("handling management message for " + resourceName);
-      }
-
-      String operation = message.getStringProperty(ManagementHelper.HDR_OPERATION_NAME);
-
-      if (operation != null)
-      {
-         Object[] params = ManagementHelper.retrieveOperationParameters(message);
-
-         if (params == null)
-         {
-            params = new Object[0];
-         }
-
-         try
-         {
-            Object result = invokeOperation(resourceName, operation, params);
-
-            ManagementHelper.storeResult(reply, result);
-
-            reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true);
-         }
-         catch (Exception e)
-         {
-            ManagementServiceImpl.log.warn("exception while invoking " + operation + " on " + resourceName, e);
-            reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false);
-            String exceptionMessage = e.getMessage();
-            if (e instanceof InvocationTargetException)
-            {
-               exceptionMessage = ((InvocationTargetException)e).getTargetException().getMessage();
-            }
-            if (e != null)
-            {
-               ManagementHelper.storeResult(reply, exceptionMessage);
-            }
-         }
-      }
-      else
-      {
-         String attribute = message.getStringProperty(ManagementHelper.HDR_ATTRIBUTE);
-
-         if (attribute != null)
-         {
-            try
-            {
-               Object result = getAttribute(resourceName, attribute);
-
-               ManagementHelper.storeResult(reply, result);
-            }
-            catch (Exception e)
-            {
-               ManagementServiceImpl.log.warn("exception while retrieving attribute " + attribute +
-                                              " on " +
-                                              resourceName, e);
-               reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false);
-               String exceptionMessage = e.getMessage();
-               if (e instanceof InvocationTargetException)
-               {
-                  exceptionMessage = ((InvocationTargetException)e).getTargetException().getMessage();
-               }
-               if (e != null)
-               {
-                  ManagementHelper.storeResult(reply, exceptionMessage);
-               }
-            }
-         }
-      }
-
-      return reply;
-   }
-
-   public Object getResource(final String resourceName)
-   {
-      return registry.get(resourceName);
-   }
-
-   public Object[] getResources(final Class<?> resourceType)
-   {
-      List<Object> resources = new ArrayList<Object>();
-      for (Object entry : registry.values())
-      {
-         if (resourceType.isAssignableFrom(entry.getClass()))
-         {
-            resources.add(entry);
-         }
-      }
-      return resources.toArray(new Object[resources.size()]);
-   }
-
-   private final Set<ObjectName> registeredNames = new HashSet<ObjectName>();
-
-   public void registerInJMX(final ObjectName objectName, final Object managedResource) throws Exception
-   {
-      if (!jmxManagementEnabled)
-      {
-         return;
-      }
-
-      synchronized (mbeanServer)
-      {
-         unregisterFromJMX(objectName);
-
-         mbeanServer.registerMBean(managedResource, objectName);
-
-         registeredNames.add(objectName);
-      }
-   }
-
-   public synchronized void registerInRegistry(final String resourceName, final Object managedResource)
-   {
-      unregisterFromRegistry(resourceName);
-
-      registry.put(resourceName, managedResource);
-   }
-
-   public void unregisterFromRegistry(final String resourceName)
-   {
-      registry.remove(resourceName);
-   }
-
-   // the JMX unregistration is synchronized to avoid race conditions if 2 clients tries to
-   // unregister the same resource (e.g. a queue) at the same time since unregisterMBean()
-   // will throw an exception if the MBean has already been unregistered
-   public void unregisterFromJMX(final ObjectName objectName) throws Exception
-   {
-      if (!jmxManagementEnabled)
-      {
-         return;
-      }
-
-      synchronized (mbeanServer)
-      {
-         if (mbeanServer.isRegistered(objectName))
-         {
-            mbeanServer.unregisterMBean(objectName);
-
-            registeredNames.remove(objectName);
-         }
-      }
-   }
-
-   public void addNotificationListener(final NotificationListener listener)
-   {
-      listeners.add(listener);
-   }
-
-   public void removeNotificationListener(final NotificationListener listener)
-   {
-      listeners.remove(listener);
-   }
-
-   public SimpleString getManagementAddress()
-   {
-      return managementAddress;
-   }
-
-   public SimpleString getManagementNotificationAddress()
-   {
-      return managementNotificationAddress;
-   }
-
-   public String getClusterUser()
-   {
-      return managementClusterUser;
-   }
-
-   public String getClusterPassword()
-   {
-      return managementClusterPassword;
-   }
-
-   // HornetQComponent implementation -----------------------------
-
-   public void start() throws Exception
-   {
-      if (messageCounterEnabled)
-      {
-         messageCounterManager.start();
-      }
-
-      started = true;
-   }
-
-   public synchronized void stop() throws Exception
-   {
-      Set<String> resourceNames = new HashSet<String>(registry.keySet());
-
-      for (String resourceName : resourceNames)
-      {
-         unregisterFromRegistry(resourceName);
-      }
-
-      if (jmxManagementEnabled)
-      {
-         if (!registeredNames.isEmpty())
-         {
-            List<String> unexpectedResourceNames = new ArrayList<String>();
-            for (String name : resourceNames)
-            {
-               // only addresses and queues should still be registered
-               if (!(name.startsWith(ResourceNames.CORE_ADDRESS) || name.startsWith(ResourceNames.CORE_QUEUE)))
-               {
-                  unexpectedResourceNames.add(name);
-               }
-            }
-            if (!unexpectedResourceNames.isEmpty())
-            {
-               ManagementServiceImpl.log.warn("On ManagementService stop, there are " + unexpectedResourceNames.size() +
-                                              " unexpected registered MBeans: " +
-                                              unexpectedResourceNames);
-            }
-
-            for (ObjectName on : registeredNames)
-            {
-               try
-               {
-                  mbeanServer.unregisterMBean(on);
-               }
-               catch (Exception ignore)
-               {
-               }
-            }
-         }
-      }
-
-      if (messageCounterManager != null)
-      {
-         messageCounterManager.stop();
-
-         messageCounterManager.resetAllCounters();
-
-         messageCounterManager.resetAllCounterHistories();
-
-         messageCounterManager.clear();
-      }
-
-      registeredNames.clear();
-
-      started = false;
-   }
-
-   public boolean isStarted()
-   {
-      return started;
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   public void sendNotification(final Notification notification) throws Exception
-   {
-      if (messagingServerControl != null && notificationsEnabled)
-      {
-         // This needs to be synchronized since we need to ensure notifications are processed in strict sequence
-         synchronized (this)
-         {
-            // We also need to synchronize on the post office notification lock
-            // otherwise we can get notifications arriving in wrong order / missing
-            // if a notification occurs at same time as sendQueueInfoToQueue is processed
-            synchronized (postOffice.getNotificationLock())
-            {
-
-               // First send to any local listeners
-               for (NotificationListener listener : listeners)
-               {
-                  try
-                  {
-                     listener.onNotification(notification);
-                  }
-                  catch (Exception e)
-                  {
-                     // Exception thrown from one listener should not stop execution of others
-                     ManagementServiceImpl.log.error("Failed to call listener", e);
-                  }
-               }
-
-               // start sending notification *messages* only when the *remoting service* if started
-               if (messagingServer == null || !messagingServer.getRemotingService().isStarted())
-               {
-                  return;
-               }
-
-               long messageID = storageManager.generateUniqueID();
-
-               ServerMessage notificationMessage = new ServerMessageImpl(messageID, 512);
-
-               // Notification messages are always durable so the user can choose whether to add a durable queue to
-               // consume
-               // them in
-               notificationMessage.setDurable(true);
-               notificationMessage.setAddress(managementNotificationAddress);
-
-               TypedProperties notifProps;
-               if (notification.getProperties() != null)
-               {
-                  notifProps = new TypedProperties(notification.getProperties());
-               }
-               else
-               {
-                  notifProps = new TypedProperties();
-               }
-
-               notifProps.putSimpleStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE,
-                                                  new SimpleString(notification.getType().toString()));
-
-               notifProps.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis());
-
-               if (notification.getUID() != null)
-               {
-                  notifProps.putSimpleStringProperty(new SimpleString("foobar"),
-                                                     new SimpleString(notification.getUID()));
-               }
-
-               notificationMessage.putTypedProperties(notifProps);
-
-               postOffice.route(notificationMessage);
-            }
-         }
-      }
-   }
-
-   public void enableNotifications(final boolean enabled)
-   {
-      notificationsEnabled = enabled;
-   }
-
-   public Object getAttribute(final String resourceName, final String attribute)
-   {
-      try
-      {
-         Object resource = registry.get(resourceName);
-
-         if (resource == null)
-         {
-            throw new IllegalArgumentException("Cannot find resource with name " + resourceName);
-         }
-
-         Method method = null;
-
-         String upperCaseAttribute = attribute.substring(0, 1).toUpperCase() + attribute.substring(1);
-         try
-         {
-            method = resource.getClass().getMethod("get" + upperCaseAttribute, new Class[0]);
-         }
-         catch (NoSuchMethodException nsme)
-         {
-            try
-            {
-               method = resource.getClass().getMethod("is" + upperCaseAttribute, new Class[0]);
-            }
-            catch (NoSuchMethodException nsme2)
-            {
-               throw new IllegalArgumentException("no getter method for " + attribute);
-            }
-         }
-         return method.invoke(resource, new Object[0]);
-      }
-      catch (Throwable t)
-      {
-         throw new IllegalStateException("Problem while retrieving attribute " + attribute, t);
-      }
-   }
-
-   private Object invokeOperation(final String resourceName, final String operation, final Object[] params) throws Exception
-   {
-      Object resource = registry.get(resourceName);
-
-      if (resource == null)
-      {
-         throw new IllegalArgumentException("Cannot find resource with name " + resourceName);
-      }
-
-      Method method = null;
-
-      Method[] methods = resource.getClass().getMethods();
-      for (Method m : methods)
-      {
-         if (m.getName().equals(operation) && m.getParameterTypes().length == params.length)
-         {
-            boolean match = true;
-
-            Class<?>[] paramTypes = m.getParameterTypes();
-
-            for (int i = 0; i < paramTypes.length; i++)
-            {
-               if (params[i] == null)
-               {
-                  continue;
-               }
-               if (paramTypes[i].isAssignableFrom(params[i].getClass()) || paramTypes[i] == Long.TYPE &&
-                   params[i].getClass() == Integer.class ||
-                   paramTypes[i] == Double.TYPE &&
-                   params[i].getClass() == Integer.class ||
-                   paramTypes[i] == Long.TYPE &&
-                   params[i].getClass() == Long.class ||
-                   paramTypes[i] == Double.TYPE &&
-                   params[i].getClass() == Double.class ||
-                   paramTypes[i] == Integer.TYPE &&
-                   params[i].getClass() == Integer.class ||
-                   paramTypes[i] == Boolean.TYPE &&
-                   params[i].getClass() == Boolean.class)
-               {
-                  // parameter match
-               }
-               else
-               {
-                  match = false;
-                  break; // parameter check loop
-               }
-            }
-
-            if (match)
-            {
-               method = m;
-               break; // method match loop
-            }
-         }
-      }
-
-      if (method == null)
-      {
-         throw new IllegalArgumentException("no operation " + operation + "/" + params.length);
-      }
-
-      Object result = method.invoke(resource, params);
-
-      return result;
-   }
-
-   // Inner classes -------------------------------------------------
-}

Modified: trunk/src/main/org/hornetq/core/message/Message.java
===================================================================
--- trunk/src/main/org/hornetq/core/message/Message.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/message/Message.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -92,8 +92,6 @@
    /**
     * Sets whether this message is durable or not.
     * 
-    * This method must not be called directly by HornetQ clients.
-
     * @param durable {@code true} to flag this message as durable, {@code false} else
     */
    void setDurable(boolean durable);
@@ -110,8 +108,6 @@
 
    /**
     * Sets the expiration of this message.
-    * <br>
-    * This method must not be called directly by HornetQ clients.
     * 
     * @param expiration expiration time
     */
@@ -127,8 +123,6 @@
 
    /**
     * Sets the message timestamp.
-    * <br>
-    * This method must not be called directly by HornetQ clients.
     * 
     * @param timestamp timestamp
     */

Modified: trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/postoffice/impl/PostOfficeImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -30,9 +30,6 @@
 import org.hornetq.core.filter.Filter;
 import org.hornetq.core.journal.IOAsyncTask;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationListener;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.message.impl.MessageImpl;
 import org.hornetq.core.paging.PageTransactionInfo;
@@ -56,6 +53,9 @@
 import org.hornetq.core.server.ServerMessage;
 import org.hornetq.core.server.impl.RoutingContextImpl;
 import org.hornetq.core.server.impl.ServerMessageImpl;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationListener;
 import org.hornetq.core.settings.HierarchicalRepository;
 import org.hornetq.core.settings.impl.AddressSettings;
 import org.hornetq.core.transaction.Transaction;

Modified: trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMAcceptor.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -19,13 +19,13 @@
 
 import org.hornetq.core.exception.HornetQException;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.remoting.spi.Acceptor;
 import org.hornetq.core.remoting.spi.BufferHandler;
 import org.hornetq.core.remoting.spi.Connection;
 import org.hornetq.core.remoting.spi.ConnectionLifeCycleListener;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.ConfigurationHelper;
 import org.hornetq.utils.ExecutorFactory;
 import org.hornetq.utils.OrderedExecutorFactory;

Modified: trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/remoting/server/impl/RemotingServiceImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -28,7 +28,6 @@
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.exception.HornetQException;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.remoting.Channel;
 import org.hornetq.core.remoting.ChannelHandler;
 import org.hornetq.core.remoting.Interceptor;
@@ -46,6 +45,7 @@
 import org.hornetq.core.remoting.spi.ConnectionLifeCycleListener;
 import org.hornetq.core.server.HornetQServer;
 import org.hornetq.core.server.impl.HornetQPacketHandler;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.utils.ConfigurationHelper;
 
 /**

Modified: trunk/src/main/org/hornetq/core/remoting/spi/Acceptor.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/spi/Acceptor.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/remoting/spi/Acceptor.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -13,8 +13,8 @@
 
 package org.hornetq.core.remoting.spi;
 
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.server.HornetQComponent;
+import org.hornetq.core.server.management.NotificationService;
 
 /**
  * An Acceptor is used by the Remoting Service to allow clients to connect. It should take care of dispatching client requests

Modified: trunk/src/main/org/hornetq/core/security/impl/SecurityStoreImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/security/impl/SecurityStoreImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/security/impl/SecurityStoreImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -22,14 +22,14 @@
 import org.hornetq.core.client.management.impl.ManagementHelper;
 import org.hornetq.core.exception.HornetQException;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.security.CheckType;
 import org.hornetq.core.security.HornetQSecurityManager;
 import org.hornetq.core.security.Role;
 import org.hornetq.core.security.SecurityStore;
 import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.core.settings.HierarchicalRepository;
 import org.hornetq.core.settings.HierarchicalRepositoryChangeListener;
 import org.hornetq.utils.ConcurrentHashSet;

Modified: trunk/src/main/org/hornetq/core/server/HornetQServer.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/HornetQServer.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/HornetQServer.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -19,7 +19,6 @@
 import javax.management.MBeanServer;
 
 import org.hornetq.core.config.Configuration;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.management.impl.HornetQServerControlImpl;
 import org.hornetq.core.persistence.StorageManager;
 import org.hornetq.core.postoffice.PostOffice;
@@ -33,6 +32,7 @@
 import org.hornetq.core.security.Role;
 import org.hornetq.core.server.cluster.ClusterManager;
 import org.hornetq.core.server.group.GroupingHandler;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.core.settings.HierarchicalRepository;
 import org.hornetq.core.settings.impl.AddressSettings;
 import org.hornetq.core.transaction.ResourceManager;

Modified: trunk/src/main/org/hornetq/core/server/cluster/Bridge.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/Bridge.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/Bridge.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -13,11 +13,11 @@
 
 package org.hornetq.core.server.cluster;
 
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.remoting.RemotingConnection;
 import org.hornetq.core.server.Consumer;
 import org.hornetq.core.server.HornetQComponent;
 import org.hornetq.core.server.Queue;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.SimpleString;
 
 /**

Modified: trunk/src/main/org/hornetq/core/server/cluster/BroadcastGroup.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/BroadcastGroup.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/BroadcastGroup.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -14,8 +14,8 @@
 package org.hornetq.core.server.cluster;
 
 import org.hornetq.core.config.TransportConfiguration;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.server.HornetQComponent;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.Pair;
 
 /**

Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BridgeImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -34,8 +34,6 @@
 import org.hornetq.core.filter.Filter;
 import org.hornetq.core.filter.impl.FilterImpl;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.management.ResourceNames;
 import org.hornetq.core.message.Message;
@@ -50,6 +48,8 @@
 import org.hornetq.core.server.cluster.Bridge;
 import org.hornetq.core.server.cluster.MessageFlowRecord;
 import org.hornetq.core.server.cluster.Transformer;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.Future;
 import org.hornetq.utils.Pair;
 import org.hornetq.utils.SimpleString;

Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/BroadcastGroupImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -24,10 +24,10 @@
 import org.hornetq.core.buffers.HornetQBuffers;
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.server.cluster.BroadcastGroup;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.Pair;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.TypedProperties;

Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterConnectionImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -16,7 +16,11 @@
 import static org.hornetq.core.management.NotificationType.CONSUMER_CLOSED;
 import static org.hornetq.core.management.NotificationType.CONSUMER_CREATED;
 
-import java.util.*;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 import java.util.concurrent.ScheduledExecutorService;
 
@@ -27,8 +31,6 @@
 import org.hornetq.core.cluster.DiscoveryListener;
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.postoffice.Binding;
 import org.hornetq.core.postoffice.Bindings;
@@ -42,6 +44,8 @@
 import org.hornetq.core.server.cluster.RemoteQueueBinding;
 import org.hornetq.core.server.group.impl.Proposal;
 import org.hornetq.core.server.group.impl.Response;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.utils.ExecutorFactory;
 import org.hornetq.utils.Pair;
 import org.hornetq.utils.SimpleString;

Modified: trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/cluster/impl/ClusterManagerImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -34,7 +34,6 @@
 import org.hornetq.core.config.cluster.ClusterConnectionConfiguration;
 import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.postoffice.Binding;
 import org.hornetq.core.postoffice.PostOffice;
 import org.hornetq.core.server.HornetQServer;
@@ -44,6 +43,7 @@
 import org.hornetq.core.server.cluster.ClusterConnection;
 import org.hornetq.core.server.cluster.ClusterManager;
 import org.hornetq.core.server.cluster.Transformer;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.utils.Pair;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.UUID;

Modified: trunk/src/main/org/hornetq/core/server/group/GroupingHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/group/GroupingHandler.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/group/GroupingHandler.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -12,10 +12,10 @@
  */
 package org.hornetq.core.server.group;
 
-import org.hornetq.core.management.NotificationListener;
 import org.hornetq.core.server.group.impl.GroupBinding;
 import org.hornetq.core.server.group.impl.Proposal;
 import org.hornetq.core.server.group.impl.Response;
+import org.hornetq.core.server.management.NotificationListener;
 import org.hornetq.utils.SimpleString;
 
 /**

Modified: trunk/src/main/org/hornetq/core/server/group/impl/LocalGroupingHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/group/impl/LocalGroupingHandler.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/group/impl/LocalGroupingHandler.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -18,12 +18,12 @@
 
 import org.hornetq.core.client.management.impl.ManagementHelper;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.persistence.StorageManager;
 import org.hornetq.core.postoffice.BindingType;
 import org.hornetq.core.server.group.GroupingHandler;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.TypedProperties;
 

Modified: trunk/src/main/org/hornetq/core/server/group/impl/RemoteGroupingHandler.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/group/impl/RemoteGroupingHandler.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/group/impl/RemoteGroupingHandler.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -24,11 +24,11 @@
 import java.util.logging.Logger;
 
 import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.postoffice.BindingType;
 import org.hornetq.core.server.group.GroupingHandler;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.TypedProperties;
 

Modified: trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -55,9 +55,7 @@
 import org.hornetq.core.journal.impl.SyncSpeedTest;
 import org.hornetq.core.logging.LogDelegateFactory;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.management.impl.HornetQServerControlImpl;
-import org.hornetq.core.management.impl.ManagementServiceImpl;
 import org.hornetq.core.paging.PagingManager;
 import org.hornetq.core.paging.impl.PagingManagerImpl;
 import org.hornetq.core.paging.impl.PagingStoreFactoryNIO;
@@ -102,6 +100,8 @@
 import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
 import org.hornetq.core.server.group.impl.LocalGroupingHandler;
 import org.hornetq.core.server.group.impl.RemoteGroupingHandler;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.impl.ManagementServiceImpl;
 import org.hornetq.core.settings.HierarchicalRepository;
 import org.hornetq.core.settings.impl.AddressSettings;
 import org.hornetq.core.settings.impl.HierarchicalObjectRepository;

Modified: trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerConsumerImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -28,8 +28,6 @@
 import org.hornetq.core.exception.HornetQException;
 import org.hornetq.core.filter.Filter;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.message.BodyEncoder;
 import org.hornetq.core.persistence.StorageManager;
@@ -46,6 +44,8 @@
 import org.hornetq.core.server.ServerConsumer;
 import org.hornetq.core.server.ServerMessage;
 import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.core.transaction.Transaction;
 import org.hornetq.core.transaction.impl.TransactionImpl;
 import org.hornetq.utils.Future;

Modified: trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java
===================================================================
--- trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/core/server/impl/ServerSessionImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -35,8 +35,6 @@
 import org.hornetq.core.filter.impl.FilterImpl;
 import org.hornetq.core.journal.IOAsyncTask;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.paging.PagingStore;
 import org.hornetq.core.persistence.StorageManager;
 import org.hornetq.core.postoffice.Binding;
@@ -93,6 +91,8 @@
 import org.hornetq.core.server.ServerConsumer;
 import org.hornetq.core.server.ServerMessage;
 import org.hornetq.core.server.ServerSession;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.core.transaction.ResourceManager;
 import org.hornetq.core.transaction.Transaction;
 import org.hornetq.core.transaction.impl.TransactionImpl;

Copied: trunk/src/main/org/hornetq/core/server/management/ManagementService.java (from rev 8663, trunk/src/main/org/hornetq/core/management/ManagementService.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/ManagementService.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/ManagementService.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,138 @@
+/*
+ * 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.core.server.management;
+
+import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+
+import javax.management.ObjectName;
+
+import org.hornetq.core.cluster.DiscoveryGroup;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.config.cluster.BridgeConfiguration;
+import org.hornetq.core.config.cluster.BroadcastGroupConfiguration;
+import org.hornetq.core.config.cluster.ClusterConnectionConfiguration;
+import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
+import org.hornetq.core.config.cluster.DivertConfiguration;
+import org.hornetq.core.management.ObjectNameBuilder;
+import org.hornetq.core.management.impl.HornetQServerControlImpl;
+import org.hornetq.core.messagecounter.MessageCounterManager;
+import org.hornetq.core.paging.PagingManager;
+import org.hornetq.core.persistence.StorageManager;
+import org.hornetq.core.postoffice.PostOffice;
+import org.hornetq.core.remoting.server.RemotingService;
+import org.hornetq.core.remoting.spi.Acceptor;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.server.Divert;
+import org.hornetq.core.server.HornetQComponent;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.Queue;
+import org.hornetq.core.server.QueueFactory;
+import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.cluster.Bridge;
+import org.hornetq.core.server.cluster.BroadcastGroup;
+import org.hornetq.core.server.cluster.ClusterConnection;
+import org.hornetq.core.settings.HierarchicalRepository;
+import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.core.transaction.ResourceManager;
+import org.hornetq.utils.SimpleString;
+
+/**
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+public interface ManagementService extends NotificationService, HornetQComponent
+{
+   // Configuration
+
+   MessageCounterManager getMessageCounterManager();
+
+   String getClusterUser();
+
+   String getClusterPassword();
+
+   SimpleString getManagementAddress();
+
+   SimpleString getManagementNotificationAddress();
+
+   ObjectNameBuilder getObjectNameBuilder();
+
+   // Resource Registration
+
+   void setStorageManager(StorageManager storageManager);
+
+   HornetQServerControlImpl registerServer(PostOffice postOffice,
+                                           StorageManager storageManager,
+                                           Configuration configuration,
+                                           HierarchicalRepository<AddressSettings> addressSettingsRepository,
+                                           HierarchicalRepository<Set<Role>> securityRepository,
+                                           ResourceManager resourceManager,
+                                           RemotingService remotingService,
+                                           HornetQServer messagingServer,
+                                           QueueFactory queueFactory,
+                                           ScheduledExecutorService scheduledThreadPool,
+                                           final PagingManager pagingManager,
+                                           boolean backup) throws Exception;
+
+   void unregisterServer() throws Exception;
+
+   void registerInJMX(ObjectName objectName, Object managedResource) throws Exception;
+
+   void unregisterFromJMX(final ObjectName objectName) throws Exception;
+
+   void registerInRegistry(String resourceName, Object managedResource);
+
+   void unregisterFromRegistry(final String resourceName);
+
+   void registerAddress(SimpleString address) throws Exception;
+
+   void unregisterAddress(SimpleString address) throws Exception;
+
+   void registerQueue(Queue queue, SimpleString address, StorageManager storageManager) throws Exception;
+
+   void unregisterQueue(SimpleString name, SimpleString address) throws Exception;
+
+   void registerAcceptor(Acceptor acceptor, TransportConfiguration configuration) throws Exception;
+
+   void unregisterAcceptors();
+
+   void registerDivert(Divert divert, DivertConfiguration config) throws Exception;
+
+   void unregisterDivert(SimpleString name) throws Exception;
+
+   void registerBroadcastGroup(BroadcastGroup broadcastGroup, BroadcastGroupConfiguration configuration) throws Exception;
+
+   void unregisterBroadcastGroup(String name) throws Exception;
+
+   void registerDiscoveryGroup(DiscoveryGroup discoveryGroup, DiscoveryGroupConfiguration configuration) throws Exception;
+
+   void unregisterDiscoveryGroup(String name) throws Exception;
+
+   void registerBridge(Bridge bridge, BridgeConfiguration configuration) throws Exception;
+
+   void unregisterBridge(String name) throws Exception;
+
+   void registerCluster(ClusterConnection cluster, ClusterConnectionConfiguration configuration) throws Exception;
+
+   void unregisterCluster(String name) throws Exception;
+
+   Object getResource(String resourceName);
+
+   Object[] getResources(Class<?> resourceType);
+
+   ServerMessage handleMessage(ServerMessage message) throws Exception;
+}

Copied: trunk/src/main/org/hornetq/core/server/management/Notification.java (from rev 8663, trunk/src/main/org/hornetq/core/management/Notification.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/Notification.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/Notification.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,63 @@
+/*
+ * 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.core.server.management;
+
+import org.hornetq.core.management.NotificationType;
+import org.hornetq.utils.TypedProperties;
+
+/**
+ * A Notification
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * 
+ * Created 22 Jan 2009 16:41:12
+ *
+ *
+ */
+public class Notification
+{
+   private final NotificationType type;
+
+   private final TypedProperties properties;
+
+   private final String uid;
+
+   public Notification(final String uid, final NotificationType type, final TypedProperties properties)
+   {
+      this.uid = uid;
+      this.type = type;
+      this.properties = properties;
+   }
+
+   public NotificationType getType()
+   {
+      return type;
+   }
+
+   public TypedProperties getProperties()
+   {
+      return properties;
+   }
+
+   public String getUID()
+   {
+      return uid;
+   }
+
+   @Override
+   public String toString()
+   {
+      return "Notification[uid=" + uid + ", type=" + type + ", properties=" + properties + "]";
+   }
+}

Copied: trunk/src/main/org/hornetq/core/server/management/NotificationListener.java (from rev 8663, trunk/src/main/org/hornetq/core/management/NotificationListener.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/NotificationListener.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/NotificationListener.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,29 @@
+/*
+ * 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.core.server.management;
+
+
+/**
+ * A NotificationListener
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * 
+ * Created 22 Jan 2009 16:48:27
+ *
+ *
+ */
+public interface NotificationListener
+{
+   void onNotification(Notification notification);
+}

Copied: trunk/src/main/org/hornetq/core/server/management/NotificationService.java (from rev 8663, trunk/src/main/org/hornetq/core/management/NotificationService.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/NotificationService.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/NotificationService.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,47 @@
+/*
+ * 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.core.server.management;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+
+/**
+ * A NotificationService
+ *
+ * @author jmesnil
+ *
+ *
+ */
+public interface NotificationService
+{
+   /** 
+    * the message corresponding to a notification will always contain the properties:
+    * <ul>
+    *   <li><code>ManagementHelper.HDR_NOTIFICATION_TYPE</code> - the type of notification (SimpleString)</li>
+    *   <li><code>ManagementHelper.HDR_NOTIFICATION_MESSAGE</code> - a message contextual to the notification (SimpleString)</li>
+    *   <li><code>ManagementHelper.HDR_NOTIFICATION_TIMESTAMP</code> - the timestamp when the notification occured (long)</li>
+    * </ul>
+    * 
+    * in addition to the properties defined in <code>props</code>
+    * 
+    * @see ManagementHelper
+    */
+   void sendNotification(Notification notification) throws Exception;
+
+   void enableNotifications(boolean enable);
+
+   void addNotificationListener(NotificationListener listener);
+
+   void removeNotificationListener(NotificationListener listener);
+
+}

Copied: trunk/src/main/org/hornetq/core/server/management/Operation.java (from rev 8663, trunk/src/main/org/hornetq/core/management/Operation.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/Operation.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/Operation.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,43 @@
+/*
+ * 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.core.server.management;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.management.MBeanOperationInfo;
+
+/**
+ * Info for a MBean Operation.
+ * 
+ * This annotation is used only for methods which can be invoked
+ * through a GUI.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.METHOD)
+ at Inherited
+public @interface Operation
+{
+   String desc();
+
+   int impact() default MBeanOperationInfo.INFO;
+}

Copied: trunk/src/main/org/hornetq/core/server/management/Parameter.java (from rev 8663, trunk/src/main/org/hornetq/core/management/Parameter.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/Parameter.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/Parameter.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,36 @@
+/*
+ * 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.core.server.management;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Info for a MBean Operation Parameter.
+ * 
+ * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
+ * 
+ * @version <tt>$Revision$</tt>
+ * 
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target(ElementType.PARAMETER)
+public @interface Parameter
+{
+   String name();
+
+   String desc() default "N/A";
+}

Copied: trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java (from rev 8663, trunk/src/main/org/hornetq/core/management/impl/ManagementServiceImpl.java)
===================================================================
--- trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java	                        (rev 0)
+++ trunk/src/main/org/hornetq/core/server/management/impl/ManagementServiceImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -0,0 +1,868 @@
+/*
+ * 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.core.server.management.impl;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+
+import javax.management.MBeanServer;
+import javax.management.NotificationBroadcasterSupport;
+import javax.management.ObjectName;
+import javax.management.StandardMBean;
+
+import org.hornetq.core.client.management.impl.ManagementHelper;
+import org.hornetq.core.cluster.DiscoveryGroup;
+import org.hornetq.core.config.Configuration;
+import org.hornetq.core.config.TransportConfiguration;
+import org.hornetq.core.config.cluster.BridgeConfiguration;
+import org.hornetq.core.config.cluster.BroadcastGroupConfiguration;
+import org.hornetq.core.config.cluster.ClusterConnectionConfiguration;
+import org.hornetq.core.config.cluster.DiscoveryGroupConfiguration;
+import org.hornetq.core.config.cluster.DivertConfiguration;
+import org.hornetq.core.config.impl.ConfigurationImpl;
+import org.hornetq.core.logging.Logger;
+import org.hornetq.core.management.AcceptorControl;
+import org.hornetq.core.management.BridgeControl;
+import org.hornetq.core.management.BroadcastGroupControl;
+import org.hornetq.core.management.ClusterConnectionControl;
+import org.hornetq.core.management.DiscoveryGroupControl;
+import org.hornetq.core.management.DivertControl;
+import org.hornetq.core.management.ObjectNameBuilder;
+import org.hornetq.core.management.ResourceNames;
+import org.hornetq.core.management.impl.AcceptorControlImpl;
+import org.hornetq.core.management.impl.AddressControlImpl;
+import org.hornetq.core.management.impl.BridgeControlImpl;
+import org.hornetq.core.management.impl.BroadcastGroupControlImpl;
+import org.hornetq.core.management.impl.ClusterConnectionControlImpl;
+import org.hornetq.core.management.impl.DiscoveryGroupControlImpl;
+import org.hornetq.core.management.impl.DivertControlImpl;
+import org.hornetq.core.management.impl.HornetQServerControlImpl;
+import org.hornetq.core.management.impl.QueueControlImpl;
+import org.hornetq.core.messagecounter.MessageCounter;
+import org.hornetq.core.messagecounter.MessageCounterManager;
+import org.hornetq.core.messagecounter.impl.MessageCounterManagerImpl;
+import org.hornetq.core.paging.PagingManager;
+import org.hornetq.core.persistence.StorageManager;
+import org.hornetq.core.postoffice.PostOffice;
+import org.hornetq.core.remoting.server.RemotingService;
+import org.hornetq.core.remoting.spi.Acceptor;
+import org.hornetq.core.security.Role;
+import org.hornetq.core.server.Divert;
+import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.Queue;
+import org.hornetq.core.server.QueueFactory;
+import org.hornetq.core.server.ServerMessage;
+import org.hornetq.core.server.cluster.Bridge;
+import org.hornetq.core.server.cluster.BroadcastGroup;
+import org.hornetq.core.server.cluster.ClusterConnection;
+import org.hornetq.core.server.impl.ServerMessageImpl;
+import org.hornetq.core.server.management.ManagementService;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationListener;
+import org.hornetq.core.settings.HierarchicalRepository;
+import org.hornetq.core.settings.impl.AddressSettings;
+import org.hornetq.core.transaction.ResourceManager;
+import org.hornetq.utils.SimpleString;
+import org.hornetq.utils.TypedProperties;
+
+/*
+ * @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 class ManagementServiceImpl implements ManagementService
+{
+   // Constants -----------------------------------------------------
+
+   private static final Logger log = Logger.getLogger(ManagementServiceImpl.class);
+
+   private final MBeanServer mbeanServer;
+
+   private final boolean jmxManagementEnabled;
+
+   private final Map<String, Object> registry;
+
+   private final NotificationBroadcasterSupport broadcaster;
+
+   private PostOffice postOffice;
+
+   private PagingManager pagingManager;
+
+   private StorageManager storageManager;
+
+   private HornetQServer messagingServer;
+
+   private HierarchicalRepository<Set<Role>> securityRepository;
+
+   private HierarchicalRepository<AddressSettings> addressSettingsRepository;
+
+   private HornetQServerControlImpl messagingServerControl;
+
+   private MessageCounterManager messageCounterManager;
+
+   private final SimpleString managementNotificationAddress;
+
+   private final SimpleString managementAddress;
+
+   private final String managementClusterUser;
+
+   private final String managementClusterPassword;
+
+   private boolean started = false;
+
+   private final boolean messageCounterEnabled;
+
+   private boolean notificationsEnabled;
+
+   private final Set<NotificationListener> listeners = new org.hornetq.utils.ConcurrentHashSet<NotificationListener>();
+
+   private final ObjectNameBuilder objectNameBuilder;
+
+   // Static --------------------------------------------------------
+
+   private static void checkDefaultManagementClusterCredentials(final String user, final String password)
+   {
+      if (ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_USER.equals(user) && ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_PASSWORD.equals(password))
+      {
+         ManagementServiceImpl.log.warn("It has been detected that the cluster admin user and password which are used to " + "replicate management operation from one node to the other have not been changed from the installation default. "
+                                        + "Please see the HornetQ user guide for instructions on how to do this.");
+      }
+   }
+
+   // Constructor ----------------------------------------------------
+
+   public ManagementServiceImpl(final MBeanServer mbeanServer, final Configuration configuration)
+   {
+      this.mbeanServer = mbeanServer;
+      jmxManagementEnabled = configuration.isJMXManagementEnabled();
+      messageCounterEnabled = configuration.isMessageCounterEnabled();
+      managementAddress = configuration.getManagementAddress();
+      managementNotificationAddress = configuration.getManagementNotificationAddress();
+      managementClusterUser = configuration.getManagementClusterUser();
+      managementClusterPassword = configuration.getManagementClusterPassword();
+
+      ManagementServiceImpl.checkDefaultManagementClusterCredentials(managementClusterUser, managementClusterPassword);
+
+      registry = new HashMap<String, Object>();
+      broadcaster = new NotificationBroadcasterSupport();
+      notificationsEnabled = true;
+      objectNameBuilder = ObjectNameBuilder.create(configuration.getJMXDomain());
+   }
+
+   // Public --------------------------------------------------------
+
+   // ManagementService implementation -------------------------
+
+   public ObjectNameBuilder getObjectNameBuilder()
+   {
+      return objectNameBuilder;
+   }
+
+   public MessageCounterManager getMessageCounterManager()
+   {
+      return messageCounterManager;
+   }
+
+   public void setStorageManager(final StorageManager storageManager)
+   {
+      this.storageManager = storageManager;
+   }
+
+   public HornetQServerControlImpl registerServer(final PostOffice postOffice,
+                                                  final StorageManager storageManager,
+                                                  final Configuration configuration,
+                                                  final HierarchicalRepository<AddressSettings> addressSettingsRepository,
+                                                  final HierarchicalRepository<Set<Role>> securityRepository,
+                                                  final ResourceManager resourceManager,
+                                                  final RemotingService remotingService,
+                                                  final HornetQServer messagingServer,
+                                                  final QueueFactory queueFactory,
+                                                  final ScheduledExecutorService scheduledThreadPool,
+                                                  final PagingManager pagingManager,
+                                                  final boolean backup) throws Exception
+   {
+      this.postOffice = postOffice;
+      this.addressSettingsRepository = addressSettingsRepository;
+      this.securityRepository = securityRepository;
+      this.storageManager = storageManager;
+      this.messagingServer = messagingServer;
+      this.pagingManager = pagingManager;
+
+      messageCounterManager = new MessageCounterManagerImpl(scheduledThreadPool);
+      messageCounterManager.setMaxDayCount(configuration.getMessageCounterMaxDayHistory());
+      messageCounterManager.reschedule(configuration.getMessageCounterSamplePeriod());
+
+      messagingServerControl = new HornetQServerControlImpl(postOffice,
+                                                            configuration,
+                                                            resourceManager,
+                                                            remotingService,
+                                                            messagingServer,
+                                                            messageCounterManager,
+                                                            storageManager,
+                                                            broadcaster);
+      ObjectName objectName = objectNameBuilder.getHornetQServerObjectName();
+      registerInJMX(objectName, messagingServerControl);
+      registerInRegistry(ResourceNames.CORE_SERVER, messagingServerControl);
+
+      return messagingServerControl;
+   }
+
+   public synchronized void unregisterServer() throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getHornetQServerObjectName();
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_SERVER);
+   }
+
+   public synchronized void registerAddress(final SimpleString address) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
+      AddressControlImpl addressControl = new AddressControlImpl(address,
+                                                                 postOffice,
+                                                                 pagingManager,
+                                                                 storageManager,
+                                                                 securityRepository);
+
+      registerInJMX(objectName, addressControl);
+
+      registerInRegistry(ResourceNames.CORE_ADDRESS + address, addressControl);
+
+      if (ManagementServiceImpl.log.isDebugEnabled())
+      {
+         ManagementServiceImpl.log.debug("registered address " + objectName);
+      }
+   }
+
+   public synchronized void unregisterAddress(final SimpleString address) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
+
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_ADDRESS + address);
+   }
+
+   public synchronized void registerQueue(final Queue queue,
+                                          final SimpleString address,
+                                          final StorageManager storageManager) throws Exception
+   {
+      QueueControlImpl queueControl = new QueueControlImpl(queue,
+                                                           address.toString(),
+                                                           postOffice,
+                                                           storageManager,
+                                                           addressSettingsRepository);
+      if (messageCounterManager != null)
+      {
+         MessageCounter counter = new MessageCounter(queue.getName().toString(),
+                                                     null,
+                                                     queueControl,
+                                                     false,
+                                                     queue.isDurable(),
+                                                     messageCounterManager.getMaxDayCount());
+         queueControl.setMessageCounter(counter);
+         messageCounterManager.registerMessageCounter(queue.getName().toString(), counter);
+      }
+      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName());
+      registerInJMX(objectName, queueControl);
+      registerInRegistry(ResourceNames.CORE_QUEUE + queue.getName(), queueControl);
+
+      if (ManagementServiceImpl.log.isDebugEnabled())
+      {
+         ManagementServiceImpl.log.debug("registered queue " + objectName);
+      }
+   }
+
+   public synchronized void unregisterQueue(final SimpleString name, final SimpleString address) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_QUEUE + name);
+      messageCounterManager.unregisterMessageCounter(name.toString());
+   }
+
+   public synchronized void registerDivert(final Divert divert, final DivertConfiguration config) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getDivertObjectName(divert.getUniqueName());
+      DivertControl divertControl = new DivertControlImpl(divert, storageManager, config);
+      registerInJMX(objectName, new StandardMBean(divertControl, DivertControl.class));
+      registerInRegistry(ResourceNames.CORE_DIVERT + config.getName(), divertControl);
+
+      if (ManagementServiceImpl.log.isDebugEnabled())
+      {
+         ManagementServiceImpl.log.debug("registered divert " + objectName);
+      }
+   }
+
+   public synchronized void unregisterDivert(final SimpleString name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getDivertObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_DIVERT + name);
+   }
+
+   public synchronized void registerAcceptor(final Acceptor acceptor, final TransportConfiguration configuration) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getAcceptorObjectName(configuration.getName());
+      AcceptorControl control = new AcceptorControlImpl(acceptor, storageManager, configuration);
+      registerInJMX(objectName, new StandardMBean(control, AcceptorControl.class));
+      registerInRegistry(ResourceNames.CORE_ACCEPTOR + configuration.getName(), control);
+   }
+
+   public void unregisterAcceptors()
+   {
+      List<String> acceptors = new ArrayList<String>();
+      for (String resourceName : registry.keySet())
+      {
+         if (resourceName.startsWith(ResourceNames.CORE_ACCEPTOR))
+         {
+            acceptors.add(resourceName);
+         }
+      }
+
+      for (String acceptor : acceptors)
+      {
+         String name = acceptor.substring(ResourceNames.CORE_ACCEPTOR.length());
+         try
+         {
+            unregisterAcceptor(name);
+         }
+         catch (Exception e)
+         {
+            e.printStackTrace();
+         }
+      }
+   }
+
+   public synchronized void unregisterAcceptor(final String name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getAcceptorObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_ACCEPTOR + name);
+   }
+
+   public synchronized void registerBroadcastGroup(final BroadcastGroup broadcastGroup,
+                                                   final BroadcastGroupConfiguration configuration) throws Exception
+   {
+      broadcastGroup.setNotificationService(this);
+      ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(configuration.getName());
+      BroadcastGroupControl control = new BroadcastGroupControlImpl(broadcastGroup, storageManager, configuration);
+      registerInJMX(objectName, new StandardMBean(control, BroadcastGroupControl.class));
+      registerInRegistry(ResourceNames.CORE_BROADCAST_GROUP + configuration.getName(), control);
+   }
+
+   public synchronized void unregisterBroadcastGroup(final String name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_BROADCAST_GROUP + name);
+   }
+
+   public synchronized void registerDiscoveryGroup(final DiscoveryGroup discoveryGroup,
+                                                   final DiscoveryGroupConfiguration configuration) throws Exception
+   {
+      discoveryGroup.setNotificationService(this);
+      ObjectName objectName = objectNameBuilder.getDiscoveryGroupObjectName(configuration.getName());
+      DiscoveryGroupControl control = new DiscoveryGroupControlImpl(discoveryGroup, storageManager, configuration);
+      registerInJMX(objectName, new StandardMBean(control, DiscoveryGroupControl.class));
+      registerInRegistry(ResourceNames.CORE_DISCOVERY_GROUP + configuration.getName(), control);
+   }
+
+   public synchronized void unregisterDiscoveryGroup(final String name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getDiscoveryGroupObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_DISCOVERY_GROUP + name);
+   }
+
+   public synchronized void registerBridge(final Bridge bridge, final BridgeConfiguration configuration) throws Exception
+   {
+      bridge.setNotificationService(this);
+      ObjectName objectName = objectNameBuilder.getBridgeObjectName(configuration.getName());
+      BridgeControl control = new BridgeControlImpl(bridge, storageManager, configuration);
+      registerInJMX(objectName, new StandardMBean(control, BridgeControl.class));
+      registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
+   }
+
+   public synchronized void unregisterBridge(final String name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getBridgeObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_BRIDGE + name);
+   }
+
+   public synchronized void registerCluster(final ClusterConnection cluster,
+                                            final ClusterConnectionConfiguration configuration) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(configuration.getName());
+      ClusterConnectionControl control = new ClusterConnectionControlImpl(cluster, storageManager, configuration);
+      registerInJMX(objectName, new StandardMBean(control, ClusterConnectionControl.class));
+      registerInRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + configuration.getName(), control);
+   }
+
+   public synchronized void unregisterCluster(final String name) throws Exception
+   {
+      ObjectName objectName = objectNameBuilder.getClusterConnectionObjectName(name);
+      unregisterFromJMX(objectName);
+      unregisterFromRegistry(ResourceNames.CORE_CLUSTER_CONNECTION + name);
+   }
+
+   public ServerMessage handleMessage(final ServerMessage message) throws Exception
+   {
+      // a reply message is sent with the result stored in the message body.
+      ServerMessage reply = new ServerMessageImpl(storageManager.generateUniqueID(), 512);
+
+      String resourceName = message.getStringProperty(ManagementHelper.HDR_RESOURCE_NAME);
+      if (ManagementServiceImpl.log.isDebugEnabled())
+      {
+         ManagementServiceImpl.log.debug("handling management message for " + resourceName);
+      }
+
+      String operation = message.getStringProperty(ManagementHelper.HDR_OPERATION_NAME);
+
+      if (operation != null)
+      {
+         Object[] params = ManagementHelper.retrieveOperationParameters(message);
+
+         if (params == null)
+         {
+            params = new Object[0];
+         }
+
+         try
+         {
+            Object result = invokeOperation(resourceName, operation, params);
+
+            ManagementHelper.storeResult(reply, result);
+
+            reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, true);
+         }
+         catch (Exception e)
+         {
+            ManagementServiceImpl.log.warn("exception while invoking " + operation + " on " + resourceName, e);
+            reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false);
+            String exceptionMessage = e.getMessage();
+            if (e instanceof InvocationTargetException)
+            {
+               exceptionMessage = ((InvocationTargetException)e).getTargetException().getMessage();
+            }
+            if (e != null)
+            {
+               ManagementHelper.storeResult(reply, exceptionMessage);
+            }
+         }
+      }
+      else
+      {
+         String attribute = message.getStringProperty(ManagementHelper.HDR_ATTRIBUTE);
+
+         if (attribute != null)
+         {
+            try
+            {
+               Object result = getAttribute(resourceName, attribute);
+
+               ManagementHelper.storeResult(reply, result);
+            }
+            catch (Exception e)
+            {
+               ManagementServiceImpl.log.warn("exception while retrieving attribute " + attribute +
+                                              " on " +
+                                              resourceName, e);
+               reply.putBooleanProperty(ManagementHelper.HDR_OPERATION_SUCCEEDED, false);
+               String exceptionMessage = e.getMessage();
+               if (e instanceof InvocationTargetException)
+               {
+                  exceptionMessage = ((InvocationTargetException)e).getTargetException().getMessage();
+               }
+               if (e != null)
+               {
+                  ManagementHelper.storeResult(reply, exceptionMessage);
+               }
+            }
+         }
+      }
+
+      return reply;
+   }
+
+   public Object getResource(final String resourceName)
+   {
+      return registry.get(resourceName);
+   }
+
+   public Object[] getResources(final Class<?> resourceType)
+   {
+      List<Object> resources = new ArrayList<Object>();
+      for (Object entry : registry.values())
+      {
+         if (resourceType.isAssignableFrom(entry.getClass()))
+         {
+            resources.add(entry);
+         }
+      }
+      return resources.toArray(new Object[resources.size()]);
+   }
+
+   private final Set<ObjectName> registeredNames = new HashSet<ObjectName>();
+
+   public void registerInJMX(final ObjectName objectName, final Object managedResource) throws Exception
+   {
+      if (!jmxManagementEnabled)
+      {
+         return;
+      }
+
+      synchronized (mbeanServer)
+      {
+         unregisterFromJMX(objectName);
+
+         mbeanServer.registerMBean(managedResource, objectName);
+
+         registeredNames.add(objectName);
+      }
+   }
+
+   public synchronized void registerInRegistry(final String resourceName, final Object managedResource)
+   {
+      unregisterFromRegistry(resourceName);
+
+      registry.put(resourceName, managedResource);
+   }
+
+   public void unregisterFromRegistry(final String resourceName)
+   {
+      registry.remove(resourceName);
+   }
+
+   // the JMX unregistration is synchronized to avoid race conditions if 2 clients tries to
+   // unregister the same resource (e.g. a queue) at the same time since unregisterMBean()
+   // will throw an exception if the MBean has already been unregistered
+   public void unregisterFromJMX(final ObjectName objectName) throws Exception
+   {
+      if (!jmxManagementEnabled)
+      {
+         return;
+      }
+
+      synchronized (mbeanServer)
+      {
+         if (mbeanServer.isRegistered(objectName))
+         {
+            mbeanServer.unregisterMBean(objectName);
+
+            registeredNames.remove(objectName);
+         }
+      }
+   }
+
+   public void addNotificationListener(final NotificationListener listener)
+   {
+      listeners.add(listener);
+   }
+
+   public void removeNotificationListener(final NotificationListener listener)
+   {
+      listeners.remove(listener);
+   }
+
+   public SimpleString getManagementAddress()
+   {
+      return managementAddress;
+   }
+
+   public SimpleString getManagementNotificationAddress()
+   {
+      return managementNotificationAddress;
+   }
+
+   public String getClusterUser()
+   {
+      return managementClusterUser;
+   }
+
+   public String getClusterPassword()
+   {
+      return managementClusterPassword;
+   }
+
+   // HornetQComponent implementation -----------------------------
+
+   public void start() throws Exception
+   {
+      if (messageCounterEnabled)
+      {
+         messageCounterManager.start();
+      }
+
+      started = true;
+   }
+
+   public synchronized void stop() throws Exception
+   {
+      Set<String> resourceNames = new HashSet<String>(registry.keySet());
+
+      for (String resourceName : resourceNames)
+      {
+         unregisterFromRegistry(resourceName);
+      }
+
+      if (jmxManagementEnabled)
+      {
+         if (!registeredNames.isEmpty())
+         {
+            List<String> unexpectedResourceNames = new ArrayList<String>();
+            for (String name : resourceNames)
+            {
+               // only addresses and queues should still be registered
+               if (!(name.startsWith(ResourceNames.CORE_ADDRESS) || name.startsWith(ResourceNames.CORE_QUEUE)))
+               {
+                  unexpectedResourceNames.add(name);
+               }
+            }
+            if (!unexpectedResourceNames.isEmpty())
+            {
+               ManagementServiceImpl.log.warn("On ManagementService stop, there are " + unexpectedResourceNames.size() +
+                                              " unexpected registered MBeans: " +
+                                              unexpectedResourceNames);
+            }
+
+            for (ObjectName on : registeredNames)
+            {
+               try
+               {
+                  mbeanServer.unregisterMBean(on);
+               }
+               catch (Exception ignore)
+               {
+               }
+            }
+         }
+      }
+
+      if (messageCounterManager != null)
+      {
+         messageCounterManager.stop();
+
+         messageCounterManager.resetAllCounters();
+
+         messageCounterManager.resetAllCounterHistories();
+
+         messageCounterManager.clear();
+      }
+
+      registeredNames.clear();
+
+      started = false;
+   }
+
+   public boolean isStarted()
+   {
+      return started;
+   }
+
+   // Package protected ---------------------------------------------
+
+   // Protected -----------------------------------------------------
+
+   // Private -------------------------------------------------------
+
+   public void sendNotification(final Notification notification) throws Exception
+   {
+      if (messagingServerControl != null && notificationsEnabled)
+      {
+         // This needs to be synchronized since we need to ensure notifications are processed in strict sequence
+         synchronized (this)
+         {
+            // We also need to synchronize on the post office notification lock
+            // otherwise we can get notifications arriving in wrong order / missing
+            // if a notification occurs at same time as sendQueueInfoToQueue is processed
+            synchronized (postOffice.getNotificationLock())
+            {
+
+               // First send to any local listeners
+               for (NotificationListener listener : listeners)
+               {
+                  try
+                  {
+                     listener.onNotification(notification);
+                  }
+                  catch (Exception e)
+                  {
+                     // Exception thrown from one listener should not stop execution of others
+                     ManagementServiceImpl.log.error("Failed to call listener", e);
+                  }
+               }
+
+               // start sending notification *messages* only when the *remoting service* if started
+               if (messagingServer == null || !messagingServer.getRemotingService().isStarted())
+               {
+                  return;
+               }
+
+               long messageID = storageManager.generateUniqueID();
+
+               ServerMessage notificationMessage = new ServerMessageImpl(messageID, 512);
+
+               // Notification messages are always durable so the user can choose whether to add a durable queue to
+               // consume
+               // them in
+               notificationMessage.setDurable(true);
+               notificationMessage.setAddress(managementNotificationAddress);
+
+               TypedProperties notifProps;
+               if (notification.getProperties() != null)
+               {
+                  notifProps = new TypedProperties(notification.getProperties());
+               }
+               else
+               {
+                  notifProps = new TypedProperties();
+               }
+
+               notifProps.putSimpleStringProperty(ManagementHelper.HDR_NOTIFICATION_TYPE,
+                                                  new SimpleString(notification.getType().toString()));
+
+               notifProps.putLongProperty(ManagementHelper.HDR_NOTIFICATION_TIMESTAMP, System.currentTimeMillis());
+
+               if (notification.getUID() != null)
+               {
+                  notifProps.putSimpleStringProperty(new SimpleString("foobar"),
+                                                     new SimpleString(notification.getUID()));
+               }
+
+               notificationMessage.putTypedProperties(notifProps);
+
+               postOffice.route(notificationMessage);
+            }
+         }
+      }
+   }
+
+   public void enableNotifications(final boolean enabled)
+   {
+      notificationsEnabled = enabled;
+   }
+
+   public Object getAttribute(final String resourceName, final String attribute)
+   {
+      try
+      {
+         Object resource = registry.get(resourceName);
+
+         if (resource == null)
+         {
+            throw new IllegalArgumentException("Cannot find resource with name " + resourceName);
+         }
+
+         Method method = null;
+
+         String upperCaseAttribute = attribute.substring(0, 1).toUpperCase() + attribute.substring(1);
+         try
+         {
+            method = resource.getClass().getMethod("get" + upperCaseAttribute, new Class[0]);
+         }
+         catch (NoSuchMethodException nsme)
+         {
+            try
+            {
+               method = resource.getClass().getMethod("is" + upperCaseAttribute, new Class[0]);
+            }
+            catch (NoSuchMethodException nsme2)
+            {
+               throw new IllegalArgumentException("no getter method for " + attribute);
+            }
+         }
+         return method.invoke(resource, new Object[0]);
+      }
+      catch (Throwable t)
+      {
+         throw new IllegalStateException("Problem while retrieving attribute " + attribute, t);
+      }
+   }
+
+   private Object invokeOperation(final String resourceName, final String operation, final Object[] params) throws Exception
+   {
+      Object resource = registry.get(resourceName);
+
+      if (resource == null)
+      {
+         throw new IllegalArgumentException("Cannot find resource with name " + resourceName);
+      }
+
+      Method method = null;
+
+      Method[] methods = resource.getClass().getMethods();
+      for (Method m : methods)
+      {
+         if (m.getName().equals(operation) && m.getParameterTypes().length == params.length)
+         {
+            boolean match = true;
+
+            Class<?>[] paramTypes = m.getParameterTypes();
+
+            for (int i = 0; i < paramTypes.length; i++)
+            {
+               if (params[i] == null)
+               {
+                  continue;
+               }
+               if (paramTypes[i].isAssignableFrom(params[i].getClass()) || paramTypes[i] == Long.TYPE &&
+                   params[i].getClass() == Integer.class ||
+                   paramTypes[i] == Double.TYPE &&
+                   params[i].getClass() == Integer.class ||
+                   paramTypes[i] == Long.TYPE &&
+                   params[i].getClass() == Long.class ||
+                   paramTypes[i] == Double.TYPE &&
+                   params[i].getClass() == Double.class ||
+                   paramTypes[i] == Integer.TYPE &&
+                   params[i].getClass() == Integer.class ||
+                   paramTypes[i] == Boolean.TYPE &&
+                   params[i].getClass() == Boolean.class)
+               {
+                  // parameter match
+               }
+               else
+               {
+                  match = false;
+                  break; // parameter check loop
+               }
+            }
+
+            if (match)
+            {
+               method = m;
+               break; // method match loop
+            }
+         }
+      }
+
+      if (method == null)
+      {
+         throw new IllegalArgumentException("no operation " + operation + "/" + params.length);
+      }
+
+      Object result = method.invoke(resource, params);
+
+      return result;
+   }
+
+   // Inner classes -------------------------------------------------
+}

Modified: trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java
===================================================================
--- trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/integration/transports/netty/NettyAcceptor.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -29,14 +29,14 @@
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.exception.HornetQException;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationService;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.remoting.impl.ssl.SSLSupport;
 import org.hornetq.core.remoting.spi.Acceptor;
 import org.hornetq.core.remoting.spi.BufferHandler;
 import org.hornetq.core.remoting.spi.Connection;
 import org.hornetq.core.remoting.spi.ConnectionLifeCycleListener;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationService;
 import org.hornetq.utils.ConfigurationHelper;
 import org.hornetq.utils.SimpleString;
 import org.hornetq.utils.TypedProperties;

Modified: trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/DestinationControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -15,8 +15,8 @@
 
 import javax.management.MBeanOperationInfo;
 
-import org.hornetq.core.management.Operation;
-import org.hornetq.core.management.Parameter;
+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>

Modified: trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSQueueControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -17,8 +17,8 @@
 
 import javax.management.MBeanOperationInfo;
 
-import org.hornetq.core.management.Operation;
-import org.hornetq.core.management.Parameter;
+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>

Modified: trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/JMSServerControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -17,8 +17,8 @@
 
 import javax.management.MBeanOperationInfo;
 
-import org.hornetq.core.management.Operation;
-import org.hornetq.core.management.Parameter;
+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>

Modified: trunk/src/main/org/hornetq/jms/server/management/TopicControl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/TopicControl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/TopicControl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -17,8 +17,8 @@
 
 import javax.management.MBeanOperationInfo;
 
-import org.hornetq.core.management.Operation;
-import org.hornetq.core.management.Parameter;
+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>

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-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSManagementServiceImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -18,11 +18,11 @@
 import javax.management.ObjectName;
 
 import org.hornetq.core.management.AddressControl;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.management.QueueControl;
 import org.hornetq.core.management.ResourceNames;
 import org.hornetq.core.messagecounter.MessageCounter;
 import org.hornetq.core.messagecounter.MessageCounterManager;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.jms.HornetQQueue;
 import org.hornetq.jms.HornetQTopic;
 import org.hornetq.jms.client.HornetQConnectionFactory;

Modified: trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java
===================================================================
--- trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/src/main/org/hornetq/jms/server/management/impl/JMSTopicControlImpl.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -24,9 +24,9 @@
 import org.hornetq.core.logging.Logger;
 import org.hornetq.core.management.AddressControl;
 import org.hornetq.core.management.HornetQServerControl;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.management.QueueControl;
 import org.hornetq.core.management.ResourceNames;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.jms.HornetQTopic;
 import org.hornetq.jms.client.HornetQMessage;
 import org.hornetq.jms.client.SelectorTranslator;

Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/config/ConfigurationTest-full-config.xml	2009-12-10 15:25:39 UTC (rev 8664)
@@ -12,7 +12,6 @@
       <wild-card-routing-enabled>true</wild-card-routing-enabled>
       <management-address>Giraffe</management-address>
       <management-notification-address>Whatever</management-notification-address>
-      <management-request-timeout>91</management-request-timeout>
       <management-cluster-user>Frog</management-cluster-user>
       <management-cluster-password>Wombat</management-cluster-password>
       <jmx-management-enabled>false</jmx-management-enabled>

Modified: trunk/tests/src/org/hornetq/tests/integration/SimpleNotificationService.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/SimpleNotificationService.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/SimpleNotificationService.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -16,9 +16,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationListener;
-import org.hornetq.core.management.NotificationService;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationListener;
+import org.hornetq.core.server.management.NotificationService;
 
 /**
  * A SimpleNotificationService

Modified: trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusteredGroupingTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusteredGroupingTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/cluster/distribution/ClusteredGroupingTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -18,8 +18,6 @@
 import junit.framework.Assert;
 
 import org.hornetq.core.client.management.impl.ManagementHelper;
-import org.hornetq.core.management.Notification;
-import org.hornetq.core.management.NotificationListener;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.message.impl.MessageImpl;
 import org.hornetq.core.server.group.GroupingHandler;
@@ -27,6 +25,8 @@
 import org.hornetq.core.server.group.impl.GroupingHandlerConfiguration;
 import org.hornetq.core.server.group.impl.Proposal;
 import org.hornetq.core.server.group.impl.Response;
+import org.hornetq.core.server.management.Notification;
+import org.hornetq.core.server.management.NotificationListener;
 import org.hornetq.utils.SimpleString;
 
 /**

Modified: trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/discovery/DiscoveryTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -25,10 +25,10 @@
 import org.hornetq.core.cluster.impl.DiscoveryGroupImpl;
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.server.cluster.BroadcastGroup;
 import org.hornetq.core.server.cluster.impl.BroadcastGroupImpl;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.tests.integration.SimpleNotificationService;
 import org.hornetq.tests.util.RandomUtil;
 import org.hornetq.tests.util.UnitTestCase;

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-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/jms/bridge/BridgeTestBase.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -38,12 +38,12 @@
 import org.hornetq.core.config.TransportConfiguration;
 import org.hornetq.core.config.impl.ConfigurationImpl;
 import org.hornetq.core.logging.Logger;
-import org.hornetq.core.management.ManagementService;
 import org.hornetq.core.management.ResourceNames;
 import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.hornetq.core.remoting.impl.invm.TransportConstants;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.ManagementService;
 import org.hornetq.jms.bridge.ConnectionFactoryFactory;
 import org.hornetq.jms.bridge.DestinationFactory;
 import org.hornetq.jms.bridge.QualityOfServiceMode;

Modified: trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/management/AcceptorControlTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -25,12 +25,12 @@
 import org.hornetq.core.config.impl.ConfigurationImpl;
 import org.hornetq.core.logging.Logger;
 import org.hornetq.core.management.AcceptorControl;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.hornetq.core.remoting.impl.invm.InVMConnectorFactory;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.tests.integration.SimpleNotificationService;
 import org.hornetq.tests.util.RandomUtil;
 import org.hornetq.utils.SimpleString;

Modified: trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/management/BridgeControlTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -28,7 +28,6 @@
 import org.hornetq.core.config.cluster.QueueConfiguration;
 import org.hornetq.core.config.impl.ConfigurationImpl;
 import org.hornetq.core.management.BridgeControl;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.management.ObjectNameBuilder;
 import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -36,6 +35,7 @@
 import org.hornetq.core.remoting.impl.invm.TransportConstants;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.tests.integration.SimpleNotificationService;
 import org.hornetq.tests.util.RandomUtil;
 import org.hornetq.utils.Pair;

Modified: trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ClusterConnectionControlTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -29,7 +29,6 @@
 import org.hornetq.core.config.cluster.QueueConfiguration;
 import org.hornetq.core.config.impl.ConfigurationImpl;
 import org.hornetq.core.management.ClusterConnectionControl;
-import org.hornetq.core.management.Notification;
 import org.hornetq.core.management.NotificationType;
 import org.hornetq.core.management.ObjectNameBuilder;
 import org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory;
@@ -37,6 +36,7 @@
 import org.hornetq.core.remoting.impl.invm.TransportConstants;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
+import org.hornetq.core.server.management.Notification;
 import org.hornetq.tests.integration.SimpleNotificationService;
 import org.hornetq.tests.util.RandomUtil;
 import org.hornetq.utils.Pair;

Modified: trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/management/HornetQServerControlTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -97,7 +97,6 @@
       Assert.assertEquals(conf.getManagementAddress().toString(), serverControl.getManagementAddress());
       Assert.assertEquals(conf.getManagementNotificationAddress().toString(),
                           serverControl.getManagementNotificationAddress());
-      Assert.assertEquals(conf.getManagementRequestTimeout(), serverControl.getManagementRequestTimeout());
       Assert.assertEquals(conf.getIDCacheSize(), serverControl.getIDCacheSize());
       Assert.assertEquals(conf.isPersistIDCache(), serverControl.isPersistIDCache());
       Assert.assertEquals(conf.getBindingsDirectory(), serverControl.getBindingsDirectory());

Modified: trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/integration/management/ManagementServiceImplTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -22,13 +22,13 @@
 import org.hornetq.core.management.AddressControl;
 import org.hornetq.core.management.QueueControl;
 import org.hornetq.core.management.ResourceNames;
-import org.hornetq.core.management.impl.ManagementServiceImpl;
 import org.hornetq.core.persistence.impl.nullpm.NullStorageManager;
 import org.hornetq.core.server.HornetQ;
 import org.hornetq.core.server.HornetQServer;
 import org.hornetq.core.server.Queue;
 import org.hornetq.core.server.ServerMessage;
 import org.hornetq.core.server.impl.ServerMessageImpl;
+import org.hornetq.core.server.management.impl.ManagementServiceImpl;
 import org.hornetq.tests.integration.server.FakeStorageManager;
 import org.hornetq.tests.unit.core.postoffice.impl.FakeQueue;
 import org.hornetq.tests.util.RandomUtil;

Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/ConfigurationImplTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -97,7 +97,6 @@
       Assert.assertEquals(ConfigurationImpl.DEFAULT_MESSAGE_COUNTER_MAX_DAY_HISTORY,
                           conf.getMessageCounterMaxDayHistory());
       Assert.assertEquals(ConfigurationImpl.DEFAULT_MESSAGE_COUNTER_SAMPLE_PERIOD, conf.getMessageCounterSamplePeriod());
-      Assert.assertEquals(ConfigurationImpl.DEFAULT_MANAGEMENT_REQUEST_TIMEOUT, conf.getManagementRequestTimeout());
       Assert.assertEquals(ConfigurationImpl.DEFAULT_ID_CACHE_SIZE, conf.getIDCacheSize());
       Assert.assertEquals(ConfigurationImpl.DEFAULT_PERSIST_ID_CACHE, conf.isPersistIDCache());
       Assert.assertEquals(ConfigurationImpl.DEFAULT_SERVER_DUMP_INTERVAL, conf.getServerDumpInterval());
@@ -234,10 +233,6 @@
          conf.setManagementClusterUser(s);
          Assert.assertEquals(s, conf.getManagementClusterUser());
 
-         l = RandomUtil.randomLong();
-         conf.setManagementRequestTimeout(l);
-         Assert.assertEquals(l, conf.getManagementRequestTimeout());
-
          i = RandomUtil.randomInt();
          conf.setIDCacheSize(i);
          Assert.assertEquals(i, conf.getIDCacheSize());
@@ -455,10 +450,6 @@
       conf.setManagementClusterUser(s);
       Assert.assertEquals(s, conf.getManagementClusterUser());
 
-      l = RandomUtil.randomLong();
-      conf.setManagementRequestTimeout(l);
-      Assert.assertEquals(l, conf.getManagementRequestTimeout());
-
       i = RandomUtil.randomInt();
       conf.setIDCacheSize(i);
       Assert.assertEquals(i, conf.getIDCacheSize());

Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -86,8 +86,6 @@
 
       Assert.assertEquals(ConfigurationImpl.DEFAULT_MANAGEMENT_CLUSTER_PASSWORD, conf.getManagementClusterPassword());
 
-      Assert.assertEquals(ConfigurationImpl.DEFAULT_MANAGEMENT_REQUEST_TIMEOUT, conf.getManagementRequestTimeout());
-
       Assert.assertEquals(ConfigurationImpl.DEFAULT_ID_CACHE_SIZE, conf.getIDCacheSize());
 
       Assert.assertEquals(ConfigurationImpl.DEFAULT_PERSIST_ID_CACHE, conf.isPersistIDCache());

Modified: trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java	2009-12-10 11:53:59 UTC (rev 8663)
+++ trunk/tests/src/org/hornetq/tests/unit/core/config/impl/FileConfigurationTest.java	2009-12-10 15:25:39 UTC (rev 8664)
@@ -46,7 +46,6 @@
       Assert.assertEquals(5423, conf.getSecurityInvalidationInterval());
       Assert.assertEquals(true, conf.isWildcardRoutingEnabled());
       Assert.assertEquals(new SimpleString("Giraffe"), conf.getManagementAddress());
-      Assert.assertEquals(91, conf.getManagementRequestTimeout());
       Assert.assertEquals(new SimpleString("Whatever"), conf.getManagementNotificationAddress());
       Assert.assertEquals("Frog", conf.getManagementClusterUser());
       Assert.assertEquals("Wombat", conf.getManagementClusterPassword());



More information about the hornetq-commits mailing list