activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [13/55] [abbrv] activemq-artemis git commit: remove JMS JMX Objects and add new Address JMX objects
Date Wed, 07 Dec 2016 18:18:16 GMT
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/management/impl/JMSManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/management/impl/JMSManagementServiceImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/management/impl/JMSManagementServiceImpl.java
deleted file mode 100644
index 2b3f7a2..0000000
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/management/impl/JMSManagementServiceImpl.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF 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.apache.activemq.artemis.jms.server.management.impl;
-
-import javax.management.ObjectName;
-
-import org.apache.activemq.artemis.api.core.management.AddressControl;
-import org.apache.activemq.artemis.api.core.management.QueueControl;
-import org.apache.activemq.artemis.api.core.management.ResourceNames;
-import org.apache.activemq.artemis.api.jms.management.ConnectionFactoryControl;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
-import org.apache.activemq.artemis.api.jms.management.TopicControl;
-import org.apache.activemq.artemis.core.messagecounter.MessageCounter;
-import org.apache.activemq.artemis.core.messagecounter.MessageCounterManager;
-import org.apache.activemq.artemis.core.server.ActiveMQServer;
-import org.apache.activemq.artemis.core.server.Queue;
-import org.apache.activemq.artemis.core.server.management.ManagementService;
-import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.jms.client.ActiveMQQueue;
-import org.apache.activemq.artemis.jms.client.ActiveMQTopic;
-import org.apache.activemq.artemis.jms.management.impl.JMSConnectionFactoryControlImpl;
-import org.apache.activemq.artemis.jms.management.impl.JMSQueueControlImpl;
-import org.apache.activemq.artemis.jms.management.impl.JMSServerControlImpl;
-import org.apache.activemq.artemis.jms.management.impl.JMSTopicControlImpl;
-import org.apache.activemq.artemis.jms.server.JMSServerManager;
-import org.apache.activemq.artemis.jms.server.config.ConnectionFactoryConfiguration;
-import org.apache.activemq.artemis.jms.server.management.JMSManagementService;
-
-public class JMSManagementServiceImpl implements JMSManagementService {
-
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   private final ManagementService managementService;
-
-   private final JMSServerManager jmsServerManager;
-
-   // Static --------------------------------------------------------
-
-   public JMSManagementServiceImpl(final ManagementService managementService,
-                                   final ActiveMQServer server,
-                                   final JMSServerManager jmsServerManager) {
-      this.managementService = managementService;
-      this.jmsServerManager = jmsServerManager;
-   }
-
-   // Public --------------------------------------------------------
-
-   // JMSManagementRegistration implementation ----------------------
-
-   @Override
-   public synchronized JMSServerControl registerJMSServer(final JMSServerManager server) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSServerObjectName();
-      JMSServerControlImpl control = new JMSServerControlImpl(server);
-      managementService.registerInJMX(objectName, control);
-      managementService.registerInRegistry(ResourceNames.JMS_SERVER, control);
-      return control;
-   }
-
-   @Override
-   public synchronized void unregisterJMSServer() throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSServerObjectName();
-      managementService.unregisterFromJMX(objectName);
-      managementService.unregisterFromRegistry(ResourceNames.JMS_SERVER);
-   }
-
-   @Override
-   public synchronized void registerQueue(final ActiveMQQueue queue, final Queue serverQueue) throws Exception {
-      QueueControl coreQueueControl = (QueueControl) managementService.getResource(ResourceNames.CORE_QUEUE + queue.getAddress());
-      MessageCounterManager messageCounterManager = managementService.getMessageCounterManager();
-      MessageCounter counter = new MessageCounter(queue.getName(), null, serverQueue, false, coreQueueControl.isDurable(), messageCounterManager.getMaxDayCount());
-      messageCounterManager.registerMessageCounter(queue.getName(), counter);
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSQueueObjectName(queue.getQueueName());
-      JMSQueueControlImpl control = new JMSQueueControlImpl(queue, coreQueueControl, jmsServerManager, counter);
-      managementService.registerInJMX(objectName, control);
-      managementService.registerInRegistry(queue.getQueueName(), control);
-   }
-
-   @Override
-   public synchronized void unregisterQueue(final String name) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSQueueObjectName(name);
-      managementService.unregisterFromJMX(objectName);
-      managementService.unregisterFromRegistry(name);
-   }
-
-   @Override
-   public synchronized void registerTopic(final ActiveMQTopic topic) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSTopicObjectName(topic.getTopicName());
-      AddressControl addressControl = (AddressControl) managementService.getResource(ResourceNames.CORE_ADDRESS + topic.getAddress());
-      JMSTopicControlImpl control = new JMSTopicControlImpl(topic, jmsServerManager, addressControl, managementService);
-      managementService.registerInJMX(objectName, control);
-      managementService.registerInRegistry(topic.getTopicName(), control);
-   }
-
-   @Override
-   public synchronized void unregisterTopic(final String name) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getJMSTopicObjectName(name);
-      managementService.unregisterFromJMX(objectName);
-      managementService.unregisterFromRegistry(name);
-   }
-
-   @Override
-   public synchronized void registerConnectionFactory(final String name,
-                                                      final ConnectionFactoryConfiguration cfConfig,
-                                                      final ActiveMQConnectionFactory connectionFactory) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getConnectionFactoryObjectName(name);
-      JMSConnectionFactoryControlImpl control = new JMSConnectionFactoryControlImpl(cfConfig, connectionFactory, jmsServerManager, name);
-      managementService.registerInJMX(objectName, control);
-      managementService.registerInRegistry(ResourceNames.JMS_CONNECTION_FACTORY + name, control);
-   }
-
-   @Override
-   public synchronized void unregisterConnectionFactory(final String name) throws Exception {
-      ObjectName objectName = managementService.getObjectNameBuilder().getConnectionFactoryObjectName(name);
-      managementService.unregisterFromJMX(objectName);
-      managementService.unregisterFromRegistry(ResourceNames.JMS_CONNECTION_FACTORY + name);
-   }
-
-   @Override
-   public void stop() throws Exception {
-      for (Object resource : managementService.getResources(ConnectionFactoryControl.class)) {
-         unregisterConnectionFactory(((ConnectionFactoryControl) resource).getName());
-      }
-      for (Object resource : managementService.getResources(JMSQueueControl.class)) {
-         unregisterQueue(((JMSQueueControl) resource).getName());
-      }
-      for (Object resource : managementService.getResources(TopicControl.class)) {
-         unregisterTopic(((TopicControl) resource).getName());
-      }
-   }
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
index 2cf8ab8..36a5cdf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/config/ClusterConnectionConfiguration.java
@@ -423,13 +423,6 @@ public final class ClusterConnectionConfiguration implements Serializable {
          ActiveMQServerLogger.LOGGER.clusterConnectionNotUnique();
          return false;
       }
