You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2014/12/12 12:12:01 UTC
[1/2] camel git commit: Fixed index was wrong/clash on the mbean open
type,
Repository: camel
Updated Branches:
refs/heads/master 0cd81204d -> 094936976
Fixed index was wrong/clash on the mbean open type,
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/353c6af6
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/353c6af6
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/353c6af6
Branch: refs/heads/master
Commit: 353c6af60c33b9b5e8b66b4fe09ad02cc8d8868c
Parents: 0cd8120
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 12 11:33:39 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 12 11:34:09 2014 +0100
----------------------------------------------------------------------
.../apache/camel/api/management/mbean/CamelOpenMBeanTypes.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/353c6af6/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
index f0fad68..5261b39 100644
--- a/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
+++ b/camel-core/src/main/java/org/apache/camel/api/management/mbean/CamelOpenMBeanTypes.java
@@ -61,7 +61,7 @@ public final class CamelOpenMBeanTypes {
}
public static CompositeType listEndpointsCompositeType() throws OpenDataException {
- return new CompositeType("url", "Endpoints", new String[]{"url"},
+ return new CompositeType("endpoints", "Endpoints", new String[]{"url"},
new String[]{"Url"},
new OpenType[]{SimpleType.STRING});
}
@@ -72,7 +72,7 @@ public final class CamelOpenMBeanTypes {
}
public static CompositeType explainEndpointsCompositeType() throws OpenDataException {
- return new CompositeType("endpoint", "Explain Endpoint", new String[]{"option", "kind", "type", "java type", "value", "default value", "description"},
+ return new CompositeType("endpoints", "Endpoints", new String[]{"option", "kind", "type", "java type", "value", "default value", "description"},
new String[]{"Option", "Kind", "Type", "Java Type", "Value", "Default Value", "Description"},
new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
}
@@ -83,7 +83,7 @@ public final class CamelOpenMBeanTypes {
}
public static CompositeType listComponentsCompositeType() throws OpenDataException {
- return new CompositeType("name", "Components", new String[]{"name", "description", "label", "status", "type", "groupId", "artifactId", "version"},
+ return new CompositeType("components", "Components", new String[]{"name", "description", "label", "status", "type", "groupId", "artifactId", "version"},
new String[]{"Name", "Description", "Label", "Status", "Type", "GroupId", "ArtifactId", "Version"},
new OpenType[]{SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
}
[2/2] camel git commit: CAMEL-8044: Camel commands useable for remote
JVMs using jolokia
Posted by da...@apache.org.
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/09493697
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/09493697
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/09493697
Branch: refs/heads/master
Commit: 094936976c7383f68bdae0ba194d69313ae192fe
Parents: 353c6af
Author: Claus Ibsen <da...@apache.org>
Authored: Fri Dec 12 11:33:59 2014 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Fri Dec 12 11:43:50 2014 +0100
----------------------------------------------------------------------
.../jolokia/JolokiaCamelController.java | 3 +-
.../commands/jolokia/NoopStringEscape.java | 37 +++++++++++++++
.../commands/jolokia/JolokiaCommandsTest.java | 50 ++++++++++++++++++++
3 files changed, 88 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/09493697/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/JolokiaCamelController.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/JolokiaCamelController.java b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/JolokiaCamelController.java
index 3e7b251..43dc921 100644
--- a/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/JolokiaCamelController.java
+++ b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/JolokiaCamelController.java
@@ -499,8 +499,7 @@ public class JolokiaCamelController extends AbstractCamelController implements R
if (response != null) {
JSONObject data = response.getValue();
for (Object obj : data.values()) {
- JSONObject data2 = (JSONObject) obj;
- JSONObject component = (JSONObject) data2.values().iterator().next();
+ JSONObject component = (JSONObject) obj;
Map<String, String> row = new LinkedHashMap<String, String>();
row.put("artifactId", asString(component.get("artifactId")));
http://git-wip-us.apache.org/repos/asf/camel/blob/09493697/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/NoopStringEscape.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/NoopStringEscape.java b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/NoopStringEscape.java
new file mode 100644
index 0000000..d1cdd39
--- /dev/null
+++ b/platforms/commands/commands-jolokia/src/main/java/org/apache/camel/commands/jolokia/NoopStringEscape.java
@@ -0,0 +1,37 @@
+/**
+ * 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.camel.commands.jolokia;
+
+import org.apache.camel.commands.StringEscape;
+
+public class NoopStringEscape implements StringEscape {
+
+ @Override
+ public String unescapeJava(String s) {
+ return s;
+ }
+
+ @Override
+ public String escapeJava(String s) {
+ return s;
+ }
+
+ @Override
+ public String hex(char c) {
+ return Character.toString(c);
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/09493697/platforms/commands/commands-jolokia/src/test/java/org/apache/camel/commands/jolokia/JolokiaCommandsTest.java
----------------------------------------------------------------------
diff --git a/platforms/commands/commands-jolokia/src/test/java/org/apache/camel/commands/jolokia/JolokiaCommandsTest.java b/platforms/commands/commands-jolokia/src/test/java/org/apache/camel/commands/jolokia/JolokiaCommandsTest.java
new file mode 100644
index 0000000..e5f9fb1
--- /dev/null
+++ b/platforms/commands/commands-jolokia/src/test/java/org/apache/camel/commands/jolokia/JolokiaCommandsTest.java
@@ -0,0 +1,50 @@
+/**
+ * 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.camel.commands.jolokia;
+
+import org.apache.camel.commands.ContextInfoCommand;
+import org.apache.camel.commands.ContextListCommand;
+import org.junit.Ignore;
+import org.junit.Test;
+
+@Ignore("used for manual testing")
+public class JolokiaCommandsTest {
+
+ private String url = "http://localhost:8080/jolokia";
+
+ private RemoteCamelController controller;
+
+ @Test
+ public void testContextList() throws Exception {
+ controller = new JolokiaCamelController();
+ controller.connect(url, null, null);
+
+ ContextListCommand cmd = new ContextListCommand();
+ cmd.execute(controller, System.out, System.err);
+ }
+
+ @Test
+ public void testContextInfo() throws Exception {
+ controller = new JolokiaCamelController();
+ controller.connect(url, null, null);
+
+ ContextInfoCommand cmd = new ContextInfoCommand("myCamel", true);
+ cmd.setStringEscape(new NoopStringEscape());
+ cmd.execute(controller, System.out, System.err);
+ }
+
+}