camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject [2/2] camel git commit: CAMEL-8044: Camel commands useable for remote JVMs using jolokia
Date Tue, 16 Dec 2014 14:36:26 GMT
CAMEL-8044: Camel commands useable for remote JVMs using jolokia


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

Branch: refs/heads/master
Commit: a2ad7d12e6e424e98ae7651383a3621e3919fade
Parents: 9eb8bd6
Author: Claus Ibsen <davsclaus@apache.org>
Authored: Tue Dec 16 15:36:15 2014 +0100
Committer: Claus Ibsen <davsclaus@apache.org>
Committed: Tue Dec 16 15:36:15 2014 +0100

----------------------------------------------------------------------
 .../camel/commands/AbstractLocalCamelController.java      |  2 --
 .../org/apache/camel/commands/ContextInfoCommand.java     |  2 --
 .../commands/jolokia/DefaultJolokiaCamelController.java   | 10 ++++++++++
 3 files changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/a2ad7d12/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
index fe9be97..c2973ac 100644
--- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
+++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/AbstractLocalCamelController.java
@@ -67,8 +67,6 @@ public abstract class AbstractLocalCamelController extends AbstractCamelControll
             answer.put("version", context.getVersion());
             answer.put("status", context.getStatus().name());
             answer.put("uptime", context.getUptime());
-            answer.put("autoStartup", context.isAutoStartup());
-            answer.put("startingRoutes", context.isStartingRoutes());
             answer.put("suspended", context.getStatus().isSuspended());
             answer.put("allowUseOriginalMessage", context.isAllowUseOriginalMessage());
             answer.put("messageHistory", context.isMessageHistory());

http://git-wip-us.apache.org/repos/asf/camel/blob/a2ad7d12/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/ContextInfoCommand.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/ContextInfoCommand.java
b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/ContextInfoCommand.java
index 6a7a954..66a7edc 100644
--- a/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/ContextInfoCommand.java
+++ b/platforms/commands/commands-core/src/main/java/org/apache/camel/commands/ContextInfoCommand.java
@@ -73,8 +73,6 @@ public class ContextInfoCommand extends AbstractCamelCommand {
 
         out.println("");
         out.println(stringEscape.unescapeJava("\u001B[1mMiscellaneous\u001B[0m"));
-        out.println(stringEscape.unescapeJava("\tAuto Startup: " + row.get("autoStartup")));
-        out.println(stringEscape.unescapeJava("\tStarting Routes: " + row.get("startingRoutes")));
         out.println(stringEscape.unescapeJava("\tSuspended: " + row.get("suspended")));
         out.println(stringEscape.unescapeJava("\tShutdown Timeout: " + row.get("shutdownTimeout")
+ " sec."));
         out.println(stringEscape.unescapeJava("\tAllow UseOriginalMessage: " + row.get("allowUseOriginalMessage")));

http://git-wip-us.apache.org/repos/asf/camel/blob/a2ad7d12/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java
b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java
index bce651b..b747e1b 100644
--- a/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java
+++ b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/DefaultJolokiaCamelController.java
@@ -22,6 +22,7 @@ import java.util.Comparator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.TimeUnit;
 import javax.management.ObjectName;
 
 import org.apache.camel.commands.AbstractCamelController;
@@ -110,6 +111,15 @@ public class DefaultJolokiaCamelController extends AbstractCamelController
imple
                     answer.put(asKey(key), rr.getValue(key));
                 }
             }
+
+            // store some data using special names as that is what the core-commands expects
+            answer.put("name", answer.get("camelId"));
+            answer.put("status", answer.get("state"));
+            answer.put("version", answer.get("camelVersion"));
+            answer.put("suspended", "Suspended".equals(answer.get("state")));
+            TimeUnit unit = TimeUnit.valueOf((String) answer.get("timeUnit"));
+            long timeout = (Long) answer.get("timeout");
+            answer.put("shutdownTimeout", "" + unit.toSeconds(timeout));
         }
 
         return answer;


Mime
View raw message