CAMEL-7999: Add label to @UriEndpoint so we can group endpoints.

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

Branch: refs/heads/master
Commit: 0dac21ecdd88db0d9371971d9a5e90c1bed7f715
Parents: 636cbb5
Author: Claus Ibsen <davscl...@apache.org>
Authored: Fri Nov 14 10:10:08 2014 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Fri Nov 14 13:02:05 2014 +0100

----------------------------------------------------------------------
 .../camel/api/management/mbean/CamelOpenMBeanTypes.java |  8 ++++----
 .../api/management/mbean/ManagedCamelContextMBean.java  |  2 +-
 .../apache/camel/component/direct/DirectEndpoint.java   |  2 +-
 .../camel/management/mbean/ManagedCamelContext.java     | 12 +++++-------
 4 files changed, 11 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/0dac21ec/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 5e3160c..79de7a3 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
@@ -77,13 +77,13 @@ public final class CamelOpenMBeanTypes {
 
     public static TabularType listComponentsTabularType() throws 
OpenDataException {
         CompositeType ct = listComponentsCompositeType();
-        return new TabularType("listComponents", "Lists all the components", 
ct, new String[]{"name", "description", "status", "type", "groupId", 
"artifactId", "version"});
+        return new TabularType("listComponents", "Lists all the components", 
ct, new String[]{"name", "description", "label", "status", "type", "groupId", 
"artifactId", "version"});
     }
 
     public static CompositeType listComponentsCompositeType() throws 
OpenDataException {
-        return new CompositeType("name", "Components", new String[]{"name", 
"description", "status", "type", "groupId", "artifactId", "version"},
-                new String[]{"Name", "Description", "Status", "Type", 
"GroupId", "ArtifactId", "Version"},
-                new OpenType[]{SimpleType.STRING, SimpleType.STRING, 
SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, SimpleType.STRING, 
SimpleType.STRING});
+        return new CompositeType("name", "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});
     }
 
 

http://git-wip-us.apache.org/repos/asf/camel/blob/0dac21ec/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
index e82dcac..7105fb5 100644
--- 
a/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
+++ 
b/camel-core/src/main/java/org/apache/camel/api/management/mbean/ManagedCamelContextMBean.java
@@ -233,7 +233,7 @@ public interface ManagedCamelContextMBean extends 
ManagedPerformanceCounterMBean
     TabularData listComponents() throws Exception;
 
     /**
-     * Returns the JSON schema representation of the endpoint parameters for 
the given component name
+     * Returns the JSON schema representation with information about the 
component and the endpoint parameters it supports
      *
      * @param componentName the name of the component to lookup
      * @throws Exception is thrown if error occurred

http://git-wip-us.apache.org/repos/asf/camel/blob/0dac21ec/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
----------------------------------------------------------------------
diff --git 
a/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
 
b/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
index 8075b7d..f393d83 100644
--- 
a/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
+++ 
b/camel-core/src/main/java/org/apache/camel/component/direct/DirectEndpoint.java
@@ -35,7 +35,7 @@ import org.apache.camel.util.ObjectHelper;
  *
  * @version 
  */
-@UriEndpoint(scheme = "direct", consumerClass = DirectConsumer.class, 
label="core,java,endpoint")
+@UriEndpoint(scheme = "direct", consumerClass = DirectConsumer.class, 
label="core,endpoint")
 public class DirectEndpoint extends DefaultEndpoint {
 
     @UriPath(description = "Name of direct endpoint")

http://git-wip-us.apache.org/repos/asf/camel/blob/0dac21ec/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 6a9cefa..69593eb 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
@@ -494,11 +494,7 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
             for (Map.Entry<String, Properties> entry : components.entrySet()) {
                 String name = entry.getKey();
                 String description = null;
-                // the status can be:
-                // - in use = used by Camel
-                // - classpath = on the classpath
-                // - release = available from the Apache Camel release
-                // TODO: gather list of components in the Camel release
+                String label = null;
                 String status = context.hasComponent(name) != null ? "in use" 
: "on classpath";
                 String type = (String) entry.getValue().get("class");
                 String groupId = null;
@@ -516,6 +512,8 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
                 for (Map<String, String> row : rows) {
                     if (row.containsKey("description")) {
                         description = row.get("description");
+                    } else if (row.containsKey("label")) {
+                        label = row.get("label");
                     } else if (row.containsKey("javaType")) {
                         type = row.get("javaType");
                     } else if (row.containsKey("groupId")) {
@@ -528,8 +526,8 @@ public class ManagedCamelContext extends 
ManagedPerformanceCounter implements Ti
                 }
 
                 CompositeType ct = 
CamelOpenMBeanTypes.listComponentsCompositeType();
-                CompositeData data = new CompositeDataSupport(ct, new 
String[]{"name", "description", "status", "type", "groupId", "artifactId", 
"version"},
-                        new Object[]{name, description, status, type, groupId, 
artifactId, version});
+                CompositeData data = new CompositeDataSupport(ct, new 
String[]{"name", "description", "label", "status", "type", "groupId", 
"artifactId", "version"},
+                        new Object[]{name, description, label, status, type, 
groupId, artifactId, version});
                 answer.put(data);
             }
             return answer;

Reply via email to