activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbert...@apache.org
Subject [1/2] activemq-artemis git commit: ARTEMIS-565 A few fixes around the JSON change
Date Tue, 26 Jul 2016 18:26:30 GMT
Repository: activemq-artemis
Updated Branches:
  refs/heads/master fbfbef52b -> bac8ca5e7


ARTEMIS-565 A few fixes around the JSON change


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

Branch: refs/heads/master
Commit: b7efd5db3b800e2ec507198264105fe14893b578
Parents: fbfbef5
Author: Clebert Suconic <clebertsuconic@apache.org>
Authored: Tue Jul 26 11:56:28 2016 -0400
Committer: Clebert Suconic <clebertsuconic@apache.org>
Committed: Tue Jul 26 14:17:45 2016 -0400

----------------------------------------------------------------------
 .../artemis/api/core/management/ManagementHelper.java        | 8 +++++++-
 .../artemis/jms/management/impl/JMSServerControlImpl.java    | 4 ++--
 .../activemq/artemis/core/server/impl/ScaleDownHandler.java  | 4 ++--
 3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7efd5db/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java
----------------------------------------------------------------------
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java
index 61a9306..a4c0880 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/management/ManagementHelper.java
@@ -21,6 +21,7 @@ import org.apache.activemq.artemis.api.core.Message;
 import org.apache.activemq.artemis.api.core.SimpleString;
 
 import javax.json.JsonArray;
+import javax.json.JsonNumber;
 
 /**
  * Helper class to use ActiveMQ Artemis Core messages to manage server resources.
@@ -218,7 +219,12 @@ public final class ManagementHelper {
       Object[] res = ManagementHelper.getResults(message);
 
       if (res != null) {
-         return res[0];
+         if (res[0] instanceof JsonNumber) {
+            return ((JsonNumber)res[0]).longValue();
+         }
+         else {
+            return res[0];
+         }
       }
       else {
          return null;

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7efd5db/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSServerControlImpl.java
----------------------------------------------------------------------
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSServerControlImpl.java
b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSServerControlImpl.java
index afb99af..f3ac38c 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSServerControlImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/management/impl/JMSServerControlImpl.java
@@ -631,7 +631,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
                array.add(obj);
             }
          }
-         return array.toString();
+         return array.build().toString();
       }
       finally {
          blockOnIO();
@@ -833,7 +833,7 @@ public class JMSServerControlImpl extends AbstractControl implements JMSServerCo
                }
             }
          }
-         return brokers.toString();
+         return brokers.build().toString();
       }
       finally {
          blockOnIO();

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/b7efd5db/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 b62ea03..dd1f244 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
@@ -451,8 +451,8 @@ public class ScaleDownHandler {
       logger.debug("Requesting ID for: " + queueName);
       ClientMessage reply = requestor.request(managementMessage);
       Object result = ManagementHelper.getResult(reply);
-      if (result != null && result instanceof Integer) {
-         queueID = (Integer) result;
+      if (result != null && result instanceof Number) {
+         queueID = ((Number) result).intValue();
       }
       requestor.close();
       return queueID;


Mime
View raw message