Repository: camel
Updated Branches:
  refs/heads/master 1b332e1f9 -> b3385d0d1


CAMEL-8251: eip model lets include a title which we later can improve or 
manually configured.


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

Branch: refs/heads/master
Commit: b3385d0d1a8dc3bdf97e95b9ce9e6e60079b85c0
Parents: 1b332e1
Author: Claus Ibsen <davscl...@apache.org>
Authored: Fri Jan 16 14:25:01 2015 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Fri Jan 16 14:25:01 2015 +0100

----------------------------------------------------------------------
 .../api/management/mbean/CamelOpenMBeanTypes.java     |  6 +++---
 .../camel/management/mbean/ManagedCamelContext.java   | 14 ++++----------
 .../org/apache/camel/util/CamelContextHelper.java     |  7 +++++++
 3 files changed, 14 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b3385d0d/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 dac1045..40c8625 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
@@ -116,9 +116,9 @@ public final class CamelOpenMBeanTypes {
     }
 
     public static CompositeType listEipsCompositeType() throws 
OpenDataException {
-        return new CompositeType("eips", "EIPs", new String[]{"name", 
"description", "label", "status", "type"},
-                new String[]{"Name", "Description", "Label", "Status", "Type"},
-                new OpenType[]{SimpleType.STRING, SimpleType.STRING, 
SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
+        return new CompositeType("eips", "EIPs", new String[]{"name", "title", 
"description", "label", "status", "type"},
+                new String[]{"Name", "Title", "Description", "Label", 
"Status", "Type"},
+                new OpenType[]{SimpleType.STRING, SimpleType.STRING, 
SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING});
     }
 
     public static TabularType listInflightExchangesTabularType() throws 
OpenDataException {

http://git-wip-us.apache.org/repos/asf/camel/blob/b3385d0d/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
index 599dae5..16f34cf 100644
--- 
a/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
+++ 
b/camel-core/src/main/java/org/apache/camel/management/mbean/ManagedCamelContext.java
@@ -458,14 +458,7 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
     }
 
     public Map<String, Properties> findEips() throws Exception {
-        Map<String, Properties> answer = context.findEips();
-        for (Map.Entry<String, Properties> entry : answer.entrySet()) {
-            if (entry.getValue() != null) {
-                // remove model as its not serializable over JMX
-                entry.getValue().remove("model");
-            }
-        }
-        return answer;
+        return context.findEips();
     }
 
     public List<String> findEipNames() throws Exception {
@@ -483,13 +476,14 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
             // gather EIP detail for each eip
             for (Map.Entry<String, Properties> entry : eips.entrySet()) {
                 String name = entry.getKey();
+                String title = (String) entry.getValue().get("title");
                 String description = (String) 
entry.getValue().get("description");
                 String label = (String) entry.getValue().get("label");
                 String type = (String) entry.getValue().get("class");
                 String status = CamelContextHelper.isEipInUse(context, name) ? 
"in use" : "on classpath";
                 CompositeType ct = CamelOpenMBeanTypes.listEipsCompositeType();
-                CompositeData data = new CompositeDataSupport(ct, new 
String[]{"name", "description", "label", "status", "type"},
-                        new Object[]{name, description, label, status, type});
+                CompositeData data = new CompositeDataSupport(ct, new 
String[]{"name", "title", "description", "label", "status", "type"},
+                        new Object[]{name, title, description, label, status, 
type});
                 answer.put(data);
             }
             return answer;

http://git-wip-us.apache.org/repos/asf/camel/blob/b3385d0d/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java 
b/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
index ce1432c..e3f7daa 100644
--- a/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/util/CamelContextHelper.java
@@ -495,6 +495,7 @@ public final class CamelContextHelper {
                     String description = null;
                     String label = null;
                     String javaType = null;
+                    String title = null;
 
                     // enrich with more meta-data
                     String json = camelContext.explainEipJson(line, false);
@@ -502,6 +503,9 @@ public final class CamelContextHelper {
                         List<Map<String, String>> rows = 
JsonSchemaHelper.parseJsonSchema("model", json, false);
 
                         for (Map<String, String> row : rows) {
+                            if (row.get("title") != null) {
+                                title = row.get("title");
+                            }
                             if (row.get("description") != null) {
                                 description = row.get("description");
                             }
@@ -514,6 +518,9 @@ public final class CamelContextHelper {
                         }
                     }
 
+                    if (title != null) {
+                        prop.put("title", title);
+                    }
                     if (description != null) {
                         prop.put("description", description);
                     }

Reply via email to