You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by dh...@apache.org on 2014/06/18 07:50:56 UTC
[6/6] git commit: Moved sample APIs to api package,
added bnd instructions in archetype
Moved sample APIs to api package, added bnd instructions in archetype
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ef4d0a7e
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ef4d0a7e
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ef4d0a7e
Branch: refs/heads/master
Commit: ef4d0a7ec43f4c702c75aafc3c6cba72ff9b9281
Parents: 7dc2bb1
Author: Dhiraj Bokde <dh...@yahoo.com>
Authored: Tue Jun 17 15:01:04 2014 -0700
Committer: Dhiraj Bokde <dh...@yahoo.com>
Committed: Tue Jun 17 15:01:04 2014 -0700
----------------------------------------------------------------------
.../src/main/java/__name__FileHello.java | 35 --------------------
.../src/main/java/__name__JavadocHello.java | 35 --------------------
.../src/main/java/api/__name__FileHello.java | 35 ++++++++++++++++++++
.../src/main/java/api/__name__JavadocHello.java | 35 ++++++++++++++++++++
.../__artifactId__-component/pom.xml | 23 ++++++++++---
.../src/main/java/__name__Endpoint.java | 2 ++
6 files changed, 90 insertions(+), 75 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileHello.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileHello.java b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileHello.java
deleted file mode 100644
index 071e281..0000000
--- a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileHello.java
+++ /dev/null
@@ -1,35 +0,0 @@
-## ------------------------------------------------------------------------
-## 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 ${package};
-
-/**
- * Sample API used by ${name} Component whose method signatures are read from File.
- */
-public class ${name}FileHello {
-
- public String sayHi() {
- return "Hello!";
- }
-
- public String greetMe(String name) {
- return "Hello " + name;
- }
-
- public String greetUs(String name1, String name2) {
- return "Hello " + name1 + ", " + name2;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__JavadocHello.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__JavadocHello.java b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__JavadocHello.java
deleted file mode 100644
index 39430f2..0000000
--- a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__JavadocHello.java
+++ /dev/null
@@ -1,35 +0,0 @@
-## ------------------------------------------------------------------------
-## 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 ${package};
-
-/**
- * Sample API used by ${name} Component whose method signatures are read from Javadoc.
- */
-public class ${name}JavadocHello {
-
- public String sayHi() {
- return "Hello!";
- }
-
- public String greetMe(String name) {
- return "Hello " + name;
- }
-
- public String greetUs(String name1, String name2) {
- return "Hello " + name1 + ", " + name2;
- }
-}
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__FileHello.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__FileHello.java b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__FileHello.java
new file mode 100644
index 0000000..8f509df
--- /dev/null
+++ b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__FileHello.java
@@ -0,0 +1,35 @@
+## ------------------------------------------------------------------------
+## 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 ${package}.api;
+
+/**
+ * Sample API used by ${name} Component whose method signatures are read from File.
+ */
+public class ${name}FileHello {
+
+ public String sayHi() {
+ return "Hello!";
+ }
+
+ public String greetMe(String name) {
+ return "Hello " + name;
+ }
+
+ public String greetUs(String name1, String name2) {
+ return "Hello " + name1 + ", " + name2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__JavadocHello.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__JavadocHello.java b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__JavadocHello.java
new file mode 100644
index 0000000..0b983a0
--- /dev/null
+++ b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/api/__name__JavadocHello.java
@@ -0,0 +1,35 @@
+## ------------------------------------------------------------------------
+## 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 ${package}.api;
+
+/**
+ * Sample API used by ${name} Component whose method signatures are read from Javadoc.
+ */
+public class ${name}JavadocHello {
+
+ public String sayHi() {
+ return "Hello!";
+ }
+
+ public String greetMe(String name) {
+ return "Hello " + name;
+ }
+
+ public String greetUs(String name1, String name2) {
+ return "Hello " + name1 + ", " + name2;
+ }
+}
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
index 1f676e8..add5147 100644
--- a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
+++ b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/pom.xml
@@ -128,8 +128,21 @@
<extensions>true</extensions>
<configuration>
<instructions>
+ <Bundle-Name>Camel Component for ${componentName}</Bundle-Name>
<Bundle-SymbolicName>${groupId}.${artifactId}</Bundle-SymbolicName>
- <Export-Service>org.apache.camel.spi.ComponentResolver;component=${scheme}</Export-Service>
+ <Export-Service>org.apache.camel.spi.ComponentResolver;component=${schemeName}</Export-Service>
+ <Export-Package>${componentPackage};version=${project.version}</Export-Package>
+ <Import-Package>
+ ${componentPackage}.api;version=${project.version},
+ ${componentPackage};version=${project.version},
+ org.apache.camel.*;version=${camel-version}
+ </Import-Package>
+ <Private-Package>${outPackage}</Private-Package>
+ <Implementation-Title>Apache Camel</Implementation-Title>
+ <Implementation-Version>${project.version}</Implementation-Version>
+ <Karaf-Info>Camel;${project.artifactId}=${project.version}</Karaf-Info>
+ <_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+ <_failok>false</_failok>
</instructions>
</configuration>
</plugin>
@@ -146,7 +159,7 @@
<goal>fromFile</goal>
</goals>
<configuration>
- <proxyClass>${package}.${name}FileHello</proxyClass>
+ <proxyClass>${package}.api.${name}FileHello</proxyClass>
<!-- Use substitutions to manipulate parameter names and avoid name clashes
<substitutions>
<substitution>
@@ -167,7 +180,7 @@
<goal>fromJavadoc</goal>
</goals>
<configuration>
- <proxyClass>${package}.${name}JavadocHello</proxyClass>
+ <proxyClass>${package}.api.${name}JavadocHello</proxyClass>
<!-- Use substitutions to manipulate parameter names and avoid name clashes
<substitutions>
<substitution>
@@ -195,7 +208,7 @@
<apis>
<api>
<apiName>hello-file</apiName>
- <proxyClass>${package}.${name}FileHello</proxyClass>
+ <proxyClass>${package}.api.${name}FileHello</proxyClass>
<!-- Use method aliases in endpoint URIs, e.g. support 'widget' as alias for getWidget or setWidget
<aliases>
<alias>
@@ -211,7 +224,7 @@
</api>
<api>
<apiName>hello-javadoc</apiName>
- <proxyClass>${package}.${name}JavadocHello</proxyClass>
+ <proxyClass>${package}.api.${name}JavadocHello</proxyClass>
</api>
</apis>
</configuration>
http://git-wip-us.apache.org/repos/asf/camel/blob/ef4d0a7e/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Endpoint.java
----------------------------------------------------------------------
diff --git a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Endpoint.java b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Endpoint.java
index aaed38f..dec1ba3 100644
--- a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Endpoint.java
+++ b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Endpoint.java
@@ -23,6 +23,8 @@ import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.util.component.AbstractApiEndpoint;
import org.apache.camel.util.component.ApiMethodPropertiesHelper;
+import ${package}.api.${name}FileHello;
+import ${package}.api.${name}JavadocHello;
import ${package}.internal.${name}ApiCollection;
import ${package}.internal.${name}ApiName;
import ${package}.internal.${name}PropertiesHelper;