-
-      if (getAddress() == null) {
-         ActiveMQServerLogger.LOGGER.clusterConnectionNoForwardAddress();
-
-         return false;
-      }
-
       return true;
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
index cebf260..349c1fd 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/deployers/impl/FileConfigurationParser.java
@@ -1340,7 +1340,7 @@ public final class FileConfigurationParser extends XMLConfigurationUtil {
    private void parseClusterConnectionConfiguration(final Element e, final Configuration mainConfig) throws Exception {
       String name = e.getAttribute("name");
 
-      String address = getString(e, "address", null, Validators.NOT_NULL_OR_EMPTY);
+      String address = getString(e, "address", "", Validators.NO_CHECK);
 
       String connectorName = getString(e, "connector-ref", null, Validators.NOT_NULL_OR_EMPTY);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
index 9140fe4..a183187 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/ActiveMQServerControlImpl.java
@@ -50,6 +50,8 @@ import org.apache.activemq.artemis.api.core.management.BridgeControl;
 import org.apache.activemq.artemis.api.core.management.CoreNotificationType;
 import org.apache.activemq.artemis.api.core.management.DivertControl;
 import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.core.client.impl.Topology;
+import org.apache.activemq.artemis.core.client.impl.TopologyMemberImpl;
 import org.apache.activemq.artemis.core.config.BridgeConfiguration;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.ConnectorServiceConfiguration;
@@ -75,11 +77,14 @@ import org.apache.activemq.artemis.core.server.JournalType;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.ServerConsumer;
 import org.apache.activemq.artemis.core.server.ServerSession;
+import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.cluster.ClusterManager;
 import org.apache.activemq.artemis.core.server.cluster.ha.HAPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.LiveOnlyPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.ScaleDownPolicy;
 import org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreSlavePolicy;
 import org.apache.activemq.artemis.core.server.group.GroupingHandler;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.settings.impl.SlowConsumerPolicy;
@@ -552,6 +557,30 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    }
 
    @Override
+   public void createAddress(String name, int routingType,  boolean defaultDeleteOnNoConsumers, int defaultMaxConsumers) throws Exception {
+      checkStarted();
+
+      clearIO();
+      try {
+         server.createOrUpdateAddressInfo(new AddressInfo(new SimpleString(name), AddressInfo.RoutingType.getType((byte)routingType), defaultDeleteOnNoConsumers, defaultMaxConsumers));
+      } finally {
+         blockOnIO();
+      }
+   }
+
+   @Override
+   public void deleteAddress(String name) throws Exception {
+      checkStarted();
+
+      clearIO();
+      try {
+         server.removeAddressInfo(new SimpleString(name));
+      } finally {
+         blockOnIO();
+      }
+   }
+
+   @Override
    public void deployQueue(final String address, final String name, final String filterString) throws Exception {
       checkStarted();
 
@@ -1694,7 +1723,7 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
 
       clearIO();
       try {
-         postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address));
+         postOffice.sendQueueInfoToQueue(new SimpleString(queueName), new SimpleString(address == null ? "" : address));
 
          GroupingHandler handler = server.getGroupingHandler();
          if (handler != null) {
@@ -1950,6 +1979,42 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
 
    }
 
+
+   @Override
+   public String listNetworkTopology() throws Exception {
+      checkStarted();
+
+      clearIO();
+      try {
+         JsonArrayBuilder brokers = JsonLoader.createArrayBuilder();
+         ClusterManager clusterManager = server.getClusterManager();
+         if (clusterManager != null) {
+            Set<ClusterConnection> clusterConnections = clusterManager.getClusterConnections();
+            for (ClusterConnection clusterConnection : clusterConnections) {
+               Topology topology = clusterConnection.getTopology();
+               Collection<TopologyMemberImpl> members = topology.getMembers();
+               for (TopologyMemberImpl member : members) {
+
+                  JsonObjectBuilder obj = JsonLoader.createObjectBuilder();
+                  TransportConfiguration live = member.getLive();
+                  if (live != null) {
+                     obj.add("nodeID", member.getNodeId()).add("live", live.getParams().get("host") + ":" + live.getParams().get("port"));
+                     TransportConfiguration backup = member.getBackup();
+                     if (backup != null) {
+                        obj.add("backup", backup.getParams().get("host") + ":" + backup.getParams().get("port"));
+                     }
+                  }
+                  brokers.add(obj);
+               }
+            }
+         }
+         return brokers.build().toString();
+      } finally {
+         blockOnIO();
+      }
+   }
+
+
    // NotificationEmitter implementation ----------------------------
 
    @Override
@@ -2046,6 +2111,11 @@ public class ActiveMQServerControlImpl extends AbstractControl implements Active
    }
 
    @Override
