activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clebertsuco...@apache.org
Subject [41/55] [abbrv] activemq-artemis git commit: updated JMX model
Date Wed, 07 Dec 2016 18:18:44 GMT
updated JMX model


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/3c6c1ae0
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/3c6c1ae0
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/3c6c1ae0

Branch: refs/heads/ARTEMIS-780
Commit: 3c6c1ae0027bc2e3df61e3a0a4a1e6956e168827
Parents: e3e9547
Author: Andy Taylor <andy.tayls67@gmail.com>
Authored: Wed Nov 30 13:56:37 2016 +0000
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Wed Dec 7 13:16:35 2016 -0500

----------------------------------------------------------------------
 .../api/core/management/ActiveMQServerControl.java   |  2 +-
 .../api/core/management/ObjectNameBuilder.java       | 15 +++++++++++++--
 .../management/impl/ActiveMQServerControlImpl.java   |  6 ++----
 .../artemis/core/postoffice/impl/PostOfficeImpl.java |  3 ++-
 .../core/server/management/ManagementService.java    |  3 ++-
 .../management/impl/ManagementServiceImpl.java       |  7 ++++---
 .../server/group/impl/ClusteredResetMockTest.java    |  3 ++-
 .../management/ActiveMQServerControlTest.java        |  2 +-
 .../ActiveMQServerControlUsingCoreTest.java          |  2 +-
 .../management/ManagementControlHelper.java          |  3 ++-
 .../timing/jms/bridge/impl/JMSBridgeImplTest.java    |  3 ++-
 11 files changed, 32 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
