camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/2] camel git commit: CAMEL-8220 camel-archetype-component - Should be component doc ready
Date Wed, 14 Jan 2015 10:42:32 GMT
Repository: camel
Updated Branches:
  refs/heads/master c106e0279 -> 68c39f77d


CAMEL-8220 camel-archetype-component - Should be component doc ready


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

Branch: refs/heads/master
Commit: 68c39f77dba7b202c97c4652ca5757322cf8454a
Parents: 67bcf32
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Jan 14 18:41:47 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Jan 14 18:42:12 2015 +0800

----------------------------------------------------------------------
 .../src/main/resources/archetype-resources/pom.xml    |  7 +++++++
 .../src/main/java/__name__Component.java              | 14 ++++++++++++--
 .../src/main/java/__name__Endpoint.java               |  5 +++++
 3 files changed, 24 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/68c39f77/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
index 60182d2..eae7042 100644
--- a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
+++ b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/pom.xml
@@ -38,6 +38,13 @@
       <artifactId>camel-core</artifactId>
       <version>${camel-version}</version>
     </dependency>
+    
+    <!-- support camel documentation -->
+    <dependency>
+      <groupId>org.apache.camel</groupId>
+      <artifactId>apt</artifactId>
+      <version>${camel-version}</version>
+    </dependency>
 
     <!-- logging -->
     <dependency>

http://git-wip-us.apache.org/repos/asf/camel/blob/68c39f77/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Component.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Component.java
b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Component.java
index a87f1f4..41ff044 100644
--- a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Component.java
+++ b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Component.java
@@ -18,13 +18,23 @@ package ${package};
 
 import java.util.Map;
 
+import org.apache.camel.CamelContext;
 import org.apache.camel.Endpoint;
-import org.apache.camel.impl.DefaultComponent;
+
+import org.apache.camel.impl.UriEndpointComponent;
 
 /**
  * Represents the component that manages {@link ${name}Endpoint}.
  */
-public class ${name}Component extends DefaultComponent {
+public class ${name}Component extends UriEndpointComponent {
+    
+    public ${name}Component() {
+        super(${name}Endpoint.class);
+    }
+
+    public ${name}Component(CamelContext context) {
+        super(context, ${name}Endpoint.class);
+    }
 
     protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object>
parameters) throws Exception {
         Endpoint endpoint = new ${name}Endpoint(uri, this);

http://git-wip-us.apache.org/repos/asf/camel/blob/68c39f77/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Endpoint.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Endpoint.java
b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Endpoint.java
index 9c25c8e..227aeb4 100644
--- a/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Endpoint.java
+++ b/tooling/archetypes/camel-archetype-component/src/main/resources/archetype-resources/src/main/java/__name__Endpoint.java
@@ -20,11 +20,16 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 
 /**
  * Represents a ${name} endpoint.
  */
+@UriEndpoint(scheme = "${scheme}", consumerClass = ${name}Consumer.class, label = "${name}")
 public class ${name}Endpoint extends DefaultEndpoint {
+    @UriParam(defaultValue = "10")
+    private int option1 = 10;
 
     public ${name}Endpoint() {
     }


Mime
View raw message