+   public String getNodeID() {
+      return server.getNodeID().toString();
+   }
+
+   @Override
    public String getManagementNotificationAddress() {
       return configuration.getManagementNotificationAddress().toString();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java
index bc07973..5808bd3 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/AddressControlImpl.java
@@ -20,11 +20,15 @@ import javax.json.JsonArrayBuilder;
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanOperationInfo;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.management.AddressControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.paging.PagingManager;
 import org.apache.activemq.artemis.core.paging.PagingStore;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
@@ -34,7 +38,14 @@ import org.apache.activemq.artemis.core.postoffice.PostOffice;
 import org.apache.activemq.artemis.core.postoffice.QueueBinding;
 import org.apache.activemq.artemis.core.security.CheckType;
 import org.apache.activemq.artemis.core.security.Role;
+import org.apache.activemq.artemis.core.security.SecurityAuth;
+import org.apache.activemq.artemis.core.security.SecurityStore;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
+import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
+import org.apache.activemq.artemis.core.server.management.ManagementService;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
+import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
+import org.apache.activemq.artemis.utils.Base64;
 import org.apache.activemq.artemis.utils.JsonLoader;
 
 public class AddressControlImpl extends AbstractControl implements AddressControl {
@@ -43,7 +54,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
 
    // Attributes ----------------------------------------------------
 
-   private final SimpleString address;
+   private AddressInfo addressInfo;
 
    private final PostOffice postOffice;
 
@@ -51,20 +62,28 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
 
    private final HierarchicalRepository<Set<Role>> securityRepository;
 
+   private final SecurityStore securityStore;
+
+   private final ManagementService managementService;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
 
-   public AddressControlImpl(final SimpleString address,
+   public AddressControlImpl(AddressInfo addressInfo,
                              final PostOffice postOffice,
                              final PagingManager pagingManager,
                              final StorageManager storageManager,
-                             final HierarchicalRepository<Set<Role>> securityRepository) throws Exception {
+                             final HierarchicalRepository<Set<Role>> securityRepository,
+                             final SecurityStore securityStore,
+                             final ManagementService managementService)throws Exception {
       super(AddressControl.class, storageManager);
-      this.address = address;
+      this.addressInfo = addressInfo;
       this.postOffice = postOffice;
       this.pagingManager = pagingManager;
       this.securityRepository = securityRepository;
+      this.securityStore = securityStore;
+      this.managementService = managementService;
    }
 
    // Public --------------------------------------------------------
@@ -73,14 +92,19 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
 
    @Override
    public String getAddress() {
-      return address.toString();
+      return addressInfo.getName().toString();
+   }
+
+   @Override
+   public String getRoutingType() {
+      return addressInfo.getRoutingType().toString();
    }
 
    @Override
    public String[] getQueueNames() throws Exception {
       clearIO();
       try {
-         Bindings bindings = postOffice.getBindingsForAddress(address);
+         Bindings bindings = postOffice.getBindingsForAddress(addressInfo.getName());
          List<String> queueNames = new ArrayList<>();
          for (Binding binding : bindings.getBindings()) {
             if (binding instanceof QueueBinding) {
@@ -99,7 +123,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public String[] getBindingNames() throws Exception {
       clearIO();
       try {
-         Bindings bindings = postOffice.getBindingsForAddress(address);
+         Bindings bindings = postOffice.getBindingsForAddress(addressInfo.getName());
          String[] bindingNames = new String[bindings.getBindings().size()];
          int i = 0;
          for (Binding binding : bindings.getBindings()) {
@@ -117,7 +141,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public Object[] getRoles() throws Exception {
       clearIO();
       try {
-         Set<Role> roles = securityRepository.getMatch(address.toString());
+         Set<Role> roles = securityRepository.getMatch(addressInfo.getName().toString());
 
          Object[] objRoles = new Object[roles.size()];
 
@@ -136,7 +160,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
       clearIO();
       try {
          JsonArrayBuilder json = JsonLoader.createArrayBuilder();
-         Set<Role> roles = securityRepository.getMatch(address.toString());
+         Set<Role> roles = securityRepository.getMatch(addressInfo.getName().toString());
 
          for (Role role : roles) {
             json.add(role.toJson());
@@ -151,7 +175,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public long getNumberOfBytesPerPage() throws Exception {
       clearIO();
       try {
-         return pagingManager.getPageStore(address).getPageSizeBytes();
+         return pagingManager.getPageStore(addressInfo.getName()).getPageSizeBytes();
       } finally {
          blockOnIO();
       }
@@ -161,7 +185,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public long getAddressSize() throws Exception {
       clearIO();
       try {
-         return pagingManager.getPageStore(address).getAddressSize();
+         return pagingManager.getPageStore(addressInfo.getName()).getAddressSize();
       } finally {
          blockOnIO();
       }
@@ -172,7 +196,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
       clearIO();
       long totalMsgs = 0;
       try {
-         Bindings bindings = postOffice.getBindingsForAddress(address);
+         Bindings bindings = postOffice.getBindingsForAddress(addressInfo.getName());
          for (Binding binding : bindings.getBindings()) {
             if (binding instanceof QueueBinding) {
                totalMsgs += ((QueueBinding) binding).getQueue().getMessageCount();
@@ -190,7 +214,7 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public boolean isPaging() throws Exception {
       clearIO();
       try {
-         return pagingManager.getPageStore(address).isPaging();
+         return pagingManager.getPageStore(addressInfo.getName()).isPaging();
       } finally {
          blockOnIO();
       }
@@ -200,12 +224,12 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    public int getNumberOfPages() throws Exception {
       clearIO();
       try {
-         PagingStore pageStore = pagingManager.getPageStore(address);
+         PagingStore pageStore = pagingManager.getPageStore(addressInfo.getName());
 
          if (!pageStore.isPaging()) {
             return 0;
          } else {
-            return pagingManager.getPageStore(address).getNumberOfPages();
+            return pagingManager.getPageStore(addressInfo.getName()).getNumberOfPages();
          }
       } finally {
          blockOnIO();
@@ -213,6 +237,50 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
    }
 
    @Override
+   public long getMessageCount() {
+      return getMessageCount(DurabilityType.ALL);
+   }
+
+
+   @Override
+   public String sendMessage(final Map<String, String> headers,
+                             final int type,
+                             final String body,
+                             boolean durable,
+                             final String user,
+                             final String password) throws Exception {
+      securityStore.check(addressInfo.getName(), CheckType.SEND, new SecurityAuth() {
+         @Override
+         public String getUsername() {
+            return user;
+         }
+
+         @Override
+         public String getPassword() {
+            return password;
+         }
+
+         @Override
+         public RemotingConnection getRemotingConnection() {
+            return null;
+         }
+      });
+      ServerMessageImpl message = new ServerMessageImpl(storageManager.generateID(), 50);
+      for (String header : headers.keySet()) {
+         message.putStringProperty(new SimpleString(header), new SimpleString(headers.get(header)));
+      }
+      message.setType((byte) type);
+      message.setDurable(durable);
+      message.setTimestamp(System.currentTimeMillis());
+      if (body != null) {
+         message.getBodyBuffer().writeBytes(Base64.decode(body));
+      }
+      message.setAddress(addressInfo.getName());
+      postOffice.route(message, null, true);
+      return "" + message.getMessageID();
+   }
+
+   @Override
    protected MBeanOperationInfo[] fillMBeanOperationInfo() {
       return MBeanInfoHelper.getMBeanOperationsInfo(AddressControl.class);
    }
@@ -228,5 +296,39 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
 
    // Private -------------------------------------------------------
 
+   private int getMessageCount(final DurabilityType durability) {
+      List<QueueControl> queues = getQueues(durability);
+      int count = 0;
+      for (QueueControl queue : queues) {
+         count += queue.getMessageCount();
+      }
+      return count;
+   }
+
+   private List<QueueControl> getQueues(final DurabilityType durability) {
+      try {
+         List<QueueControl> matchingQueues = new ArrayList<>();
+         String[] queues = getQueueNames();
+         for (String queue : queues) {
+            QueueControl coreQueueControl = (QueueControl) managementService.getResource(ResourceNames.QUEUE + queue);
+
+            // Ignore the "special" subscription
+            if (coreQueueControl != null && !coreQueueControl.getName().equals(getAddress())) {
+               if (durability == DurabilityType.ALL || durability == DurabilityType.DURABLE && coreQueueControl.isDurable() ||
+                     durability == DurabilityType.NON_DURABLE && !coreQueueControl.isDurable()) {
+                  matchingQueues.add(coreQueueControl);
+               }
+            }
+         }
+         return matchingQueues;
+      } catch (Exception e) {
+         return Collections.emptyList();
+      }
+   }
+
    // Inner classes -------------------------------------------------
+
+   private enum DurabilityType {
+      ALL, DURABLE, NON_DURABLE
+   }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
index 85bad25..7a1bb26 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/management/impl/QueueControlImpl.java
@@ -22,6 +22,7 @@ import javax.json.JsonObjectBuilder;
 import javax.management.MBeanAttributeInfo;
 import javax.management.MBeanOperationInfo;
 import javax.management.openmbean.CompositeData;
+import java.nio.ByteBuffer;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
@@ -38,6 +39,7 @@ import org.apache.activemq.artemis.api.core.management.QueueControl;
 import org.apache.activemq.artemis.core.filter.Filter;
 import org.apache.activemq.artemis.core.filter.impl.FilterImpl;
 import org.apache.activemq.artemis.core.management.impl.openmbean.OpenTypeSupport;
+import org.apache.activemq.artemis.core.message.impl.MessageImpl;
 import org.apache.activemq.artemis.core.messagecounter.MessageCounter;
 import org.apache.activemq.artemis.core.messagecounter.impl.MessageCounterHelper;
 import org.apache.activemq.artemis.core.persistence.StorageManager;
@@ -59,7 +61,6 @@ import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
 import org.apache.activemq.artemis.utils.Base64;
 import org.apache.activemq.artemis.utils.JsonLoader;
 import org.apache.activemq.artemis.utils.LinkedListIterator;
-import org.apache.activemq.artemis.utils.UUID;
 
 public class QueueControlImpl extends AbstractControl implements QueueControl {
 
@@ -694,7 +695,6 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
    public String sendMessage(final Map<String, String> headers,
                              final int type,
                              final String body,
-                             final String userID,
                              boolean durable,
                              final String user,
                              final String password) throws Exception {
@@ -721,11 +721,13 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
       message.setType((byte) type);
       message.setDurable(durable);
       message.setTimestamp(System.currentTimeMillis());
-      message.setUserID(new UUID(UUID.TYPE_TIME_BASED, UUID.stringToBytes(userID)));
       if (body != null) {
          message.getBodyBuffer().writeBytes(Base64.decode(body));
       }
       message.setAddress(queue.getAddress());
+      ByteBuffer buffer = ByteBuffer.allocate(8);
+      buffer.putLong(queue.getID());
+      message.putBytesProperty(MessageImpl.HDR_ROUTE_TO_IDS, buffer.array());
       postOffice.route(message, null, true);
       return "" + message.getMessageID();
    }
@@ -885,6 +887,10 @@ public class QueueControlImpl extends AbstractControl implements QueueControl {
    }
 
    @Override
+   public CompositeData[] browse() throws Exception {
+      return browse(null);
+   }
+   @Override
    public CompositeData[] browse(String filterStr) throws Exception {
       checkStarted();
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
index 7902352..bc8a6cf 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/PostOffice.java
@@ -47,7 +47,7 @@ public interface PostOffice extends ActiveMQComponent {
 
    AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo);
 
-   AddressInfo removeAddressInfo(SimpleString address);
+   AddressInfo removeAddressInfo(SimpleString address) throws Exception;
 
    AddressInfo getAddressInfo(SimpleString address);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
index 4c51373..1dba309 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/postoffice/impl/PostOfficeImpl.java
@@ -422,7 +422,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
    @Override
    public AddressInfo addAddressInfo(AddressInfo addressInfo) {
       try {
-         getServer().getManagementService().registerAddress(addressInfo.getName());
+         managementService.registerAddress(addressInfo);
       } catch (Exception e) {
          e.printStackTrace();
       }
@@ -432,7 +432,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
    @Override
    public AddressInfo addOrUpdateAddressInfo(AddressInfo addressInfo) {
       try {
-         getServer().getManagementService().registerAddress(addressInfo.getName());
+         managementService.registerAddress(addressInfo);
       } catch (Exception e) {
          e.printStackTrace();
       }
@@ -512,7 +512,7 @@ public class PostOfficeImpl implements PostOffice, NotificationListener, Binding
       if (binding.getType() == BindingType.LOCAL_QUEUE) {
          managementService.unregisterQueue(uniqueName, binding.getAddress());
       } else if (binding.getType() == BindingType.DIVERT) {
-         managementService.unregisterDivert(uniqueName);
+         managementService.unregisterDivert(uniqueName, binding.getAddress());
       }
 
       if (binding.getType() != BindingType.DIVERT) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
index 369fbc9..f716847 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/ActiveMQServer.java
@@ -477,7 +477,7 @@ public interface ActiveMQServer extends ActiveMQComponent {
 
    AddressInfo createOrUpdateAddressInfo(AddressInfo addressInfo) throws Exception;
 
-   AddressInfo removeAddressInfo(SimpleString address) throws Exception;
+   void removeAddressInfo(SimpleString address) throws Exception;
 
    String getInternalNamingPrefix();
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
index 96fad97..7d0faba 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/ClusterManager.java
@@ -601,7 +601,7 @@ public final class ClusterManager implements ActiveMQComponent {
                             dg);
          }
 
-         clusterConnection = new ClusterConnectionImpl(this, dg, connector, new SimpleString(config.getName()), new SimpleString(config.getAddress()), config.getMinLargeMessageSize(), config.getClientFailureCheckPeriod(), config.getConnectionTTL(), config.getRetryInterval(), config.getRetryIntervalMultiplier(), config.getMaxRetryInterval(), config.getInitialConnectAttempts(), config.getReconnectAttempts(), config.getCallTimeout(), config.getCallFailoverTimeout(), config.isDuplicateDetection(), config.getMessageLoadBalancingType(), config.getConfirmationWindowSize(), config.getProducerWindowSize(), executorFactory, server, postOffice, managementService, scheduledExecutor, config.getMaxHops(), nodeManager, server.getConfiguration().getClusterUser(), server.getConfiguration().getClusterPassword(), config.isAllowDirectConnectionsOnly(), config.getClusterNotificationInterval(), config.getClusterNotificationAttempts());
+         clusterConnection = new ClusterConnectionImpl(this, dg, connector, new SimpleString(config.getName()), new SimpleString(config.getAddress() != null ? config.getAddress() : ""), config.getMinLargeMessageSize(), config.getClientFailureCheckPeriod(), config.getConnectionTTL(), config.getRetryInterval(), config.getRetryIntervalMultiplier(), config.getMaxRetryInterval(), config.getInitialConnectAttempts(), config.getReconnectAttempts(), config.getCallTimeout(), config.getCallFailoverTimeout(), config.isDuplicateDetection(), config.getMessageLoadBalancingType(), config.getConfirmationWindowSize(), config.getProducerWindowSize(), executorFactory, server, postOffice, managementService, scheduledExecutor, config.getMaxHops(), nodeManager, server.getConfiguration().getClusterUser(), server.getConfiguration().getClusterPassword(), config.isAllowDirectConnectionsOnly(), config.getClusterNotificationInterval(), config.getClusterNotificationAttempts());
 
          clusterController.addClusterConnection(clusterConnection.getName(), dg, config);
       } else {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java
index 969ab42..f16d863 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionBridge.java
@@ -221,8 +221,6 @@ public class ClusterConnectionBridge extends BridgeImpl {
 
          SimpleString notifQueueName = new SimpleString(qName);
 
-         String filterString = flowRecord.getAddress();
-
          SimpleString filter = new SimpleString(ManagementHelper.HDR_BINDING_TYPE + "<>" +
                                                    BindingType.DIVERT.toInt() +
                                                    " AND " +
@@ -261,7 +259,7 @@ public class ClusterConnectionBridge extends BridgeImpl {
          if (logger.isTraceEnabled()) {
             logger.trace("Requesting sendQueueInfoToQueue through " + this, new Exception("trace"));
          }
-         ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "sendQueueInfoToQueue", notifQueueName.toString(), flowRecord.getAddress());
+         ManagementHelper.putOperationInvocation(message, ResourceNames.BROKER, "sendQueueInfoToQueue", notifQueueName.toString(), flowRecord.getAddress());
 
          try (ClientProducer prod = sessionConsumer.createProducer(managementAddress)) {
             if (logger.isDebugEnabled()) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
index 01f7b28..5ee94f0 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/impl/ClusterConnectionImpl.java
@@ -888,7 +888,7 @@ public final class ClusterConnectionImpl implements ClusterConnection, AfterConn
 
       @Override
       public String getAddress() {
-         return address.toString();
+         return address != null ? address.toString() : "";
       }
 
       /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index b09f04d..285bf3b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -2354,15 +2354,14 @@ public class ActiveMQServerImpl implements ActiveMQServer {
    }
 
    @Override
-   public AddressInfo removeAddressInfo(SimpleString address) throws Exception {
-      AddressInfo result = postOffice.removeAddressInfo(address);
+   public void removeAddressInfo(SimpleString address) throws Exception {
+      postOffice.removeAddressInfo(address);
 
       // TODO: is this the right way to do this?
 //      long txID = storageManager.generateID();
 //      storageManager.deleteAddressBinding(txID, getAddressInfo(address).getID());
 //      storageManager.commitBindings(txID);
 
-      return result;
    }
 
    @Override
@@ -2502,9 +2501,6 @@ public class ActiveMQServerImpl implements ActiveMQServer {
          throw e;
       }
 
-      if (!addressAlreadyExists) {
-         managementService.registerAddress(queue.getAddress());
-      }
       managementService.registerQueue(queue, queue.getAddress(), storageManager);
 
       callPostQueueCreationCallbacks(queue.getName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
index 488c4b2..708aeda 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/AddressInfo.java
@@ -33,6 +33,13 @@ public class AddressInfo {
       this.name = name;
    }
 
+   public AddressInfo(SimpleString name, RoutingType routingType,  boolean defaultDeleteOnNoConsumers, int defaultMaxConsumers) {
+      this(name);
+      this.routingType = routingType;
+      this.defaultDeleteOnNoConsumers = defaultDeleteOnNoConsumers;
+      this.defaultMaxQueueConsumers = defaultMaxConsumers;
+   }
+
    public RoutingType getRoutingType() {
       return routingType;
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
index dc64ddd..76fc69b 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/PostOfficeJournalLoader.java
@@ -166,7 +166,7 @@ public class PostOfficeJournalLoader implements JournalLoader {
 
          queues.put(queue.getID(), queue);
          postOffice.addBinding(binding);
-         managementService.registerAddress(queue.getAddress());
+         //managementService.registerAddress(queue.getAddress());
          managementService.registerQueue(queue, queue.getAddress(), storageManager);
 
       }
@@ -184,7 +184,7 @@ public class PostOfficeJournalLoader implements JournalLoader {
             .setDefaultMaxQueueConsumers(addressBindingInfo.getDefaultMaxConsumers());
 
          postOffice.addAddressInfo(addressInfo);
-         managementService.registerAddress(addressInfo.getName());
+         managementService.registerAddress(addressInfo);
       }
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java
index 2c28676..a5f96b1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ScaleDownHandler.java
@@ -412,7 +412,7 @@ public class ScaleDownHandler {
                Pair<byte[], Long> pair = list.get(i);
                array[i] = new String(pair.getA());
             }
-            ManagementHelper.putOperationInvocation(message, ResourceNames.CORE_SERVER, "updateDuplicateIdCache", entry.getKey().toString(), array);
+            ManagementHelper.putOperationInvocation(message, ResourceNames.BROKER, "updateDuplicateIdCache", entry.getKey().toString(), array);
             producer.send(message);
          }
       }
@@ -442,7 +442,7 @@ public class ScaleDownHandler {
       Object result;
       try (ClientRequestor requestor = new ClientRequestor(session, "activemq.management")) {
          ClientMessage managementMessage = session.createMessage(false);
-         ManagementHelper.putAttribute(managementMessage, "core.queue." + queueName, "ID");
+         ManagementHelper.putAttribute(managementMessage, ResourceNames.QUEUE + queueName, "ID");
          session.start();
          logger.debug("Requesting ID for: " + queueName);
          ClientMessage reply = requestor.request(managementMessage);

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementService.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementService.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementService.java
index 5f40c53..58d91a4 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementService.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/ManagementService.java
@@ -45,6 +45,7 @@ import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.cluster.Bridge;
 import org.apache.activemq.artemis.core.server.cluster.BroadcastGroup;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
 import org.apache.activemq.artemis.core.transaction.ResourceManager;
@@ -89,7 +90,7 @@ public interface ManagementService extends NotificationService, ActiveMQComponen
 
    void unregisterFromRegistry(final String resourceName);
 
-   void registerAddress(SimpleString address) throws Exception;
+   void registerAddress(AddressInfo addressInfo) throws Exception;
 
    void unregisterAddress(SimpleString address) throws Exception;
 
@@ -103,7 +104,7 @@ public interface ManagementService extends NotificationService, ActiveMQComponen
 
    void registerDivert(Divert divert, DivertConfiguration config) throws Exception;
 
-   void unregisterDivert(SimpleString name) throws Exception;
+   void unregisterDivert(SimpleString name, SimpleString address) throws Exception;
 
    void registerBroadcastGroup(BroadcastGroup broadcastGroup,
                                BroadcastGroupConfiguration configuration) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
index d3103bc..0ade3f1 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/management/impl/ManagementServiceImpl.java
@@ -75,6 +75,7 @@ import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.cluster.Bridge;
 import org.apache.activemq.artemis.core.server.cluster.BroadcastGroup;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.server.impl.ServerMessageImpl;
 import org.apache.activemq.artemis.core.server.management.ManagementService;
 import org.apache.activemq.artemis.core.server.management.Notification;
@@ -197,7 +198,7 @@ public class ManagementServiceImpl implements ManagementService {
       messagingServerControl = new ActiveMQServerControlImpl(postOffice, configuration, resourceManager, remotingService, messagingServer, messageCounterManager, storageManager1, broadcaster);
       ObjectName objectName = objectNameBuilder.getActiveMQServerObjectName();
       registerInJMX(objectName, messagingServerControl);
-      registerInRegistry(ResourceNames.CORE_SERVER, messagingServerControl);
+      registerInRegistry(ResourceNames.BROKER, messagingServerControl);
 
       return messagingServerControl;
    }
@@ -206,17 +207,17 @@ public class ManagementServiceImpl implements ManagementService {
    public synchronized void unregisterServer() throws Exception {
       ObjectName objectName = objectNameBuilder.getActiveMQServerObjectName();
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_SERVER);
+      unregisterFromRegistry(ResourceNames.BROKER);
    }
 
    @Override
-   public synchronized void registerAddress(final SimpleString address) throws Exception {
-      ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
-      AddressControlImpl addressControl = new AddressControlImpl(address, postOffice, pagingManager, storageManager, securityRepository);
+   public void registerAddress(AddressInfo addressInfo) throws Exception {
+      ObjectName objectName = objectNameBuilder.getAddressObjectName(addressInfo.getName());
+      AddressControlImpl addressControl = new AddressControlImpl(addressInfo, postOffice, pagingManager, storageManager, securityRepository, securityStore, this);
 
       registerInJMX(objectName, addressControl);
 
-      registerInRegistry(ResourceNames.CORE_ADDRESS + address, addressControl);
+      registerInRegistry(ResourceNames.ADDRESS + addressInfo.getName(), addressControl);
 
       if (logger.isDebugEnabled()) {
          logger.debug("registered address " + objectName);
@@ -228,9 +229,8 @@ public class ManagementServiceImpl implements ManagementService {
       ObjectName objectName = objectNameBuilder.getAddressObjectName(address);
 
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_ADDRESS + address);
+      unregisterFromRegistry(ResourceNames.ADDRESS + address);
    }
-
    @Override
    public synchronized void registerQueue(final Queue queue,
                                           final SimpleString address,
@@ -243,7 +243,7 @@ public class ManagementServiceImpl implements ManagementService {
       }
       ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName());
       registerInJMX(objectName, queueControl);
-      registerInRegistry(ResourceNames.CORE_QUEUE + queue.getName(), queueControl);
+      registerInRegistry(ResourceNames.QUEUE + queue.getName(), queueControl);
 
       if (logger.isDebugEnabled()) {
          logger.debug("registered queue " + objectName);
@@ -254,16 +254,16 @@ public class ManagementServiceImpl implements ManagementService {
    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);
+      unregisterFromRegistry(ResourceNames.QUEUE + name);
       messageCounterManager.unregisterMessageCounter(name.toString());
    }
 
    @Override
    public synchronized void registerDivert(final Divert divert, final DivertConfiguration config) throws Exception {
-      ObjectName objectName = objectNameBuilder.getDivertObjectName(divert.getUniqueName().toString());
+      ObjectName objectName = objectNameBuilder.getDivertObjectName(divert.getUniqueName().toString(), config.getAddress());
       DivertControl divertControl = new DivertControlImpl(divert, storageManager, config);
       registerInJMX(objectName, divertControl);
-      registerInRegistry(ResourceNames.CORE_DIVERT + config.getName(), divertControl);
+      registerInRegistry(ResourceNames.DIVERT + config.getName(), divertControl);
 
       if (logger.isDebugEnabled()) {
          logger.debug("registered divert " + objectName);
@@ -271,10 +271,10 @@ public class ManagementServiceImpl implements ManagementService {
    }
 
    @Override
-   public synchronized void unregisterDivert(final SimpleString name) throws Exception {
-      ObjectName objectName = objectNameBuilder.getDivertObjectName(name.toString());
+   public synchronized void unregisterDivert(final SimpleString name, final SimpleString address) throws Exception {
+      ObjectName objectName = objectNameBuilder.getDivertObjectName(name.toString(), address.toString());
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_DIVERT + name);
+      unregisterFromRegistry(ResourceNames.DIVERT + name);
    }
 
    @Override
@@ -283,7 +283,7 @@ public class ManagementServiceImpl implements ManagementService {
       ObjectName objectName = objectNameBuilder.getAcceptorObjectName(configuration.getName());
       AcceptorControl control = new AcceptorControlImpl(acceptor, storageManager, configuration);
       registerInJMX(objectName, control);
-      registerInRegistry(ResourceNames.CORE_ACCEPTOR + configuration.getName(), control);
+      registerInRegistry(ResourceNames.ACCEPTOR + configuration.getName(), control);
    }
 
    @Override
@@ -291,14 +291,14 @@ public class ManagementServiceImpl implements ManagementService {
       List<String> acceptors = new ArrayList<>();
       synchronized (this) {
          for (String resourceName : registry.keySet()) {
-            if (resourceName.startsWith(ResourceNames.CORE_ACCEPTOR)) {
+            if (resourceName.startsWith(ResourceNames.ACCEPTOR)) {
                acceptors.add(resourceName);
             }
          }
       }
 
       for (String acceptor : acceptors) {
-         String name = acceptor.substring(ResourceNames.CORE_ACCEPTOR.length());
+         String name = acceptor.substring(ResourceNames.ACCEPTOR.length());
          try {
             unregisterAcceptor(name);
          } catch (Exception e) {
@@ -310,7 +310,7 @@ public class ManagementServiceImpl implements ManagementService {
    public synchronized void unregisterAcceptor(final String name) throws Exception {
       ObjectName objectName = objectNameBuilder.getAcceptorObjectName(name);
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_ACCEPTOR + name);
+      unregisterFromRegistry(ResourceNames.ACCEPTOR + name);
    }
 
    @Override
@@ -320,14 +320,14 @@ public class ManagementServiceImpl implements ManagementService {
       ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(configuration.getName());
       BroadcastGroupControl control = new BroadcastGroupControlImpl(broadcastGroup, storageManager, configuration);
       registerInJMX(objectName, control);
-      registerInRegistry(ResourceNames.CORE_BROADCAST_GROUP + configuration.getName(), control);
+      registerInRegistry(ResourceNames.BROADCAST_GROUP + configuration.getName(), control);
    }
 
    @Override
    public synchronized void unregisterBroadcastGroup(final String name) throws Exception {
       ObjectName objectName = objectNameBuilder.getBroadcastGroupObjectName(name);
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_BROADCAST_GROUP + name);
+      unregisterFromRegistry(ResourceNames.BROADCAST_GROUP + name);
    }
 
    @Override
@@ -337,14 +337,14 @@ public class ManagementServiceImpl implements ManagementService {
       ObjectName objectName = objectNameBuilder.getBridgeObjectName(configuration.getName());
       BridgeControl control = new BridgeControlImpl(bridge, storageManager, configuration);
       registerInJMX(objectName, control);
-      registerInRegistry(ResourceNames.CORE_BRIDGE + configuration.getName(), control);
+      registerInRegistry(ResourceNames.BRIDGE + configuration.getName(), control);
    }
 
    @Override
    public synchronized void unregisterBridge(final String name) throws Exception {
       ObjectName objectName = objectNameBuilder.getBridgeObjectName(name);
       unregisterFromJMX(objectName);
-      unregisterFromRegistry(ResourceNames.CORE_BRIDGE + name);
+      unregisterFromRegistry(ResourceNames.BRIDGE + name);
    }
 
    @Override
@@ -470,7 +470,6 @@ public class ManagementServiceImpl implements ManagementService {
 
    @Override
    public synchronized void unregisterFromRegistry(final String resourceName) {
-      ActiveMQServerLogger.LOGGER.info("Unregistering: " + resourceName, new Exception());
       registry.remove(resourceName);
    }
 
@@ -536,7 +535,7 @@ public class ManagementServiceImpl implements ManagementService {
             List<String> unexpectedResourceNames = new ArrayList<>();
             for (String name : resourceNames) {
                // only addresses, queues, and diverts should still be registered
-               if (!(name.startsWith(ResourceNames.CORE_ADDRESS) || name.startsWith(ResourceNames.CORE_QUEUE) || name.startsWith(ResourceNames.CORE_DIVERT))) {
+               if (!(name.startsWith(ResourceNames.ADDRESS) || name.startsWith(ResourceNames.QUEUE) || name.startsWith(ResourceNames.DIVERT))) {
                   unexpectedResourceNames.add(name);
                }
             }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/main/resources/schema/artemis-configuration.xsd
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/resources/schema/artemis-configuration.xsd b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
index 232a81b..3e166fd 100644
--- a/artemis-server/src/main/resources/schema/artemis-configuration.xsd
+++ b/artemis-server/src/main/resources/schema/artemis-configuration.xsd
@@ -1291,7 +1291,7 @@
 
    <xsd:complexType name="cluster-connectionType">
       <xsd:sequence>
-         <xsd:element name="address" type="xsd:string" maxOccurs="1" minOccurs="1">
+         <xsd:element name="address" type="xsd:string" maxOccurs="1" minOccurs="0">
             <xsd:annotation>
                <xsd:documentation>
                   name of the address this cluster connection applies to

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
index 1211dee..3736c05 100644
--- a/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
+++ b/artemis-server/src/test/java/org/apache/activemq/artemis/core/server/group/impl/ClusteredResetMockTest.java
@@ -47,6 +47,7 @@ import org.apache.activemq.artemis.core.server.ServerMessage;
 import org.apache.activemq.artemis.core.server.cluster.Bridge;
 import org.apache.activemq.artemis.core.server.cluster.BroadcastGroup;
 import org.apache.activemq.artemis.core.server.cluster.ClusterConnection;
+import org.apache.activemq.artemis.core.server.impl.AddressInfo;
 import org.apache.activemq.artemis.core.server.management.ManagementService;
 import org.apache.activemq.artemis.core.server.management.Notification;
 import org.apache.activemq.artemis.core.server.management.NotificationListener;
@@ -245,7 +246,7 @@ public class ClusteredResetMockTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void registerAddress(SimpleString address) throws Exception {
+      public void registerAddress(AddressInfo addressInfo) throws Exception {
 
       }
 
@@ -280,7 +281,7 @@ public class ClusteredResetMockTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void unregisterDivert(SimpleString name) throws Exception {
+      public void unregisterDivert(SimpleString name, SimpleString address) throws Exception {
 
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java b/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
index 44be2f9..dfca508 100644
--- a/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
+++ b/examples/features/standard/jmx/src/main/java/org/apache/activemq/artemis/jms/example/JMXExample.java
@@ -34,7 +34,8 @@ import javax.naming.InitialContext;
 import java.util.HashMap;
 
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.jms.client.ActiveMQTextMessage;
 
 /**
  * An example that shows how to manage ActiveMQ Artemis using JMX.
@@ -81,13 +82,13 @@ public class JMXExample {
          // Step 11. Retrieve the MBeanServerConnection
          MBeanServerConnection mbsc = connector.getMBeanServerConnection();
 
-         // Step 12. Create a JMSQueueControl proxy to manage the queue on the server
-         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
+         // Step 12. Create a QueueControl proxy to manage the queue on the server
+         QueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, QueueControl.class, false);
          // Step 13. Display the number of messages in the queue
          System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");
 
          // Step 14. Remove the message sent at step #8
-         System.out.println("message has been removed: " + queueControl.removeMessage(message.getJMSMessageID()));
+         System.out.println("message has been removed: " + queueControl.removeMessage(((ActiveMQTextMessage) message).getCoreMessage().getMessageID()));
 
          // Step 15. Display the number of messages in the queue
          System.out.println(queueControl.getName() + " contains " + queueControl.getMessageCount() + " messages");

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
----------------------------------------------------------------------
diff --git a/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java b/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
index 5fc8245..f227343 100644
--- a/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
+++ b/examples/features/standard/message-counters/src/main/java/org/apache/activemq/artemis/jms/example/MessageCounterExample.java
@@ -35,7 +35,7 @@ import java.util.HashMap;
 
 import org.apache.activemq.artemis.api.core.management.MessageCounterInfo;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
 
 /**
  * An example showing how to use message counters to have information on a queue.
@@ -75,7 +75,7 @@ public class MessageCounterExample {
          ObjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
          JMXConnector connector = JMXConnectorFactory.connect(new JMXServiceURL(JMX_URL), new HashMap<String, Object>());
          MBeanServerConnection mbsc = connector.getMBeanServerConnection();
-         JMSQueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, JMSQueueControl.class, false);
+         QueueControl queueControl = MBeanServerInvocationHandler.newProxyInstance(mbsc, on, QueueControl.class, false);
 
          // Step 8. List the message counters and convert them to MessageCounterInfo data structure.
          String counters = queueControl.listMessageCounter();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/OpenwireArtemisBaseTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/OpenwireArtemisBaseTest.java b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/OpenwireArtemisBaseTest.java
index 2cb755a..8ff33b9 100644
--- a/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/OpenwireArtemisBaseTest.java
+++ b/tests/activemq5-unit-tests/src/main/java/org/apache/activemq/broker/artemiswrapper/OpenwireArtemisBaseTest.java
@@ -27,9 +27,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
 
-import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.config.impl.ConfigurationImpl;
 import org.apache.activemq.artemis.core.server.JournalType;
@@ -195,15 +192,6 @@ public class OpenwireArtemisBaseTest {
       return "tcp://" + localhostAddress + ":" + port + "?" + URISupport.createQueryString(params);
    }
 
-   public static JMSServerControl createJMSServerControl(final MBeanServer mbeanServer) throws Exception {
-      return (JMSServerControl) createProxy(ObjectNameBuilder.DEFAULT.getJMSServerObjectName(), JMSServerControl.class, mbeanServer);
-   }
-
-   public static JMSQueueControl createJMSQueueControl(final String name,
-                                                       final MBeanServer mbeanServer) throws Exception {
-      return (JMSQueueControl) createProxy(ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(name), JMSQueueControl.class, mbeanServer);
-   }
-
    private static Object createProxy(final ObjectName objectName,
                                      final Class mbeanInterface,
                                      final MBeanServer mbeanServer) {

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
index f62052c..3845afd 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/JMSConsumerTest.java
@@ -40,11 +40,9 @@ import java.util.concurrent.atomic.AtomicInteger;
 
 import junit.framework.Test;
 
+import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.management.ObjectNameBuilder;
-import org.apache.activemq.artemis.api.jms.management.DestinationControl;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
-import org.apache.activemq.artemis.api.jms.management.TopicControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
 import org.apache.activemq.broker.artemiswrapper.ArtemisBrokerWrapper;
 import org.apache.activemq.command.ActiveMQDestination;
 import org.apache.activemq.command.ActiveMQQueue;
@@ -868,7 +866,6 @@ public class JMSConsumerTest extends JmsTestSupport {
       Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
       destination = (ActiveMQDestination) (destinationType == ActiveMQDestination.QUEUE_TYPE ? session.createQueue("test") : session.createTopic("test"));
 
-      createManagedDestinationOnServer(destination);
       MessageConsumer consumer = session.createConsumer(destination);
       connection.setStatsEnabled(true);
 
@@ -902,42 +899,17 @@ public class JMSConsumerTest extends JmsTestSupport {
       }
       assertEquals("consumer has expiredMessages", count, amqConsumer.getConsumerStats().getExpiredMessageCount().getCount());
 
-      DestinationControl view = createView(destination);
+      QueueControl view = createQueueControl(destination.getPhysicalName());
 
       assertEquals("Wrong inFlightCount: " + view.getDeliveringCount(), 0, view.getDeliveringCount());
       assertEquals("Wrong dispatch count: " + view.getMessagesAdded(), 8, view.getMessagesAdded());
    }
 
-   private void createManagedDestinationOnServer(ActiveMQDestination destination) throws Exception {
-      String destName = destination.getPhysicalName();
+   private QueueControl createQueueControl(String destName) throws Exception {
       ArtemisBrokerWrapper wrapper = (ArtemisBrokerWrapper) broker.getBroker();
       MBeanServer beanServer = wrapper.getMbeanServer();
-      ObjectName objName = ObjectNameBuilder.DEFAULT.getJMSServerObjectName();
-      JMSServerControl serverControl = MBeanServerInvocationHandler.newProxyInstance(beanServer, objName, JMSServerControl.class, false);
-      serverControl.createQueue(destName);
-   }
-
-   protected DestinationControl createView(ActiveMQDestination destination) throws Exception {
-
-      String destName = destination.getPhysicalName();
-      if (destination.isQueue()) {
-         return createJMSQueueControl(destName);
-      } else {
-         return createJMSTopicControl(destName);
-      }
-   }
-
-   private JMSQueueControl createJMSQueueControl(String destName) throws Exception {
-      ArtemisBrokerWrapper wrapper = (ArtemisBrokerWrapper) broker.getBroker();
-      MBeanServer beanServer = wrapper.getMbeanServer();
-      ObjectName objName = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(destName);
-      return MBeanServerInvocationHandler.newProxyInstance(beanServer, objName, JMSQueueControl.class, false);
-   }
-
-   private TopicControl createJMSTopicControl(String destName) throws Exception {
-      ArtemisBrokerWrapper wrapper = (ArtemisBrokerWrapper) broker.getBroker();
-      MBeanServer beanServer = wrapper.getMbeanServer();
-      ObjectName objName = ObjectNameBuilder.DEFAULT.getJMSTopicObjectName(destName);
-      return MBeanServerInvocationHandler.newProxyInstance(beanServer, objName, TopicControl.class, false);
+      SimpleString address = new SimpleString(destName);
+      ObjectName objName = ObjectNameBuilder.DEFAULT.getQueueObjectName(address, address);
+      return MBeanServerInvocationHandler.newProxyInstance(beanServer, objName, QueueControl.class, false);
    }
 }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java
----------------------------------------------------------------------
diff --git a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java
index 63e62eb..c87a640 100644
--- a/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java
+++ b/tests/activemq5-unit-tests/src/test/java/org/apache/activemq/transport/failover/FailoverBackupLeakTest.java
@@ -23,7 +23,8 @@ import javax.jms.Session;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.ActiveMQConnectionFactory;
-import org.apache.activemq.artemis.api.jms.management.JMSServerControl;
+import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.server.management.ManagementService;
 import org.apache.activemq.artemis.jms.server.config.impl.JMSConfigurationImpl;
@@ -112,7 +113,7 @@ public class FailoverBackupLeakTest extends OpenwireArtemisBaseTest {
 
    private int getConnectionCount(EmbeddedJMS server) throws Exception {
       ManagementService managementService = server.getActiveMQServer().getManagementService();
-      JMSServerControl jmsControl = (JMSServerControl) managementService.getResource("jms.server");
+      ActiveMQServerControl jmsControl = (ActiveMQServerControl) managementService.getResource(ResourceNames.BROKER);
       String[] ids = jmsControl.listConnectionIDs();
       if (ids != null) {
          return ids.length;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
----------------------------------------------------------------------
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
index a89edb8..5e0345f 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/jms/bridge/BridgeTestBase.java
@@ -38,10 +38,11 @@ import com.arjuna.ats.arjuna.coordinator.TransactionReaper;
 import com.arjuna.ats.arjuna.coordinator.TxControl;
 import com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple;
 import org.apache.activemq.artemis.api.core.TransportConfiguration;
+import org.apache.activemq.artemis.api.core.management.AddressControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.api.jms.ActiveMQJMSClient;
 import org.apache.activemq.artemis.api.jms.JMSFactoryType;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
-import org.apache.activemq.artemis.api.jms.management.TopicControl;
 import org.apache.activemq.artemis.core.config.Configuration;
 import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.TransportConstants;
@@ -485,7 +486,7 @@ public abstract class BridgeTestBase extends ActiveMQTestBase {
       if (index == 1) {
          managementService = server1.getManagementService();
       }
-      JMSQueueControl queueControl = (JMSQueueControl) managementService.getResource(queue.getQueueName());
+      QueueControl queueControl = (QueueControl) managementService.getResource(ResourceNames.QUEUE + queue.getQueueName());
 
       //server may be closed
       if (queueControl != null) {
@@ -504,8 +505,8 @@ public abstract class BridgeTestBase extends ActiveMQTestBase {
       if (index == 1) {
          managementService = server1.getManagementService();
       }
-      TopicControl topicControl = (TopicControl) managementService.getResource(topic.getTopicName());
-      Assert.assertEquals(0, topicControl.getSubscriptionCount());
+      AddressControl topicControl = (AddressControl) managementService.getResource(ResourceNames.ADDRESS + topic.getTopicName());
+      Assert.assertEquals(0, topicControl.getQueueNames().length);
 
    }
 
@@ -514,7 +515,7 @@ public abstract class BridgeTestBase extends ActiveMQTestBase {
       if (index == 1) {
          managementService = server1.getManagementService();
       }
-      JMSQueueControl queueControl = (JMSQueueControl) managementService.getResource(queueName);
+      QueueControl queueControl = (QueueControl) managementService.getResource("queue." + queueName);
       queueControl.removeMessages(null);
    }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
index ad90f0a..5094eba 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/AutoCreateJmsDestinationTest.java
@@ -39,8 +39,8 @@ import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.apache.activemq.artemis.api.core.management.ResourceNames.CORE_ADDRESS;
-import static org.apache.activemq.artemis.api.core.management.ResourceNames.CORE_QUEUE;
+import static org.apache.activemq.artemis.api.core.management.ResourceNames.ADDRESS;
+import static org.apache.activemq.artemis.api.core.management.ResourceNames.QUEUE;
 
 public class AutoCreateJmsDestinationTest extends JMSTestBase {
 
@@ -73,8 +73,8 @@ public class AutoCreateJmsDestinationTest extends JMSTestBase {
       }
 
       // make sure the JMX control was created for the address and queue
-      assertNotNull(server.getManagementService().getResource(CORE_ADDRESS + QUEUE_NAME));
-      assertNotNull(server.getManagementService().getResource(CORE_QUEUE + QUEUE_NAME));
+      assertNotNull(server.getManagementService().getResource(ADDRESS + QUEUE_NAME));
+      assertNotNull(server.getManagementService().getResource(QUEUE + QUEUE_NAME));
 
       connection.close();
    }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java
index b3dd022..48080fe 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/JMSMessageCounterTest.java
@@ -23,7 +23,8 @@ import javax.jms.Queue;
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.tests.util.JMSTestBase;
 import org.junit.Test;
 
@@ -53,7 +54,7 @@ public class JMSMessageCounterTest extends JMSTestBase {
 
       conn.close();
 
-      JMSQueueControl control = (JMSQueueControl) server.getManagementService().getResource(queue.getQueueName());
+      QueueControl control = (QueueControl) server.getManagementService().getResource(ResourceNames.QUEUE + queue.getQueueName());
       assertNotNull(control);
 
       System.out.println(control.listMessageCounterAsHTML());
@@ -62,7 +63,7 @@ public class JMSMessageCounterTest extends JMSTestBase {
 
       restartServer();
 
-      control = (JMSQueueControl) server.getManagementService().getResource(queue.getQueueName());
+      control = (QueueControl) server.getManagementService().getResource(ResourceNames.QUEUE + queue.getQueueName());
       assertNotNull(control);
 
       System.out.println(control.listMessageCounterAsHTML());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleProducersTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleProducersTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleProducersTest.java
index a77c4d1..147e819 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleProducersTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/MultipleProducersTest.java
@@ -25,7 +25,8 @@ import javax.jms.Queue;
 import javax.jms.Session;
 
 import org.apache.activemq.artemis.api.core.SimpleString;
-import org.apache.activemq.artemis.api.jms.management.JMSQueueControl;
+import org.apache.activemq.artemis.api.core.management.QueueControl;
+import org.apache.activemq.artemis.api.core.management.ResourceNames;
 import org.apache.activemq.artemis.core.settings.HierarchicalRepository;
 import org.apache.activemq.artemis.core.settings.impl.AddressFullMessagePolicy;
 import org.apache.activemq.artemis.core.settings.impl.AddressSettings;
@@ -47,7 +48,7 @@ public class MultipleProducersTest extends JMSTestBase {
 
    public SimpleString queueOneName = new SimpleString("queueOne");
    public SimpleString queueTwoName = new SimpleString("queueTwo");
-   public JMSQueueControl control = null;
+   public QueueControl control = null;
    public long queueOneMsgCount = 0;
    public long queueTwoMsgCount = 0;
 
@@ -126,7 +127,7 @@ public class MultipleProducersTest extends JMSTestBase {
       // after draining queueOne send 5 message to queueOne
       queueTwoMsgCount = server.locateQueue(queueTwoName).getMessageCount();
 
-      control = (JMSQueueControl) server.getManagementService().getResource(queueOne.getQueueName());
+      control = (QueueControl) server.getManagementService().getResource(ResourceNames.QUEUE + queueOne.getQueueName());
 
       control.removeMessages(null);
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2b46f6a4/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java
index e8da058..4c18488 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/bridge/BridgeReconnectTest.java
@@ -374,7 +374,7 @@ public class BridgeReconnectTest extends BridgeTestBase {
       forwardingConnection.fail(new ActiveMQNotConnectedException());
 
       final ManagementService managementService = server0.getManagementService();
-      QueueControl coreQueueControl = (QueueControl) managementService.getResource(ResourceNames.CORE_QUEUE + queueName);
+      QueueControl coreQueueControl = (QueueControl) managementService.getResource(ResourceNames.QUEUE + queueName);
       assertEquals(0, coreQueueControl.getDeliveringCount());
 
       final int numMessages = NUM_MESSAGES;


Mime
View raw message