index b6b5b5e..cd257c6 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ActiveMQServerControl.java
@@ -436,7 +436,7 @@ public interface ActiveMQServerControl {
 
    @Operation(desc = "delete an address", impact = MBeanOperationInfo.ACTION)
    void createAddress(@Parameter(name = "name", desc = "The name of the address") String
name,
-                      @Parameter(name = "deliveryMode", desc = "The delivery modes enabled
for this address'") Object[] routingTypes) throws Exception;
+                      @Parameter(name = "routingType", desc = "Comma separated list of Routing
Typles (anycast/multicast)") String routingTypes) throws Exception;
 
    @Operation(desc = "delete an address", impact = MBeanOperationInfo.ACTION)
    void deleteAddress(@Parameter(name = "name", desc = "The name of the address") String
name) throws Exception;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
index 3bbd456..00a95e1 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ObjectNameBuilder.java
@@ -20,6 +20,7 @@ import javax.management.ObjectName;
 
 import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
+import org.apache.activemq.artemis.core.server.RoutingType;
 
 /**
  * Helper class to build ObjectNames for ActiveMQ Artemis resources.
@@ -98,10 +99,20 @@ public final class ObjectNameBuilder {
     *
     * @see QueueControl
     */
+   public ObjectName getQueueObjectName(final SimpleString address, final SimpleString name,
RoutingType routingType) throws Exception {
+      return ObjectName.getInstance(String.format("%s:" + getBrokerProperties() + "parentType=%s,parentName=%s,"
+ getObjectType() + "=%s, routingType=%s,name=%s", domain, "Address", ObjectName.quote(address.toString()),
"Queue", routingType.toString(), ObjectName.quote(name.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:" + getBrokerProperties() + "parentType=%s,parentName=%s,"
+ getObjectType() + "=%s,name=%s", domain, "Address", ObjectName.quote(address.toString()),
"Queue", ObjectName.quote(name.toString())));
+      return ObjectName.getInstance(String.format("%s:" + getBrokerProperties() + "parentType=%s,parentName=%s,"
+ getObjectType() + "=%s, routingType=%s,name=%s", domain, "Address", ObjectName.quote(address.toString()),
"Queue", ActiveMQDefaultConfiguration.getDefaultRoutingType(), ObjectName.quote(name.toString())));
    }
 
+
    /**
     * Returns the ObjectName used by DivertControl.
     *
@@ -165,7 +176,7 @@ public final class ObjectNameBuilder {
     * Returns the ObjectName used by JMSQueueControl.
     */
    public ObjectName getJMSQueueObjectName(final String name) throws Exception {
-      return getQueueObjectName(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name));
+      return getQueueObjectName(SimpleString.toSimpleString(name), SimpleString.toSimpleString(name),
RoutingType.ANYCAST);
    }
 
    /**

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/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 e6c32c8..82f3943 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
@@ -52,7 +52,6 @@ import org.apache.activemq.artemis.api.core.management.AddressControl;
 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.Parameter;
 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;
@@ -563,14 +562,13 @@ public class ActiveMQServerControlImpl extends AbstractControl implements
Active
    }
 
    @Override
-   public void createAddress(@Parameter(name = "name", desc = "The name of the address")
String name,
-                             @Parameter(name = "routingType", desc = "The delivery modes
enabled for this address'") Object[] routingTypes) throws Exception {
+   public void createAddress(String name, String routingTypes) throws Exception {
       checkStarted();
 
       clearIO();
       try {
          Set<RoutingType> set = new HashSet<>();
-         for (Object routingType : routingTypes) {
+         for (Object routingType : toList(routingTypes)) {
             set.add(RoutingType.valueOf(routingType.toString()));
          }
          server.createAddressInfo(new AddressInfo(new SimpleString(name), set));

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/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 e060542..9bd69d1 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
@@ -539,7 +539,8 @@ public class PostOfficeImpl implements PostOffice, NotificationListener,
Binding
       }
 
       if (binding.getType() == BindingType.LOCAL_QUEUE) {
-         managementService.unregisterQueue(uniqueName, binding.getAddress());
+         Queue queue = (Queue) binding.getBindable();
+         managementService.unregisterQueue(uniqueName, binding.getAddress(), queue.getRoutingType());
       } else if (binding.getType() == BindingType.DIVERT) {
          managementService.unregisterDivert(uniqueName, binding.getAddress());
       }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/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 58d91a4..767e3f0 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
@@ -41,6 +41,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Divert;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.server.RoutingType;
 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;
@@ -96,7 +97,7 @@ public interface ManagementService extends NotificationService, ActiveMQComponen
 
    void registerQueue(Queue queue, SimpleString address, StorageManager storageManager) throws
Exception;
 
-   void unregisterQueue(SimpleString name, SimpleString address) throws Exception;
+   void unregisterQueue(SimpleString name, SimpleString address, RoutingType routingType)
throws Exception;
 
    void registerAcceptor(Acceptor acceptor, TransportConfiguration configuration) throws
Exception;
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/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 213f965..71d988d 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
@@ -71,6 +71,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServerLogger;
 import org.apache.activemq.artemis.core.server.Divert;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.server.RoutingType;
 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;
@@ -241,7 +242,7 @@ public class ManagementServiceImpl implements ManagementService {
          queueControl.setMessageCounter(counter);
          messageCounterManager.registerMessageCounter(queue.getName().toString(), counter);
       }
-      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName());
+      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, queue.getName(),queue.getRoutingType());
       registerInJMX(objectName, queueControl);
       registerInRegistry(ResourceNames.QUEUE + queue.getName(), queueControl);
 
@@ -251,8 +252,8 @@ public class ManagementServiceImpl implements ManagementService {
    }
 
    @Override
-   public synchronized void unregisterQueue(final SimpleString name, final SimpleString address)
throws Exception {
-      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, name);
+   public synchronized void unregisterQueue(final SimpleString name, final SimpleString address,
RoutingType routingType) throws Exception {
+      ObjectName objectName = objectNameBuilder.getQueueObjectName(address, name, routingType);
       unregisterFromJMX(objectName);
       unregisterFromRegistry(ResourceNames.QUEUE + name);
       messageCounterManager.unregisterMessageCounter(name.toString());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/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 3736c05..5d61286 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
@@ -43,6 +43,7 @@ import org.apache.activemq.artemis.core.server.ActiveMQServer;
 import org.apache.activemq.artemis.core.server.Divert;
 import org.apache.activemq.artemis.core.server.Queue;
 import org.apache.activemq.artemis.core.server.QueueFactory;
+import org.apache.activemq.artemis.core.server.RoutingType;
 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;
@@ -261,7 +262,7 @@ public class ClusteredResetMockTest extends ActiveMQTestBase {
       }
 
       @Override
-      public void unregisterQueue(SimpleString name, SimpleString address) throws Exception
{
+      public void unregisterQueue(SimpleString name, SimpleString address, RoutingType routingType)
throws Exception {
 
       }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
index 4ca23c4..b75e019 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlTest.java
@@ -268,7 +268,7 @@ public class ActiveMQServerControlTest extends ManagementTestBase {
 
       serverControl.createQueue(address.toString(), RoutingType.ANYCAST.toString(), name.toString(),
null, durable, maxConsumers, deleteOnNoConsumers, autoCreateAddress);
 
-      checkResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name));
+      checkResource(ObjectNameBuilder.DEFAULT.getQueueObjectName(address, name, RoutingType.ANYCAST));
       QueueControl queueControl = ManagementControlHelper.createQueueControl(address, name,
mbeanServer);
       Assert.assertEquals(address.toString(), queueControl.getAddress());
       Assert.assertEquals(name.toString(), queueControl.getName());

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
index 5e02ff8..985b495 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ActiveMQServerControlUsingCoreTest.java
@@ -566,7 +566,7 @@ public class ActiveMQServerControlUsingCoreTest extends ActiveMQServerControlTes
 
          @Override
          public void createAddress(@Parameter(name = "name", desc = "The name of the address")
String name,
-                                   @Parameter(name = "routingType", desc = "The delivery
modes enabled for this address'") Object[] routingTypes) throws Exception {
+                                   @Parameter(name = "routingType", desc = "The delivery
modes enabled for this address'") String routingTypes) throws Exception {
 
          }
 

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
----------------------------------------------------------------------
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
index 0f82222..6bc8f3d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/management/ManagementControlHelper.java
@@ -20,6 +20,7 @@ import javax.management.MBeanServer;
 import javax.management.MBeanServerInvocationHandler;
 import javax.management.ObjectName;
 
+import org.apache.activemq.artemis.api.config.ActiveMQDefaultConfiguration;
 import org.apache.activemq.artemis.api.core.SimpleString;
 import org.apache.activemq.artemis.api.core.management.AcceptorControl;
 import org.apache.activemq.artemis.api.core.management.ActiveMQServerControl;
@@ -69,7 +70,7 @@ public class ManagementControlHelper {
    public static QueueControl createQueueControl(final SimpleString address,
                                                  final SimpleString name,
                                                  final MBeanServer mbeanServer) throws Exception
{
-      return (QueueControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getQueueObjectName(address,
name), QueueControl.class, mbeanServer);
+      return (QueueControl) ManagementControlHelper.createProxy(ObjectNameBuilder.DEFAULT.getQueueObjectName(address,
name, ActiveMQDefaultConfiguration.getDefaultRoutingType()), QueueControl.class, mbeanServer);
    }
 
    public static AddressControl createAddressControl(final SimpleString address,

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/3c6c1ae0/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
----------------------------------------------------------------------
diff --git a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
index 6aefd52..d49afab 100644
--- a/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
+++ b/tests/timing-tests/src/test/java/org/apache/activemq/artemis/tests/timing/jms/bridge/impl/JMSBridgeImplTest.java
@@ -55,6 +55,7 @@ import org.apache.activemq.artemis.core.registry.JndiBindingRegistry;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.apache.activemq.artemis.core.remoting.impl.invm.InVMConnectorFactory;
 import org.apache.activemq.artemis.core.server.ActiveMQServers;
+import org.apache.activemq.artemis.core.server.RoutingType;
 import org.apache.activemq.artemis.jms.bridge.ConnectionFactoryFactory;
 import org.apache.activemq.artemis.jms.bridge.DestinationFactory;
 import org.apache.activemq.artemis.jms.bridge.QualityOfServiceMode;
@@ -470,7 +471,7 @@ public class JMSBridgeImplTest extends ActiveMQTestBase {
 
       sourceConn.close();
       SimpleString add = new SimpleString(JMSBridgeImplTest.SOURCE);
-      QueueControl jmsQueueControl = MBeanServerInvocationHandler.newProxyInstance(ManagementFactory.getPlatformMBeanServer(),
ObjectNameBuilder.DEFAULT.getQueueObjectName(add, add), QueueControl.class, false);
+      QueueControl jmsQueueControl = MBeanServerInvocationHandler.newProxyInstance(ManagementFactory.getPlatformMBeanServer(),
ObjectNameBuilder.DEFAULT.getQueueObjectName(add, add, RoutingType.ANYCAST), QueueControl.class,
false);
       assertNotEquals(jmsQueueControl.getDeliveringCount(), numMessages);
 
       bridge.stop();


Mime
View raw message