[1/2] git commit: CAMEL-7380 Added test support for Spring ContextHierarchy

2014-06-10 Thread ningjiang
Repository: camel
Updated Branches:
  refs/heads/master 0c9fbb62b -> aa9e4ce5e


CAMEL-7380 Added test support for Spring ContextHierarchy


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

Branch: refs/heads/master
Commit: b4bb8fa2da0625077d2118de311333ffddd29676
Parents: 0c9fbb6
Author: Willem Jiang 
Authored: Wed Jun 11 12:09:45 2014 +0800
Committer: Willem Jiang 
Committed: Wed Jun 11 12:09:45 2014 +0800

--
 .../spring/CamelSpringTestContextLoader.java| 24 
 1 file changed, 19 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/b4bb8fa2/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
--
diff --git 
a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
 
b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
index 18fa9c3..e973b44 100644
--- 
a/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
+++ 
b/components/camel-test-spring/src/main/java/org/apache/camel/test/spring/CamelSpringTestContextLoader.java
@@ -79,7 +79,7 @@ public class CamelSpringTestContextLoader extends 
AbstractContextLoader {
 }
 
 try {
-GenericApplicationContext context = createContext(testClass);
+GenericApplicationContext context = createContext(testClass, 
mergedConfig);
 
context.getEnvironment().setActiveProfiles(mergedConfig.getActiveProfiles());
 loadBeanDefinitions(context, mergedConfig);
 return loadContext(context, testClass);
@@ -111,7 +111,7 @@ public class CamelSpringTestContextLoader extends 
AbstractContextLoader {
 }
 
 try {
-GenericApplicationContext context = createContext(testClass);
+GenericApplicationContext context = createContext(testClass, null);
 loadBeanDefinitions(context, locations);
 return loadContext(context, testClass);
 } finally {
@@ -196,9 +196,15 @@ public class CamelSpringTestContextLoader extends 
AbstractContextLoader {
  * @param testClass the test class that is being executed
  * @return the loaded Spring context
  */
-protected GenericApplicationContext createContext(Class testClass) {
+protected GenericApplicationContext createContext(Class testClass, 
MergedContextConfiguration mergedConfig) {
+ApplicationContext parentContext = null;
 GenericApplicationContext routeExcludingContext = null;
 
+if (mergedConfig != null) {
+parentContext = mergedConfig.getParentApplicationContext();
+
+}
+
 if (testClass.isAnnotationPresent(ExcludeRoutes.class)) {
 Class[] excludedClasses = 
testClass.getAnnotation(ExcludeRoutes.class).value();
 
@@ -208,7 +214,11 @@ public class CamelSpringTestContextLoader extends 
AbstractContextLoader {
 + "annotation was found. Excluding [" + 
StringUtils.arrayToCommaDelimitedString(excludedClasses) + "].");
 }
 
-routeExcludingContext = new GenericApplicationContext();
+if (parentContext == null) {
+routeExcludingContext = new GenericApplicationContext();
+} else {
+routeExcludingContext = new 
GenericApplicationContext(parentContext);
+}
 
routeExcludingContext.registerBeanDefinition("excludingResolver", new 
RootBeanDefinition(ExcludingPackageScanClassResolver.class));
 routeExcludingContext.refresh();
 
@@ -228,7 +238,11 @@ public class CamelSpringTestContextLoader extends 
AbstractContextLoader {
 if (routeExcludingContext != null) {
 context = new GenericApplicationContext(routeExcludingContext);
 } else {
-context = new GenericApplicationContext();
+if (parentContext != null) {
+context = new GenericApplicationContext(parentContext);
+} else {
+context = new GenericApplicationContext();
+}
 }
 
 return context;



[2/2] git commit: Changed the spring version range to support spring4

2014-06-10 Thread ningjiang
Changed the spring version range to support spring4


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

Branch: refs/heads/master
Commit: aa9e4ce5ef3df5c5ddefb4fed5dd9fa81b6a92b6
Parents: b4bb8fa
Author: Willem Jiang 
Authored: Wed Jun 11 12:14:24 2014 +0800
Committer: Willem Jiang 
Committed: Wed Jun 11 12:14:24 2014 +0800

--
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/aa9e4ce5/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 8acc316..2f33d88 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -382,7 +382,7 @@
 1.3.1.RELEASE
 1.3.1.RELEASE_2
 1.0.3.RELEASE  
-[3.2,4)
+[3.2,5)
 ${spring32-version}   
 3.2.9.RELEASE
 4.0.5.RELEASE



[22/35] git commit: Updated archetype files to first real implementation

2014-06-10 Thread dhirajsb
Updated archetype files to first real implementation


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

Branch: refs/heads/master
Commit: 911e541323c16386371faedeb0a55f35b7ed3e9b
Parents: 96c8ec0
Author: Dhiraj Bokde 
Authored: Wed Jun 4 13:55:36 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:33 2014 -0700

--
 .../META-INF/maven/archetype-metadata.xml   |   3 +
 .../__artifactId__-api/pom.xml  |   8 +
 .../__artifactId__-component/pom.xml|  12 ++
 .../src/main/java/__name__Component.java|  76 -
 .../src/main/java/__name__Configuration.java|  28 
 .../src/main/java/__name__Consumer.java | 119 +-
 .../src/main/java/__name__Endpoint.java | 160 ++-
 .../src/main/java/__name__Producer.java | 155 +-
 .../main/java/internal/__name__Constants.java   |  29 
 .../java/internal/__name__PropertiesHelper.java |  40 +
 10 files changed, 609 insertions(+), 21 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/911e5413/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
index 96b096c..f597ef5 100644
--- 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
@@ -37,6 +37,9 @@
 
   ${maven-bundle-plugin-version}
 
+
+  ${maven-javadoc-plugin-version}
+
 
   ${build-helper-maven-plugin-version}
 

http://git-wip-us.apache.org/repos/asf/camel/blob/911e5413/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
index 632a897..c4af2c8 100644
--- 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/pom.xml
@@ -50,6 +50,14 @@
 
   jar
 
+
+  true
+  1.6
+  true
+  false
+  1.6
+  UTF-8
+
   
 
   

http://git-wip-us.apache.org/repos/asf/camel/blob/911e5413/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 f724e37..af32397 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
@@ -197,6 +197,18 @@
 
   hello1
   ${package}.${name}FileSigApi
+  
 
 
   hello2

http://git-wip-us.apache.org/repos/asf/camel/blob/911e5413/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
index a87f1f4..7226fef 100644
--- 
a/tooling/archetypes/camel-archetype-api-compon

[07/35] git commit: Fixed array argument handling

2014-06-10 Thread dhirajsb
Fixed array argument handling


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

Branch: refs/heads/master
Commit: 0932ed48a947ae607b1d7572888531702dc8fb4e
Parents: 03f63df
Author: Dhiraj Bokde 
Authored: Wed May 28 14:18:17 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:30 2014 -0700

--
 .../camel/util/component/ApiMethodHelper.java | 18 ++
 1 file changed, 10 insertions(+), 8 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0932ed48/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
index 9f250f0..dbbc332 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
@@ -128,7 +128,7 @@ public final class ApiMethodHelper & 
ApiMethod> {
 // also collect argument names for all methods, and detect 
clashes here
 final Class previousType = VALID_ARGUMENTS.get(argName);
 if (previousType != null && previousType != argType) {
-throw new ExceptionInInitializerError(String.format(
+throw new IllegalArgumentException(String.format(
 "Argument %s has ambiguous types (%s, %s) across 
methods!",
 name, previousType, argType));
 } else if (previousType == null) {
@@ -334,14 +334,16 @@ public final class ApiMethodHelper & 
ApiMethod> {
 }
 value = array;
 } else if (value.getClass().isArray()
-&& 
type.getComponentType().isAssignableFrom(value.getClass().getComponentType())) {
-// convert derived array to super array
-final int size = Array.getLength(value);
-Object array = Array.newInstance(type.getComponentType(), 
size);
-for (int i = 0; i < size; i++) {
-Array.set(array, i, Array.get(value, i));
+&& 
type.getComponentType().isAssignableFrom(value.getClass().getComponentType())) {
+// convert derived array to super array if needed
+if (type.getComponentType() != 
value.getClass().getComponentType()) {
+final int size = Array.getLength(value);
+Object array = 
Array.newInstance(type.getComponentType(), size);
+for (int i = 0; i < size; i++) {
+Array.set(array, i, Array.get(value, i));
+}
+value = array;
 }
-value = array;
 } else {
 throw new IllegalArgumentException(
 String.format("Cannot convert %s to %s", 
value.getClass(), type));



[25/35] git commit: Fixed formatting

2014-06-10 Thread dhirajsb
Fixed formatting


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

Branch: refs/heads/master
Commit: bbb4127a977ac0f8eb537368bd134401a1d9009c
Parents: 161b216
Author: Dhiraj Bokde 
Authored: Wed Jun 4 19:39:18 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../src/main/resources/api-route-test.vm   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/bbb4127a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
index e53331f..78d6301 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
@@ -69,7 +69,7 @@ public class ${testName} extends CamelTestSupport {
 #end
 #end
 ## method invocation result
-#if ( !$voidResult )#set ( $type = 
$helper.getResultDeclaration($resultType) ) $type result = (${type})#end
+#if ( !$voidResult )#set ( $type = 
$helper.getResultDeclaration($resultType) )$type result = (${type})#end
 ## actual template call
 #if ( $args.isEmpty() )
 template().requestBody("direct://${model.UniqueName}", (Object)null);



[04/35] git commit: Fixed substitution order in ArgumentSubstitutionParser

2014-06-10 Thread dhirajsb
Fixed substitution order in ArgumentSubstitutionParser


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

Branch: refs/heads/master
Commit: 2ffeacc0217a21a4c883e367f58a8a709219cf79
Parents: 10a0b61
Author: Dhiraj Bokde 
Authored: Fri May 23 17:47:51 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:29 2014 -0700

--
 .../camel/util/component/ArgumentSubstitutionParser.java| 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/2ffeacc0/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
index 06ab253..0e15833 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
@@ -1,7 +1,6 @@
 package org.apache.camel.util.component;
 
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -13,7 +12,7 @@ import java.util.regex.Pattern;
  */
 public class ArgumentSubstitutionParser extends ApiMethodParser {
 
-private final HashMap>> 
methodMap;
+private final Map>> methodMap;
 
 /**
  * Create a parser using regular expressions to adapt parameter names.
@@ -22,7 +21,7 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
  */
 public ArgumentSubstitutionParser(Class proxyType, Substitution[] 
substitutions) {
 super(proxyType);
-Map>> regexMap = new 
HashMap>>();
+Map>> regexMap = new 
LinkedHashMap>>();
 
 for (Substitution tuple : substitutions) {
 tuple.validate();
@@ -35,7 +34,7 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 
 Map> replacementMap = 
regexMap.get(tuple.method);
 if (replacementMap == null) {
-replacementMap = new HashMap>();
+replacementMap = new LinkedHashMap>();
 regexMap.put(tuple.method, replacementMap);
 }
 List replacements = 
replacementMap.get(tuple.argName);
@@ -85,7 +84,7 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 updatedArguments.add(argument);
 }
 
-model = new ApiMethodModel(model.getName(), 
model.getUniqueName(), model.getResultType(),
+model = new ApiMethodModel(model.getUniqueName(), 
model.getName(), model.getResultType(),
 updatedArguments, model.getMethod());
 }
 }



[09/35] git commit: Added generated source validation, refactored package_path in unit tests

2014-06-10 Thread dhirajsb
Added generated source validation, refactored package_path in unit tests


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

Branch: refs/heads/master
Commit: 03f63df8c6b3994e8a157e9545f56f5baec53607
Parents: ecee7f1
Author: Dhiraj Bokde 
Authored: Mon May 26 06:04:01 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:30 2014 -0700

--
 .../camel-component-util-maven-plugin/pom.xml   | 34 
 .../camel/maven/AbstractGeneratorMojoTest.java  |  2 +-
 .../maven/ApiComponentGeneratorMojoTest.java|  2 +-
 .../maven/FileApiMethodGeneratorMojoTest.java   |  2 +-
 .../JavadocApiMethodGeneratorMojoTest.java  |  3 +-
 5 files changed, 38 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/03f63df8/tooling/maven/camel-component-util-maven-plugin/pom.xml
--
diff --git a/tooling/maven/camel-component-util-maven-plugin/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/pom.xml
index 350cd08..90a9aea 100644
--- a/tooling/maven/camel-component-util-maven-plugin/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/pom.xml
@@ -121,6 +121,40 @@
   
   
 
+
+  
+  
+org.codehaus.mojo
+build-helper-maven-plugin
+
+  
+add-generated-test-sources
+verify
+
+  add-test-source
+
+
+  
+
${project.build.directory}/generated-test-sources/camelComponent
+  
+
+  
+
+  
+  
+org.apache.maven.plugins
+maven-compiler-plugin
+
+  
+validate-generated-test-sources
+verify
+
+  testCompile
+
+  
+
+  
+
   
 
 

http://git-wip-us.apache.org/repos/asf/camel/blob/03f63df8/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
index eaaf704..07edb41 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
@@ -27,7 +27,7 @@ import static org.junit.Assert.assertTrue;
  */
 public class AbstractGeneratorMojoTest {
 protected static final String OUT_DIR = 
"target/generated-test-sources/camelComponent";
-protected static final String PACKAGE_PATH = 
AbstractGeneratorMojo.OUT_PACKAGE.replaceAll("\\.", "/");
+protected static final String PACKAGE_PATH = 
AbstractGeneratorMojo.OUT_PACKAGE.replaceAll("\\.", "/") + "/";
 
 protected void assertExists(File outFile) {
 assertTrue("Generated file not found " + outFile.getPath(), 
outFile.exists());

http://git-wip-us.apache.org/repos/asf/camel/blob/03f63df8/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
index 3176755..b0f8168 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/ApiComponentGeneratorMojoTest.java
@@ -41,7 +41,7 @@ public class ApiComponentGeneratorMojoTest extends 
AbstractGeneratorMojoTest {
 final File outDir = new File(OUT_DIR);
 FileUtil.removeDir(outDir);
 
-final File collectionFile = new File(OUT_DIR, PACKAGE_PATH + "/" + 
COMPONENT_NAME + "ApiCollection.java");
+final File collectionFile = new File(OUT_DIR, PACKAGE_PATH + 
COMPONENT_NAME + "ApiCollection.java");
 
 final ApiComponentGeneratorMojo mojo = new ApiComponentGeneratorMojo();
 mojo.componentName = COMPONENT_NAME;

http://git-wip-us.apache.org/repos/asf/camel/blob/03f63df8/tooling/maven/camel-component-util-mav

[10/35] git commit: Removed author name

2014-06-10 Thread dhirajsb
Removed author name


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

Branch: refs/heads/master
Commit: 0f67b18d89a5566f6ca7cd3cc4752d5007a27ceb
Parents: e47e53c
Author: Dhiraj Bokde 
Authored: Wed May 28 14:24:51 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../java/org/apache/camel/maven/AbstractGeneratorMojoTest.java   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0f67b18d/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
index 07edb41..0e781d8 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/AbstractGeneratorMojoTest.java
@@ -21,9 +21,7 @@ import java.io.File;
 import static org.junit.Assert.assertTrue;
 
 /**
- * User: dbokde
- * Date: 5/26/14
- * Time: 4:49 AM
+ * Base class for Generator MOJO tests.
  */
 public class AbstractGeneratorMojoTest {
 protected static final String OUT_DIR = 
"target/generated-test-sources/camelComponent";



[20/35] git commit: Added support for generating endpoint config using component-util plugin, added integration tests, refactored unit tests, cleaned-up generated code

2014-06-10 Thread dhirajsb
Added support for generating endpoint config using component-util plugin, added 
integration tests, refactored unit tests, cleaned-up generated code


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

Branch: refs/heads/master
Commit: fad48654b42248ddbd1125afc43a6e8b82bd0af9
Parents: 24e196b
Author: Dhiraj Bokde 
Authored: Fri May 30 12:48:09 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:32 2014 -0700

--
 .../camel-component-util-maven-plugin/pom.xml   |  76 +++-
 .../src/it/all-it/pom.xml   | 178 +++
 .../src/it/all-it/verify.groovy |  22 +++
 .../src/it/settings.xml |  55 ++
 .../maven/AbstractApiMethodGeneratorMojo.java   |  64 ++-
 .../camel/maven/AbstractGeneratorMojo.java  |  18 +-
 .../java/org/apache/camel/maven/ApiProxy.java   |   8 +
 .../maven/JavadocApiMethodGeneratorMojo.java|  23 ++-
 .../org/apache/camel/maven/Substitution.java|   3 +
 .../src/main/resources/api-collection.vm|   2 +-
 .../src/main/resources/api-endpoint-config.vm   |  47 +
 .../src/main/resources/api-method-enum.vm   |   1 +
 .../src/main/resources/api-route-test.vm|  16 +-
 .../apache/camel/component/test/TestConfig.java |  23 +++
 .../apache/camel/component/test/TestProxy.java  |  68 +++
 .../camel/maven/AbstractGeneratorMojoTest.java  |  15 +-
 .../maven/ApiComponentGeneratorMojoTest.java|  15 +-
 .../maven/FileApiMethodGeneratorMojoTest.java   |   1 +
 .../JavadocApiMethodGeneratorMojoTest.java  |   3 +-
 .../java/org/apache/camel/maven/TestProxy.java  |  64 ---
 .../test/resources/test-proxy-signatures.txt|   1 +
 21 files changed, 592 insertions(+), 111 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/pom.xml
--
diff --git a/tooling/maven/camel-component-util-maven-plugin/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/pom.xml
index ffda9c4..ed197ac 100644
--- a/tooling/maven/camel-component-util-maven-plugin/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/pom.xml
@@ -60,13 +60,6 @@
   velocity
   ${velocity-version}
 
-
 
 
 
@@ -127,6 +120,30 @@
   
 
 
+  
+  
+org.apache.maven.plugins
+maven-resources-plugin
+
+  
+copy-it-resources
+generate-test-sources
+
+  copy-resources
+
+
+  UTF-8
+  true
+  
${project.build.directory}/it/all-it/src/main/java/org/apache/camel/component/test
+  
+
+  
src/test/java/org/apache/camel/component/test
+
+  
+
+  
+
+  
   
   
 org.codehaus.mojo
@@ -140,7 +157,7 @@
 
 
   
-
${project.build.directory}/generated-test-sources/camelComponent
+
${project.build.directory}/generated-test-sources/camel-component
   
 
   
@@ -156,10 +173,53 @@
 
   testCompile
 
+
+  false
+
   
 
   
 
   
 
+  
+  
+
+  plugin-itest
+  
+
+  
+org.apache.maven.plugins
+maven-invoker-plugin
+1.8
+
+  true
+  ${project.build.directory}/it
+  
+*/pom.xml
+  
+  verify
+  
${project.build.directory}/local-repo
+  src/it/settings.xml
+  
+clean
+verify
+  
+
+
+  
+integration-test
+
+  install
+  integration-test
+  verify
+
+  
+
+  
+
+
+  
+
+  
 

http://git-wip-us.apache.org/repos/asf/camel/blob/fad48654/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
new file mode 100644
index 000..269aefc
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
@@ -0,0 +1,178 @@
+

[29/35] git commit: Fixed generated ApiCollection, fixed integration test

2014-06-10 Thread dhirajsb
Fixed generated ApiCollection, fixed integration test


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

Branch: refs/heads/master
Commit: b79eb69c2dc611f52af96303f1e53255145bc7cd
Parents: 4e1254a
Author: Dhiraj Bokde 
Authored: Wed Jun 4 19:03:50 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../src/it/all-it/pom.xml | 14 ++
 .../src/main/resources/api-collection.vm  |  6 +++---
 2 files changed, 5 insertions(+), 15 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/b79eb69c/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
index 5ebd269..9f6f877 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
@@ -152,30 +152,20 @@
   
 
   
-  
+  
   
 org.codehaus.mojo
 build-helper-maven-plugin
 @build-helper-maven-plugin-version@
 
   
-add-generated-sources
-
-  add-source
-
-
-  
-
${project.build.directory}/generated-sources/camel-component
-  
-
-  
-  
 add-generated-test-sources
 
   add-test-source
 
 
   
+
${project.build.directory}/generated-sources/camel-component
 
${project.build.directory}/generated-test-sources/camel-component
   
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b79eb69c/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
index 868b958..0774366 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
@@ -48,10 +48,10 @@ public final class $collectionName extends 
ApiCollection<${apiNameEnum}, ${compo
 #foreach( $alias in $api.Aliases )
 aliases.put("$alias.MethodPattern", "$alias.MethodAlias");
 #end
-#set( $apiMethod = "${helper.getApiMethod($api.ProxyClass)}.class" )
+#set( $apiMethod = ${helper.getApiMethod($api.ProxyClass)} )
 #set( $apiName = "${apiNameEnum}.${helper.getEnumConstant($api.ApiName)}" )
-apis.put($apiName, new ApiMethodHelper<$apiMethod>(${apiMethod}, 
aliases));
-apiMethods.put(${apiMethod}, ${apiName});
+apis.put($apiName, new ApiMethodHelper<$apiMethod>(${apiMethod}.class, 
aliases));
+apiMethods.put(${apiMethod}.class, ${apiName});
 #end
 }
 



[03/35] git commit: Made ApiMethodParser.parse() final and added processResults to avoid warnings from ApiMethodParser

2014-06-10 Thread dhirajsb
Made ApiMethodParser.parse() final and added processResults to avoid warnings 
from ApiMethodParser


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

Branch: refs/heads/master
Commit: 7431e7e9fa9c8ce2d2477fb0a17d16a44e0255d1
Parents: 2ffeacc
Author: Dhiraj Bokde 
Authored: Fri May 23 18:33:04 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:29 2014 -0700

--
 .../camel/util/component/ApiMethodParser.java   |  8 +++-
 .../component/ArgumentSubstitutionParser.java   |  4 +-
 .../apache/camel/maven/TestProxyApiMethod.java  | 48 
 3 files changed, 57 insertions(+), 3 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7431e7e9/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index 4c6523a..58ada5a 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -88,7 +88,7 @@ public abstract class ApiMethodParser {
  * Parses the method signatures from {@code getSignatures()}.
  * @return list of Api methods as {@link ApiMethodModel}
  */
-public List parse() {
+public final List parse() {
 // parse sorted signatures and generate descriptions
 List result = new ArrayList();
 for (String signature: signatures) {
@@ -124,6 +124,8 @@ public abstract class ApiMethodParser {
 result.add(new ApiMethodModel(name, resultType, arguments, 
method));
 }
 
+result = processResults(result);
+
 Collections.sort(result, new Comparator() {
 @Override
 public int compare(ApiMethodModel model1, ApiMethodModel model2) {
@@ -171,6 +173,10 @@ public abstract class ApiMethodParser {
 return result;
 }
 
+protected List processResults(List result) 
{
+return result;
+}
+
 protected Class forName(String className) {
 return forName(className, classLoader);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/7431e7e9/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
index 0e15833..43f60e9 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
@@ -57,10 +57,10 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 }
 
 @Override
-public List parse() {
+public List processResults(List 
parseResult) {
 final List result = new ArrayList();
 
-for (ApiMethodModel model : super.parse()) {
+for (ApiMethodModel model : parseResult) {
 // look for method name matches
 for (Map.Entry>> 
methodEntry : methodMap.entrySet()) {
 if (methodEntry.getKey().matcher(model.getName()).matches()) {

http://git-wip-us.apache.org/repos/asf/camel/blob/7431e7e9/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
new file mode 100644
index 000..2a5bee2
--- /dev/null
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
@@ -0,0 +1,48 @@
+/*
+ * Camel ApiMethod Enumeration generated by camel-component-util-maven-plugin
+ * Generated on: Fri May 23 17:35:21 PDT 2014
+ */
+package org.apache.camel.maven;
+
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.camel.maven.TestProxy;
+
+import org.apache.camel.util.component.ApiMethod;
+import org.apache.camel.util.component.ApiMethodImpl;
+
+/**
+ * Camel {@link ApiMethod} Enumeration for org.apache.camel.maven.TestProxy
+ */
+public enum TestProxyApiMethod implements ApiMethod {
+
+GREETALL(java.lang.String.clas

[18/35] git commit: Added getApiNames() to ApiCollection, added more method modifiers to signature parsing

2014-06-10 Thread dhirajsb
Added getApiNames() to ApiCollection, added more method modifiers to signature 
parsing


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

Branch: refs/heads/master
Commit: 24e196bc6f3af120e4495ce8f3d2c7bee391bb6c
Parents: 3d46cbf
Author: Dhiraj Bokde 
Authored: Fri May 30 11:14:46 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:32 2014 -0700

--
 .../java/org/apache/camel/util/component/ApiCollection.java | 5 +
 .../java/org/apache/camel/util/component/ApiMethodParser.java   | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/24e196bc/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index 585fbb2..6520d1c 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -16,8 +16,10 @@
  */
 package org.apache.camel.util.component;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * Base class for a collection of ApiMethods. Meant to be extended by 
Components to create the api name map.
@@ -30,4 +32,7 @@ public abstract class ApiCollection {
 return apis.get(apiName);
 }
 
+public final Set getApiNames() {
+return Collections.unmodifiableSet(apis.keySet());
+}
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/24e196bc/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index 933a0b9..b7e6ef7 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -93,7 +93,7 @@ public abstract class ApiMethodParser {
 List result = new ArrayList();
 for (String signature: signatures) {
 // remove all type parameters and modifiers
-signature = signature.replaceAll("<[^>]*>|public|final", "");
+signature = 
signature.replaceAll("<[^>]*>|\\s*(public|final|synchronized|native)\\s*", "");
 log.debug("Processing " + signature);
 
 final Matcher methodMatcher = METHOD_PATTERN.matcher(signature);



[31/35] git commit: Fixed error message on invalid endpoint URI

2014-06-10 Thread dhirajsb
Fixed error message on invalid endpoint URI


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

Branch: refs/heads/master
Commit: 4b079790b03ee702bf04ef07c0e8367a1fbbc46e
Parents: e309bf8
Author: Dhiraj Bokde 
Authored: Thu Jun 5 11:59:00 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:35 2014 -0700

--
 .../__artifactId__-component/src/main/java/__name__Component.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4b079790/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
index d249203..6694b4e 100644
--- 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
@@ -72,7 +72,7 @@ public class ${name}Component extends UriEndpointComponent {
 try {
 apiName = ${name}ApiName.fromValue(apiNameStr);
 } catch (IllegalArgumentException e) {
-throw new CamelException("Invalid URI path [" + apiNameStr +
+throw new CamelException("Invalid URI path prefix [" + remaining +
 "], must be one of " + collection.getApiNames());
 }
 



[16/35] git commit: Updated ApiCollection to use type ApiName, fixed method name constant to be locale independent

2014-06-10 Thread dhirajsb
Updated ApiCollection to use type ApiName, fixed method name constant to be 
locale independent


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

Branch: refs/heads/master
Commit: a38476c24af048437a8fb4ddb35b73ad5dbeb4ea
Parents: fad4865
Author: Dhiraj Bokde 
Authored: Mon Jun 2 15:45:47 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:32 2014 -0700

--
 .../camel/util/component/ApiCollection.java | 14 +++---
 .../camel/util/component/ApiMethodParser.java   | 11 ++--
 .../apache/camel/util/component/ApiName.java| 29 
 3 files changed, 48 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/a38476c2/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index 6520d1c..1183591 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -18,21 +18,27 @@ package org.apache.camel.util.component;
 
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.Set;
 
 /**
  * Base class for a collection of ApiMethods. Meant to be extended by 
Components to create the api name map.
  */
-public abstract class ApiCollection {
+@SuppressWarnings("unused")
+public abstract class ApiCollection {
 
-protected final Map apis = new HashMap();
+protected final Map apis = new HashMap();
 
-public final ApiMethodHelper getHelper(String apiName) {
+public final ApiMethodHelper getHelper(T apiName) {
 return apis.get(apiName);
 }
 
 public final Set getApiNames() {
-return Collections.unmodifiableSet(apis.keySet());
+final Set result = new HashSet();
+for (T api : apis.keySet()) {
+result.add(api.getName());
+}
+return Collections.unmodifiableSet(result);
 }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/a38476c2/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index b7e6ef7..1003df4 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -178,8 +178,15 @@ public abstract class ApiMethodParser {
 // assign unique names to every method model
 final Map dups = new HashMap();
 for (ApiMethodModel model : result) {
-// TODO watch out, this uses default locale to convert to upper 
case
-String uniqueName = model.name.toUpperCase();
+// locale independent upper case conversion
+final String name = model.getName();
+final char[] upperCase = new char[name.length()];
+final char[] lowerCase = name.toCharArray();
+for (int i = 0; i < upperCase.length; i++) {
+upperCase[i] = Character.toUpperCase(lowerCase[i]);
+}
+String uniqueName = new String(upperCase);
+
 Integer suffix = dups.get(uniqueName);
 if (suffix == null) {
 dups.put(uniqueName, 1);

http://git-wip-us.apache.org/repos/asf/camel/blob/a38476c2/camel-core/src/main/java/org/apache/camel/util/component/ApiName.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiName.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiName.java
new file mode 100644
index 000..9c863fd
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiName.java
@@ -0,0 +1,29 @@
+/**
+ * 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/LICENS

[17/35] git commit: Updated ApiComponentGeneratorMojo to generate ApiName enumeration

2014-06-10 Thread dhirajsb
Updated ApiComponentGeneratorMojo to generate ApiName enumeration


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

Branch: refs/heads/master
Commit: dd70b99d643b5257ca90694338df5f9cc50a02fd
Parents: a38476c
Author: Dhiraj Bokde 
Authored: Mon Jun 2 15:47:54 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:32 2014 -0700

--
 .../camel/maven/ApiComponentGeneratorMojo.java  | 53 +++---
 .../src/main/resources/api-collection.vm|  4 +-
 .../src/main/resources/api-name-enum.vm | 56 
 3 files changed, 103 insertions(+), 10 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/dd70b99d/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
index b967817..d0d4b97 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiComponentGeneratorMojo.java
@@ -42,33 +42,70 @@ public class ApiComponentGeneratorMojo extends 
AbstractGeneratorMojo {
 throw new MojoExecutionException("One or more API proxies are 
required");
 }
 
-// TODO generate Component classes
 // generate ApiCollection
-mergeTemplate(getApiCollectionContext(), getApiCollectionFile(), 
"/api-collection.vm");
+mergeTemplate(getApiContext(), getApiCollectionFile(), 
"/api-collection.vm");
+
+// generate ApiName
+mergeTemplate(getApiContext(), getApiNameFile(), "/api-name-enum.vm");
 }
 
-private VelocityContext getApiCollectionContext() {
+private VelocityContext getApiContext() {
 final VelocityContext context = new VelocityContext();
 context.put("componentName", componentName);
-context.put("collectionName", getApiCollectionName());
 context.put("packageName", outPackage);
 context.put("apis", apis);
 context.put("helper", getClass());
+context.put("collectionName", getApiCollectionName());
+context.put("apiNameEnum", getApiNameEnum());
 return context;
 }
 
+private String getApiCollectionName() {
+return componentName + "ApiCollection";
+}
+
+private String getApiNameEnum() {
+return componentName + "ApiName";
+}
+
 private File getApiCollectionFile() {
-final StringBuilder fileName = new StringBuilder();
-fileName.append(outPackage.replaceAll("\\.", 
File.separator)).append(File.separator);
+final StringBuilder fileName = getFileBuilder();
 fileName.append(getApiCollectionName()).append(".java");
 return new File(generatedSrcDir, fileName.toString());
 }
 
-private String getApiCollectionName() {
-return componentName + "ApiCollection";
+private File getApiNameFile() {
+final StringBuilder fileName = getFileBuilder();
+fileName.append(getApiNameEnum()).append(".java");
+return new File(generatedSrcDir, fileName.toString());
+}
+
+private StringBuilder getFileBuilder() {
+final StringBuilder fileName = new StringBuilder();
+fileName.append(outPackage.replaceAll("\\.", 
File.separator)).append(File.separator);
+return fileName;
 }
 
 public static String getApiMethod(String proxyClass) {
 return proxyClass.substring(proxyClass.lastIndexOf('.') + 1) + 
"ApiMethod";
 }
+
+public static String getEnumConstant(String enumValue) {
+if (enumValue == null || enumValue.isEmpty()) {
+return "DEFAULT";
+}
+StringBuilder builder = new StringBuilder();
+if (!Character.isJavaIdentifierStart(enumValue.charAt(0))) {
+builder.append('_');
+}
+for (char c : enumValue.toCharArray()) {
+char upperCase = Character.toUpperCase(c);
+if (!Character.isJavaIdentifierPart(upperCase)) {
+builder.append('_');
+} else {
+builder.append(upperCase);
+}
+}
+return builder.toString();
+}
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/dd70b99d/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm

[01/35] git commit: Removed redundant test class

2014-06-10 Thread dhirajsb
Repository: camel
Updated Branches:
  refs/heads/master c59a0ff4f -> 0c9fbb62b


Removed redundant test class


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

Branch: refs/heads/master
Commit: cd89e14c2fc47e0bc3bc43e9269158f5c33d1528
Parents: 7c1a35f
Author: Dhiraj Bokde 
Authored: Fri May 23 18:38:10 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:29 2014 -0700

--
 .../apache/camel/maven/TestProxyApiMethod.java  | 48 
 1 file changed, 48 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/cd89e14c/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
deleted file mode 100644
index 2a5bee2..000
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/TestProxyApiMethod.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Camel ApiMethod Enumeration generated by camel-component-util-maven-plugin
- * Generated on: Fri May 23 17:35:21 PDT 2014
- */
-package org.apache.camel.maven;
-
-import java.lang.reflect.Method;
-import java.util.List;
-
-import org.apache.camel.maven.TestProxy;
-
-import org.apache.camel.util.component.ApiMethod;
-import org.apache.camel.util.component.ApiMethodImpl;
-
-/**
- * Camel {@link ApiMethod} Enumeration for org.apache.camel.maven.TestProxy
- */
-public enum TestProxyApiMethod implements ApiMethod {
-
-GREETALL(java.lang.String.class, "greetAll", new 
java.lang.String[0].getClass(), "names"),
-GREETALL_1(java.lang.String.class, "greetAll", java.util.List.class, 
"namesList"),
-GREETME(java.lang.String.class, "greetMe", java.lang.String.class, "name"),
-GREETTIMES(new java.lang.String[0].getClass(), "greetTimes", 
java.lang.String.class, "name", int.class, "times"),
-GREETUS(java.lang.String.class, "greetUs", java.lang.String.class, 
"name1", java.lang.String.class, "name2"),
-SAYHI(java.lang.String.class, "sayHi"),
-SAYHI_1(java.lang.String.class, "sayHi", java.lang.String.class, "name");
-
-private final ApiMethod apiMethod;
-
-private TestProxyApiMethod(Class resultType, String name, Object... 
args) {
-this.apiMethod = new ApiMethodImpl(TestProxy.class, resultType, name, 
args);
-}
-
-@Override
-public String getName() { return apiMethod.getName(); }
-
-@Override
-public Class getResultType() { return apiMethod.getResultType(); }
-
-@Override
-public List getArgNames() { return apiMethod.getArgNames(); }
-
-@Override
-public List> getArgTypes() { return apiMethod.getArgTypes(); }
-
-@Override
-public Method getMethod() { return apiMethod.getMethod(); }
-}



[26/35] git commit: Renamed test API classes for clarity

2014-06-10 Thread dhirajsb
Renamed test API classes for clarity


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

Branch: refs/heads/master
Commit: 161b21689744271966a1e9d6e207fb30a5ebdbcb
Parents: d35d71f
Author: Dhiraj Bokde 
Authored: Wed Jun 4 19:28:24 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../src/main/java/__name__FileHello.java| 31 
 .../src/main/java/__name__FileSigApi.java   | 31 
 .../src/main/java/__name__JavadocHello.java | 31 
 .../src/main/java/__name__JavadocSigApi.java| 31 
 .../__artifactId__-component/pom.xml| 12 
 .../src/main/java/__name__Endpoint.java |  4 +--
 6 files changed, 70 insertions(+), 70 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/161b2168/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
new file mode 100644
index 000..fb9bc52
--- /dev/null
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileHello.java
@@ -0,0 +1,31 @@
+## 
+## 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;
+}
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/161b2168/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileSigApi.java
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileSigApi.java
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileSigApi.java
deleted file mode 100644
index 4c86927..000
--- 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-api/src/main/java/__name__FileSigApi.java
+++ /dev/null
@@ -1,31 +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};

[12/35] git commit: Added substitution for duplicate argument name key

2014-06-10 Thread dhirajsb
Added substitution for duplicate argument name key


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

Branch: refs/heads/master
Commit: 99ccd3775e81573f8de516cd4b8ee42fb7850a43
Parents: ee191eb
Author: Dhiraj Bokde 
Authored: Wed May 28 14:21:43 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java  | 2 ++
 1 file changed, 2 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/99ccd377/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
index 3528eda..dd252f2 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/test/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojoTest.java
@@ -56,6 +56,8 @@ public class JavadocApiMethodGeneratorMojoTest extends 
AbstractGeneratorMojoTest
 }
 };
 mojo.excludePackages = 
JavadocApiMethodGeneratorMojo.DEFAULT_EXCLUDE_PACKAGES;
+Substitution substitution = new Substitution(".*", "key", 
"java.lang.Object", "applicationKey");
+mojo.substitutions = new Substitution[]{ substitution };
 
 mojo.execute();
 



[32/35] Renamed component-util plugin to api-component

2014-06-10 Thread dhirajsb
http://git-wip-us.apache.org/repos/asf/camel/blob/0c9fbb62/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
deleted file mode 100644
index 28bd958..000
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
+++ /dev/null
@@ -1,276 +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 org.apache.camel.maven;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.regex.Pattern;
-import javax.swing.text.ChangedCharSetException;
-import javax.swing.text.SimpleAttributeSet;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.parser.DTD;
-import javax.swing.text.html.parser.Parser;
-import javax.swing.text.html.parser.TagElement;
-
-import org.apache.camel.util.component.ApiMethodParser;
-import org.apache.camel.util.component.ArgumentSubstitutionParser;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.plugins.annotations.ResolutionScope;
-import org.codehaus.plexus.util.IOUtil;
-
-/**
- * Parses ApiMethod signatures from Javadoc.
- */
-@Mojo(name = "fromJavadoc", requiresDependencyResolution = 
ResolutionScope.TEST, requiresProject = true,
-defaultPhase = LifecyclePhase.GENERATE_SOURCES)
-public class JavadocApiMethodGeneratorMojo extends 
AbstractApiMethodGeneratorMojo {
-
-static {
-// set Java AWT to headless before using Swing HTML parser
-System.setProperty("java.awt.headless", "true");
-}
-
-protected static final String DEFAULT_EXCLUDE_PACKAGES = "javax?\\.lang.*";
-
-@Parameter(property = "camel.component.util.excludePackages", defaultValue 
= DEFAULT_EXCLUDE_PACKAGES)
-protected String excludePackages;
-
-@Parameter(property = "camel.component.util.excludeClasses")
-protected String excludeClasses;
-
-@Parameter(property = "camel.component.util.excludeMethods")
-protected String excludeMethods;
-
-@Override
-protected ApiMethodParser createAdapterParser(Class proxyType) {
-return new ArgumentSubstitutionParser(proxyType, 
getArgumentSubstitutions());
-}
-
-@Override
-public List getSignatureList() throws MojoExecutionException {
-// signatures as map from signature with no arg names to arg names 
from JavadocParser
-Map result = new HashMap();
-
-final Pattern packagePatterns = Pattern.compile(excludePackages);
-Pattern classPatterns = null;
-if (excludeClasses != null) {
-classPatterns = Pattern.compile(excludeClasses);
-}
-Pattern methodPatterns = null;
-if (excludeMethods != null) {
-methodPatterns = Pattern.compile(excludeMethods);
-}
-
-// for proxy class and super classes not matching excluded packages or 
classes
-for (Class aClass = getProxyType();
- aClass != null && 
!packagePatterns.matcher(aClass.getPackage().getName()).matches() &&
- (classPatterns == null || 
!classPatterns.matcher(aClass.getSimpleName()).matches());
- aClass = aClass.getSuperclass()) {
-
-LOG.debug("Processing " + aClass.getName());
-final String javaDocPath = aClass.getName().replaceAll("\\.", "/") 
+ ".html";
-
-// read javadoc html text for class
-InputStream inputStream = null;
-try {
-inputStream = 
getProjectClassLoader().getResou

[28/35] git commit: Fixed endpoint configuration, added component default ctor

2014-06-10 Thread dhirajsb
Fixed endpoint configuration, added component default ctor


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

Branch: refs/heads/master
Commit: d35d71fc6480deb73395c22cc327b739795fedb6
Parents: b79eb69
Author: Dhiraj Bokde 
Authored: Wed Jun 4 19:05:45 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../__artifactId__-component/pom.xml|  8 
 .../src/main/java/__name__Component.java| 16 +++-
 2 files changed, 19 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/d35d71fc/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 af32397..2490084 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
@@ -70,6 +70,14 @@
   test
 
 
+
+
+  org.apache.camel
+  spi-annotations
+  ${camel-version}
+  provided
+
+
 
 
   org.apache.camel

http://git-wip-us.apache.org/repos/asf/camel/blob/d35d71fc/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
index 7226fef..d249203 100644
--- 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources/archetype-resources/__artifactId__-component/src/main/java/__name__Component.java
@@ -41,12 +41,12 @@ public class ${name}Component extends UriEndpointComponent {
 
 private final ${name}ApiCollection collection = 
${name}ApiCollection.getCollection();
 
-public ${name}Component(Class endpointClass) {
-super(endpointClass);
+public ${name}Component() {
+super(${name}Endpoint.class);
 }
 
-public ${name}Component(CamelContext context, Class 
endpointClass) {
-super(context, endpointClass);
+public ${name}Component(CamelContext context) {
+super(context, ${name}Endpoint.class);
 }
 
 protected Endpoint createEndpoint(String uri, String remaining, 
Map parameters) throws Exception {
@@ -81,12 +81,18 @@ public class ${name}Component extends UriEndpointComponent {
 
 // set endpoint property inBody
 setProperties(endpoint, parameters);
+
+// configure endpoint properties and initialize state
+endpoint.configureProperties(parameters);
+
 return endpoint;
 }
 
 private ${name}Configuration createEndpointConfiguration(${name}ApiName 
name) throws Exception {
 final Map componentProperties = new HashMap();
-IntrospectionSupport.getProperties(configuration, componentProperties, 
null, false);
+if (configuration != null) {
+IntrospectionSupport.getProperties(configuration, 
componentProperties, null, false);
+}
 
 // create endpoint configuration with component properties
 final ${name}Configuration endpointConfiguration = 
collection.getEndpointConfiguration(name);



[35/35] git commit: Added replaceWithType feature to argument Substitution to allow replacing argument name with substituted type string

2014-06-10 Thread dhirajsb
Added replaceWithType feature to argument Substitution to allow replacing 
argument name with substituted type string


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

Branch: refs/heads/master
Commit: 420fed02190d00416480e4df809cb3e343e22497
Parents: 4b07979
Author: Dhiraj Bokde 
Authored: Mon Jun 9 14:25:59 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:35 2014 -0700

--
 .../component/ArgumentSubstitutionParser.java   | 76 
 .../ArgumentSubstitutionParserTest.java |  8 ++-
 .../__artifactId__-component/pom.xml|  2 +
 .../src/it/all-it/pom.xml   |  7 ++
 .../maven/AbstractApiMethodGeneratorMojo.java   |  6 +-
 .../org/apache/camel/maven/Substitution.java| 12 +++-
 .../maven/FileApiMethodGeneratorMojoTest.java   |  5 +-
 .../JavadocApiMethodGeneratorMojoTest.java  |  2 +-
 8 files changed, 95 insertions(+), 23 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/420fed02/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
index 0ebf63c..2544dff 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
@@ -23,24 +23,25 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 super(proxyType);
 Map>> regexMap = new 
LinkedHashMap>>();
 
-for (Substitution tuple : substitutions) {
-tuple.validate();
+for (Substitution substitution : substitutions) {
+substitution.validate();
 
 final NameReplacement nameReplacement = new NameReplacement();
-nameReplacement.replacement = tuple.replacement;
-if (tuple.argType != null) {
-nameReplacement.type = forName(tuple.argType);
+nameReplacement.replacement = substitution.replacement;
+if (substitution.argType != null) {
+nameReplacement.typePattern = 
Pattern.compile(substitution.argType);
 }
+nameReplacement.replaceWithType = substitution.replaceWithType;
 
-Map> replacementMap = 
regexMap.get(tuple.method);
+Map> replacementMap = 
regexMap.get(substitution.method);
 if (replacementMap == null) {
 replacementMap = new LinkedHashMap>();
-regexMap.put(tuple.method, replacementMap);
+regexMap.put(substitution.method, replacementMap);
 }
-List replacements = 
replacementMap.get(tuple.argName);
+List replacements = 
replacementMap.get(substitution.argName);
 if (replacements == null) {
 replacements = new ArrayList();
-replacementMap.put(tuple.argName, replacements);
+replacementMap.put(substitution.argName, replacements);
 }
 replacements.add(nameReplacement);
 }
@@ -63,19 +64,40 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 for (ApiMethodModel model : parseResult) {
 // look for method name matches
 for (Map.Entry>> 
methodEntry : methodMap.entrySet()) {
+// match the whole method name
 if (methodEntry.getKey().matcher(model.getName()).matches()) {
 
 // look for arg name matches
 final List updatedArguments = new 
ArrayList();
 final Map> argMap = 
methodEntry.getValue();
 for (Argument argument : model.getArguments()) {
+final Class argType = argument.getType();
+final String argTypeName = argType.getCanonicalName();
+
 for (Map.Entry> 
argEntry : argMap.entrySet()) {
 final Matcher matcher = 
argEntry.getKey().matcher(argument.getName());
+
+// match argument name substring
 if (matcher.find()) {
 final List adapters = 
argEntry.getValue();
 for (NameReplacement adapter : adapters) {
-if (adapter.type == null || adapter.type 
== argument.getType()) {
- 

[23/35] git commit: Initial version of camel-archetype-api-component

2014-06-10 Thread dhirajsb
Initial version of camel-archetype-api-component


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

Branch: refs/heads/master
Commit: a056dfad9fdd53e217b7b98047f4033aeaad7b56
Parents: dd70b99
Author: Dhiraj Bokde 
Authored: Tue Jun 3 12:44:16 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:33 2014 -0700

--
 .../camel-archetype-api-component/pom.xml   |  59 +
 .../META-INF/maven/archetype-metadata.xml   | 110 +
 .../src/main/resources/META-INF/LICENSE.txt | 203 +++
 .../src/main/resources/META-INF/NOTICE.txt  |  11 +
 .../resources/archetype-resources/ReadMe.txt|  13 +
 .../__artifactId__-api/pom.xml  |  60 +
 .../src/main/java/__name__FileSigApi.java   |  31 +++
 .../src/main/java/__name__JavadocSigApi.java|  31 +++
 .../__artifactId__-component/pom.xml| 245 +++
 .../signatures/file-sig-api.txt |   2 +
 .../src/main/java/__name__Component.java|  34 +++
 .../src/main/java/__name__Consumer.java |  56 +
 .../src/main/java/__name__Endpoint.java |  51 
 .../src/main/java/__name__Producer.java |  40 +++
 .../org/apache/camel/component/__scheme__   |  17 ++
 .../src/test/resources/log4j.properties |  30 +++
 .../main/resources/archetype-resources/pom.xml  |  49 
 tooling/archetypes/pom.xml  |   1 +
 18 files changed, 1043 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/a056dfad/tooling/archetypes/camel-archetype-api-component/pom.xml
--
diff --git a/tooling/archetypes/camel-archetype-api-component/pom.xml 
b/tooling/archetypes/camel-archetype-api-component/pom.xml
new file mode 100644
index 000..b86cf45
--- /dev/null
+++ b/tooling/archetypes/camel-archetype-api-component/pom.xml
@@ -0,0 +1,59 @@
+
+
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+
+  4.0.0
+
+  
+org.apache.camel
+archetypes
+2.14-SNAPSHOT
+  
+
+  org.apache.camel.archetypes
+  camel-archetype-api-component
+  Camel :: Archetypes :: Component
+  Creates a new Camel component that wraps one or more API 
proxies.
+  maven-archetype
+
+  
+
+  
+org.apache.maven.archetype
+archetype-packaging
+${maven-archetype-packaging-version}
+  
+
+
+
+
+  
+src/main/resources
+false
+  
+  
+src/main/resources-filtered
+true
+
+  **/archetype-metadata.xml
+
+  
+
+  
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/a056dfad/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
--
diff --git 
a/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 000..96b096c
--- /dev/null
+++ 
b/tooling/archetypes/camel-archetype-api-component/src/main/resources-filtered/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,110 @@
+
+
+http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0
 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"; 
name="camel-archetype-from-apis"
+
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0";
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
+
+  
+
+
+
+  ${project.version}
+
+
+  ${log4j-version}
+
+
+  ${maven-compiler-plugin-version}
+
+
+  ${maven-resources-plugin-version}
+
+
+  ${maven-bundle-plugin-version}
+
+
+  ${build-helper-maven-plugin-version}
+
+
+  ${slf4j-version}
+
+
+  ${log4j-version}
+
+  
+
+  
+
+
+
+  
+  
+pom.xml
+  
+
+
+
+
+  __artifactId__-component/
+  
+ReadMe.txt
+pom.xml
+  
+
+
+  __artifactId__-component/src/main/java
+  
+**/*.java
+  
+
+
+  __artifactId__-component/src/main/resources
+  
+**/*
+  
+
+
+  __artifactId__-component/src/test/resources
+  
+**/*
+  
+
+
+  __artifactId__-component/signatures

[14/35] git commit: Added argument name and type uniqueness check

2014-06-10 Thread dhirajsb
Added argument name and type uniqueness check


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

Branch: refs/heads/master
Commit: 32677ffe8291c698b7caa745212a765048a64de4
Parents: ec5a57e
Author: Dhiraj Bokde 
Authored: Wed May 28 14:20:13 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../camel/util/component/ApiMethodParser.java   | 21 
 1 file changed, 21 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/32677ffe/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
index 0e839df..933a0b9 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java
@@ -124,8 +124,29 @@ public abstract class ApiMethodParser {
 result.add(new ApiMethodModel(name, resultType, arguments, 
method));
 }
 
+// allow derived classes to post process
 result = processResults(result);
 
+// check that argument names have the same type across methods
+Map> allArguments = new HashMap>();
+for (ApiMethodModel model : result) {
+for (Argument argument : model.getArguments()) {
+String name = argument.getName();
+Class argClass = allArguments.get(name);
+Class type = argument.getType();
+if (argClass == null) {
+allArguments.put(name, type);
+} else {
+if (argClass != type) {
+throw new IllegalArgumentException("Argument [" + name 
+
+"] is used in multiple methods with different 
types " +
+argClass.getCanonicalName() + ", " + 
type.getCanonicalName());
+}
+}
+}
+}
+allArguments.clear();
+
 Collections.sort(result, new Comparator() {
 @Override
 public int compare(ApiMethodModel model1, ApiMethodModel model2) {



[27/35] git commit: Added missing '/' to test route path

2014-06-10 Thread dhirajsb
Added missing '/' to test route path


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

Branch: refs/heads/master
Commit: e309bf8febdd57c54359b4a3532c35f189ed820e
Parents: bbb4127
Author: Dhiraj Bokde 
Authored: Thu Jun 5 11:40:53 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../src/main/resources/api-route-test.vm   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e309bf8f/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
index 78d6301..a3acad1 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-route-test.vm
@@ -94,7 +94,7 @@ 
template().requestBodyAndHeader("direct://${model.UniqueName}", null, headers);
 #set ( $args = $model.Arguments )
 // test route for $model.Name
 from("direct://${model.UniqueName}")
-  .to("${scheme}://" + PATH_PREFIX + "${model.Name}#if ( 
$args.size() == 1 )?inBody=${args.get(0).Name}#end");
+  .to("${scheme}://" + PATH_PREFIX + "/${model.Name}#if ( 
$args.size() == 1 )?inBody=${args.get(0).Name}#end");
 
 #end
 }



[15/35] git commit: Added check to exclude static methods in proxies

2014-06-10 Thread dhirajsb
Added check to exclude static methods in proxies


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

Branch: refs/heads/master
Commit: e47e53c013706f1adea1faa39c4c51886cab84a6
Parents: 99ccd37
Author: Dhiraj Bokde 
Authored: Wed May 28 14:22:26 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../apache/camel/maven/JavadocApiMethodGeneratorMojo.java   | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e47e53c0/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
index b94aab7..fe8b5ac 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
@@ -134,7 +134,9 @@ public class JavadocApiMethodGeneratorMojo extends 
AbstractApiMethodGeneratorMoj
 }
 try {
 final Method method = aClass.getMethod(name, argTypes);
-if ((method.getModifiers() & Modifier.PUBLIC) != 0) {
+// only include non-static public methods
+int modifiers = method.getModifiers();
+if (Modifier.isPublic(modifiers) && !Modifier.isStatic(modifiers)) 
{
 return method.getReturnType().getCanonicalName();
 } else {
 return null;
@@ -191,11 +193,6 @@ public class JavadocApiMethodGeneratorMojo extends 
AbstractApiMethodGeneratorMoj
 }
 
 @Override
-protected void endTag(boolean omitted) {
-super.endTag(omitted);//To change body of overridden methods 
use File | Settings | File Templates.
-}
-
-@Override
 protected void handleEmptyTag(TagElement tag) {
 if (parserState == ParserState.METHOD && 
HTML.Tag.CODE.equals(tag.getHTMLTag())) {
 if (methodWithTypes != null) {



[21/35] git commit: Fixed method alias handling, changed component config file name pattern

2014-06-10 Thread dhirajsb
Fixed method alias handling, changed component config file name pattern


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

Branch: refs/heads/master
Commit: 96c8ec0f4da3df0f6bbe0374a625dddaa2d7524d
Parents: 5bf87ed
Author: Dhiraj Bokde 
Authored: Wed Jun 4 13:47:58 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:33 2014 -0700

--
 .../camel/util/component/ApiMethodHelper.java   | 21 +-
 .../component/ApiMethodPropertiesHelper.java| 14 ++--
 .../ApiMethodPropertiesHelperTest.java  |  4 ++--
 .../src/main/resources/api-collection.vm|  2 +-
 .../src/main/resources/api-endpoint-config.vm   |  2 +-
 .../src/main/resources/api-name-enum.vm |  2 +-
 .../apache/camel/component/test/TestConfig.java | 23 
 .../camel/component/test/TestConfiguration.java | 23 
 8 files changed, 51 insertions(+), 40 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/96c8ec0f/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
index dbbc332..a698c1e 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodHelper.java
@@ -50,7 +50,7 @@ public final class ApiMethodHelper & 
ApiMethod> {
 private final Map> VALID_ARGUMENTS = new HashMap>();
 
 // maps aliases to actual method names
-private final HashMap ALIASES = new HashMap();
+private final HashMap> ALIASES = new HashMap>();
 
 /**
  * Create a helper to work with a {@link ApiMethod}, using optional method 
aliases.
@@ -94,7 +94,12 @@ public final class ApiMethodHelper & 
ApiMethod> {
 
builder.append(Character.toLowerCase(firstChar)).append(alias.substring(1));
 alias = builder.toString();
 }
-ALIASES.put(alias, name);
+Set names = ALIASES.get(alias);
+if (names == null) {
+names = new HashSet();
+ALIASES.put(alias, names);
+}
+names.add(name);
 }
 }
 
@@ -144,7 +149,7 @@ public final class ApiMethodHelper & 
ApiMethod> {
 /**
  * Gets methods that match the given name and arguments.
  * Note that the args list is a required subset of arguments for returned 
methods.
- * @param name case sensitive full method name to lookup
+ * @param name case sensitive method name or alias to lookup
  * @param argNames unordered required argument names
  * @return non-null unmodifiable list of methods that take all of the 
given arguments, empty if there is no match
  */
@@ -152,7 +157,10 @@ public final class ApiMethodHelper & 
ApiMethod> {
 List methods = METHOD_MAP.get(name);
 if (methods == null) {
 if (ALIASES.containsKey(name)) {
-methods = METHOD_MAP.get(ALIASES.get(name));
+methods = new ArrayList();
+for (String method : ALIASES.get(name)) {
+methods.addAll(METHOD_MAP.get(method));
+}
 }
 }
 if (methods == null) {
@@ -232,7 +240,10 @@ public final class ApiMethodHelper & 
ApiMethod> {
 List arguments = ARGUMENTS_MAP.get(name);
 if (arguments == null) {
 if (ALIASES.containsKey(name)) {
-arguments = ARGUMENTS_MAP.get(ALIASES.get(name));
+arguments = new ArrayList();
+for (String method : ALIASES.get(name)) {
+arguments.addAll(ARGUMENTS_MAP.get(method));
+}
 }
 }
 if (arguments == null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/96c8ec0f/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodPropertiesHelper.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodPropertiesHelper.java
 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodPropertiesHelper.java
index ea0f442..4cd692c 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodPropertiesHelper.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodPro

[24/35] git commit: Added support for creating endpoint configuration from ApiCollection, added method aliases to tests, minor refactoring

2014-06-10 Thread dhirajsb
Added support for creating endpoint configuration from ApiCollection, added 
method aliases to tests, minor refactoring


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

Branch: refs/heads/master
Commit: 5bf87ed423ec661b190792e721453248fe48984f
Parents: a056dfa
Author: Dhiraj Bokde 
Authored: Tue Jun 3 21:39:35 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:33 2014 -0700

--
 .../camel/util/component/ApiCollection.java | 18 ++-
 .../src/it/all-it/pom.xml   | 10 
 .../maven/AbstractApiMethodGeneratorMojo.java   |  7 +--
 .../camel/maven/AbstractGeneratorMojo.java  | 22 -
 .../camel/maven/ApiComponentGeneratorMojo.java  |  6 ++-
 .../org/apache/camel/maven/ApiMethodAlias.java  | 50 
 .../java/org/apache/camel/maven/ApiProxy.java   | 13 +++--
 .../src/main/resources/api-collection.vm| 24 --
 .../src/main/resources/api-endpoint-config.vm   |  6 +--
 .../src/main/resources/api-route-test.vm|  4 +-
 .../src/main/resources/log4j.properties | 36 ++
 .../maven/ApiComponentGeneratorMojoTest.java|  7 ++-
 .../src/test/resources/log4j.properties | 36 --
 13 files changed, 184 insertions(+), 55 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index 1183591..a1fd2b7 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -26,14 +26,23 @@ import java.util.Set;
  * Base class for a collection of ApiMethods. Meant to be extended by 
Components to create the api name map.
  */
 @SuppressWarnings("unused")
-public abstract class ApiCollection {
+public abstract class ApiCollection {
 
 protected final Map apis = new HashMap();
 
+/**
+ * Returns a {@link ApiMethodHelper} for a particular API.
+ * @param apiName name of the API
+ * @return helper class to work with {@link ApiMethod}
+ */
 public final ApiMethodHelper getHelper(T apiName) {
 return apis.get(apiName);
 }
 
+/**
+ * Returns a list of API name strings.
+ * @return list of API names.
+ */
 public final Set getApiNames() {
 final Set result = new HashSet();
 for (T api : apis.keySet()) {
@@ -41,4 +50,11 @@ public abstract class ApiCollection {
 }
 return Collections.unmodifiableSet(result);
 }
+
+/**
+ * Creates an endpoint configuration for a particular API
+ * @param apiName name of the API.
+ * @return Endpoint configuration object for the API.
+ */
+public abstract C getEndpointConfiguration(T apiName);
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
index 269aefc..5ebd269 100644
--- a/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/src/it/all-it/pom.xml
@@ -136,6 +136,16 @@
 
   velocity
   org.apache.velocity.VelocityContext
+  
+
+  get(.+)
+  $1
+
+
+  set(.+)
+  $1
+
+  
 
   
 

http://git-wip-us.apache.org/repos/asf/camel/blob/5bf87ed4/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
index 8b868c4..de70464 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
+++ 

[13/35] git commit: Converted generated ApiCollection class to singleton

2014-06-10 Thread dhirajsb
Converted generated ApiCollection class to singleton


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

Branch: refs/heads/master
Commit: ee191eb061dddb6504889d42a1f14a7e5e2d2ad3
Parents: 32677ff
Author: Dhiraj Bokde 
Authored: Wed May 28 14:21:05 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../src/main/resources/api-collection.vm   | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ee191eb0/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
index 26382db..a82c2c5 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-collection.vm
@@ -30,9 +30,11 @@ import org.apache.camel.util.component.ApiMethodHelper;
 /**
  * Camel {@link ApiCollection} for $componentName
  */
-public class $collectionName extends ApiCollection {
+public final class $collectionName extends ApiCollection {
 
-public ${collectionName}() {
+private static $collectionName collection;
+
+private ${collectionName}() {
 final Map aliases = new HashMap();
 #foreach( $api in $apis )
 aliases.clear();
@@ -43,4 +45,11 @@ public class $collectionName extends ApiCollection {
 apis.put("$api.ApiName", new 
ApiMethodHelper<$apiMethod>(${apiMethod}.class, aliases));
 #end
 }
+
+public static final synchronized $collectionName getCollection() {
+if (collection == null) {
+collection = new $collectionName();
+}
+return collection;
+}
 }



[30/35] git commit: Updated generated tests to get api name for test routes from ApiCollection, added java.awt.headless=true to Javadoc mojo

2014-06-10 Thread dhirajsb
Updated generated tests to get api name for test routes from ApiCollection, 
added java.awt.headless=true to Javadoc mojo


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

Branch: refs/heads/master
Commit: 4e1254a7e2df28b2c659fc9028ee8d15cdbe5c30
Parents: 911e541
Author: Dhiraj Bokde 
Authored: Wed Jun 4 18:41:37 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:34 2014 -0700

--
 .../java/org/apache/camel/util/component/ApiCollection.java   | 5 +
 .../apache/camel/maven/AbstractApiMethodGeneratorMojo.java| 2 ++
 .../org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java | 5 +
 .../src/main/resources/api-collection.vm  | 7 +--
 .../src/main/resources/api-route-test.vm  | 7 +--
 5 files changed, 22 insertions(+), 4 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/4e1254a7/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
index a1fd2b7..3d0fce8 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ApiCollection.java
@@ -29,6 +29,7 @@ import java.util.Set;
 public abstract class ApiCollection {
 
 protected final Map apis = new HashMap();
+protected final Map, T> apiMethods = new 
HashMap, T>();
 
 /**
  * Returns a {@link ApiMethodHelper} for a particular API.
@@ -51,6 +52,10 @@ public abstract class ApiCollection {
 return Collections.unmodifiableSet(result);
 }
 
+public final T getApiName(Class apiMethod) {
+return apiMethods.get(apiMethod);
+}
+
 /**
  * Creates an endpoint configuration for a particular API
  * @param apiName name of the API.

http://git-wip-us.apache.org/repos/asf/camel/blob/4e1254a7/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
index de70464..445ceda 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
@@ -111,6 +111,8 @@ public abstract class AbstractApiMethodGeneratorMojo 
extends AbstractGeneratorMo
 VelocityContext context = getCommonContext(models);
 context.put("testName", getUnitTestName());
 context.put("scheme", scheme);
+context.put("componentName", componentName);
+context.put("enumName", getEnumName());
 return context;
 }
 

http://git-wip-us.apache.org/repos/asf/camel/blob/4e1254a7/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
index 7eea008..28bd958 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/JavadocApiMethodGeneratorMojo.java
@@ -49,6 +49,11 @@ import org.codehaus.plexus.util.IOUtil;
 defaultPhase = LifecyclePhase.GENERATE_SOURCES)
 public class JavadocApiMethodGeneratorMojo extends 
AbstractApiMethodGeneratorMojo {
 
+static {
+// set Java AWT to headless before using Swing HTML parser
+System.setProperty("java.awt.headless", "true");
+}
+
 protected static final String DEFAULT_EXCLUDE_PACKAGES = "javax?\\.lang.*";
 
 @Parameter(property = "camel.component.util.excludePackages", defaultValue 
= DEFAULT_EXCLUDE_PACKAGES)

http://git-wip-us.apache.org/repos/asf/camel/blob/4e1254a7/tooling/maven/camel-component-util-maven-plugin/src/main/resources/api-coll

[02/35] git commit: Initial version of component util maven plugin

2014-06-10 Thread dhirajsb
Initial version of component util maven plugin


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

Branch: refs/heads/master
Commit: 7c1a35fcaf0ead8da52b333136647a47e7dd24e8
Parents: 7431e7e
Author: Dhiraj Bokde 
Authored: Fri May 23 18:35:56 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:29 2014 -0700

--
 .../camel-component-util-maven-plugin/pom.xml   | 111 +++
 .../camel/maven/ApiMethodGeneratorMojo.java | 197 +++
 .../camel/maven/FileApiMethodGeneratorMojo.java |  82 
 .../org/apache/camel/maven/Substitution.java|  67 +++
 .../src/main/resources/api-method-enum.vm   |  62 ++
 .../apache/camel/maven/ApiMethodEnumTest.java   |  71 +++
 .../java/org/apache/camel/maven/TestProxy.java  |  64 ++
 .../src/test/resources/log4j.properties |  36 
 tooling/maven/pom.xml   |   1 +
 9 files changed, 691 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7c1a35fc/tooling/maven/camel-component-util-maven-plugin/pom.xml
--
diff --git a/tooling/maven/camel-component-util-maven-plugin/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/pom.xml
new file mode 100644
index 000..d6159f1
--- /dev/null
+++ b/tooling/maven/camel-component-util-maven-plugin/pom.xml
@@ -0,0 +1,111 @@
+
+
+http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/maven-v4_0_0.xsd";>
+  4.0.0
+
+  
+org.apache.camel
+maven-plugins
+2.14-SNAPSHOT
+  
+
+  camel-component-util-maven-plugin
+  maven-plugin
+  Camel :: Maven Plugins :: Camel Component Utilities
+  Maven plugin to generate Camel Components for APIs
+
+  
+
+  org.apache.camel
+  camel-core
+
+
+
+  org.apache.maven
+  maven-plugin-api
+
+
+  org.apache.maven.plugin-tools
+  maven-plugin-annotations
+  3.3
+  provided
+
+
+  org.apache.maven
+  maven-plugin-descriptor
+  2.2.1
+
+
+  org.apache.maven
+  maven-artifact
+  2.2.1
+
+
+  org.apache.velocity
+  velocity
+  ${velocity-version}
+
+
+
+
+  log4j
+  log4j
+
+
+  org.slf4j
+  slf4j-log4j12
+
+
+
+  junit
+  junit
+  test
+
+  
+
+  
+
+  
+
+  org.apache.maven.plugins
+  maven-plugin-plugin
+  3.3
+  
+
+true
+  
+  
+
+  mojo-descriptor
+  
+  descriptor
+  
+
+
+  help-goal
+  
+  helpmojo
+  
+
+  
+  
+  
+
+  
+
+

http://git-wip-us.apache.org/repos/asf/camel/blob/7c1a35fc/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodGeneratorMojo.java
new file mode 100644
index 000..ff0d7f9
--- /dev/null
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/ApiMethodGeneratorMojo.java
@@ -0,0 +1,197 @@
+/**
+ * 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.maven;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+im

[06/35] git commit: Fixed argument substituion check to use exact type match

2014-06-10 Thread dhirajsb
Fixed argument substituion check to use exact type match


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

Branch: refs/heads/master
Commit: ace29c891d5ae8eff7708f713ebdedd49a4733e1
Parents: 0932ed4
Author: Dhiraj Bokde 
Authored: Wed May 28 14:19:08 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:30 2014 -0700

--
 .../apache/camel/util/component/ArgumentSubstitutionParser.java| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ace29c89/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
index 43f60e9..0ebf63c 100644
--- 
a/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
+++ 
b/camel-core/src/main/java/org/apache/camel/util/component/ArgumentSubstitutionParser.java
@@ -74,7 +74,7 @@ public class ArgumentSubstitutionParser extends 
ApiMethodParser {
 if (matcher.find()) {
 final List adapters = 
argEntry.getValue();
 for (NameReplacement adapter : adapters) {
-if (adapter.type == null || 
adapter.type.isAssignableFrom(argument.getType())) {
+if (adapter.type == null || adapter.type 
== argument.getType()) {
 argument = new 
Argument(matcher.replaceAll(adapter.replacement), argument.getType());
 }
 }



[11/35] git commit: Added test for invoking a derived proxy class

2014-06-10 Thread dhirajsb
Added test for invoking a derived proxy class


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

Branch: refs/heads/master
Commit: ec5a57ee16cceb34d54febccb162efd32d8bd2dc
Parents: ace29c8
Author: Dhiraj Bokde 
Authored: Wed May 28 14:19:35 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:31 2014 -0700

--
 .../camel/util/component/ApiMethodHelperTest.java| 15 +++
 1 file changed, 15 insertions(+)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/ec5a57ee/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
 
b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
index f41bc76..12bc877 100644
--- 
a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java
@@ -132,6 +132,21 @@ public class ApiMethodHelperTest {
 properties.put("name1", "Dave");
 properties.put("name2", "Frank");
 assertEquals("greetUs(name1, name2)", "Greetings Dave, Frank", 
apiMethodHelper.invokeMethod(proxy, TestMethod.GREETUS, properties));
+
+properties.clear();
+properties.put("names", new String[] { "Dave", "Frank" });
+assertEquals("greetAll(names)", "Greetings Dave, Frank", 
apiMethodHelper.invokeMethod(proxy, TestMethod.GREETALL, properties));
+
+// test with a derived proxy
+proxy = new TestProxy() {
+@Override
+public String sayHi(String name) {
+return "Howdy " + name;
+}
+};
+properties.clear();
+properties.put("name", "Dave");
+assertEquals("Derived sayHi(name)", "Howdy Dave", 
apiMethodHelper.invokeMethod(proxy, TestMethod.SAYHI_1, properties));
 }
 
 static enum TestMethod implements ApiMethod {



[19/35] git commit: Added support for generating integration tests, fixed JavadocApiMethodGeneratorMojoTest, refactored ApiComponentGeneratorMojo to only generate component classes, refactored plugin

2014-06-10 Thread dhirajsb
Added support for generating integration tests, fixed 
JavadocApiMethodGeneratorMojoTest, refactored ApiComponentGeneratorMojo to only 
generate component classes, refactored plugin tests


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

Branch: refs/heads/master
Commit: 3d46cbf327d2bd209ae80718192570e55304fec5
Parents: 0f67b18
Author: Dhiraj Bokde 
Authored: Thu May 29 18:00:49 2014 -0700
Committer: Dhiraj Bokde 
Committed: Tue Jun 10 12:48:32 2014 -0700

--
 .../camel-component-util-maven-plugin/pom.xml   |   5 +
 .../maven/AbstractApiMethodGeneratorMojo.java   | 119 ---
 .../camel/maven/AbstractGeneratorMojo.java  |  26 ++--
 .../camel/maven/ApiComponentGeneratorMojo.java  |  37 +-
 .../java/org/apache/camel/maven/ApiProxy.java   |  40 ---
 .../maven/JavadocApiMethodGeneratorMojo.java|  57 +
 .../src/main/resources/api-route-test.vm| 100 
 .../camel/maven/AbstractGeneratorMojoTest.java  |  32 +
 .../maven/ApiComponentGeneratorMojoTest.java|  33 +
 .../maven/FileApiMethodGeneratorMojoTest.java   |  14 +--
 .../JavadocApiMethodGeneratorMojoTest.java  |  22 +---
 11 files changed, 304 insertions(+), 181 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/3d46cbf3/tooling/maven/camel-component-util-maven-plugin/pom.xml
--
diff --git a/tooling/maven/camel-component-util-maven-plugin/pom.xml 
b/tooling/maven/camel-component-util-maven-plugin/pom.xml
index 90a9aea..ffda9c4 100644
--- a/tooling/maven/camel-component-util-maven-plugin/pom.xml
+++ b/tooling/maven/camel-component-util-maven-plugin/pom.xml
@@ -79,6 +79,11 @@
 
 
 
+  org.apache.camel
+  camel-test
+  test
+
+
   junit
   junit
   test

http://git-wip-us.apache.org/repos/asf/camel/blob/3d46cbf3/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
--
diff --git 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
index 856a286..3064824 100644
--- 
a/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
+++ 
b/tooling/maven/camel-component-util-maven-plugin/src/main/java/org/apache/camel/maven/AbstractApiMethodGeneratorMojo.java
@@ -17,10 +17,13 @@
 package org.apache.camel.maven;
 
 import java.io.File;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.camel.util.component.ApiMethodParser;
 import org.apache.camel.util.component.ArgumentSubstitutionParser;
+import org.apache.commons.lang.ClassUtils;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.plugins.annotations.Parameter;
@@ -56,22 +59,19 @@ public abstract class AbstractApiMethodGeneratorMojo 
extends AbstractGeneratorMo
 
 // generate enumeration from model
 mergeTemplate(getApiMethodContext(models), getApiMethodFile(), 
"/api-method-enum.vm");
+
+// generate junit test if it doesn't already exist under test source 
directory
+// i.e. it may have been generated then moved there and populated with 
test values
+final String testFilePath = getTestFilePath();
+if (!new File(project.getBuild().getTestSourceDirectory(), 
testFilePath).exists()) {
+mergeTemplate(getApiTestContext(models), new 
File(generatedTestDir, testFilePath), "/api-route-test.vm");
+}
 }
 
 protected ApiMethodParser createAdapterParser(Class proxyType) {
 return new ArgumentSubstitutionParser(proxyType, 
getArgumentSubstitutions()){};
 }
 
-private VelocityContext 
getApiMethodContext(List models) throws 
MojoExecutionException {
-VelocityContext context = new VelocityContext();
-context.put("packageName", outPackage);
-context.put("enumName", getEnumName());
-context.put("models", models);
-context.put("proxyType", getProxyType());
-context.put("helper", getClass());
-return context;
-}
-
 public abstract List getSignatureList() throws 
MojoExecutionException;
 
 public Class getProxyType() throws MojoExecutionException {
@@ -86,17 +86,58 @@ public abstract class AbstractApiMethodGeneratorMojo 
extends Abstra

svn commit: r912115 - in /websites/production/camel/content: cache/main.pageCache camel-2140-release.html

2014-06-10 Thread buildbot
Author: buildbot
Date: Tue Jun 10 14:17:50 2014
New Revision: 912115

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/camel-2140-release.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/camel-2140-release.html
==
--- websites/production/camel/content/camel-2140-release.html (original)
+++ websites/production/camel/content/camel-2140-release.html Tue Jun 10 
14:17:50 2014
@@ -87,7 +87,7 @@
 
 
 Camel 2.14.0 
release (currently in progress)
-http://camel.apache.org/download.data/camel-box-v1.0-150x200.png"; 
style="border: 0px solid black">New 
and NoteworthyWelcome to the 2.14.0 release which approx XXX issues 
resolved (new features, improvements and bug fixes such 
as...)Support for running on Java 1.8 JVMsSpring 4.x 
supported.Simple language defined in routes using resultType as 
boolean is now evaluated as predicate instead of as 
expression.Introduced RuntimeEndpointRegistry to capture runtime usage 
of endpoints in use during routing, such as dynamic endpoints from dynamic EIPs.Added event notification for 
routes added and removed.Allow to configure cache size in Recipient 
List, Routing Slip and Dynamic Router EIPs; and as well turn caching 
off.Netty HTTP producer now supports the CamelHttpPath 
header to define a dynamic context-path and query parameters to call the remote 
http server.Polling Consumer allows to configure 
initial queue size and whether to block when full when using the 
default EventDrivenPollingConsumer which most components 
does. We now block by default, as otherwise the message may be lost if the 
queue was full, and a new message was offered.https://issues.apache.org/jira/browse/CAMEL-7435";>Added a generic 
callback to configure the APNS service 
builder.Added StreamList option to 
the JDBC 
componentAllow to define Simple expressions for sql parameters 
of the SQL component.Fixed IssuesTimer consumer is 
now scheduled after CamelContext has started all routes, to ensure other routes 
is running when timer routes is triggered to run.Netty HTTP now returns HTTP status 404 if resource 
not found instead of 503.Fixed the https://camel.apache.org/mongodb.html";>MongoDB readPreference option
 which used to cause an IllegalArgumentException to be 
thrown.Fixed issue with Netty producer may leak HashWhealTimer 
instances when having many producers that are not reused.Fixed issue 
with Netty consumer should wait for join to complete when joining a multicast 
group over UDP Improved stability when testing 
with camel-test-blueprint component.<
 h3 id="Camel2.14.0Release-New">New Enterprise Integration 
PatternsCircuit 
Breaker pattern implemented as a Load Balancer policyNew Componentscamel-ahc-wscamel-atmosphere-websocketcamel-openshiftcamel-goraNew 
Camel Maven 
ArchetypesNew DSLNew AnnotationsNew Data FormatsNew LanguagesNew ExamplesNew TutorialsNew ToolingAPI changesChanged 
...Known IssuesDependency UpgradesYou can 
see any dependency changes using http://vdiff.notsoclever.cc/"; rel="nofollow">Camel Dependencies Version 
Differences web tool created by Tracy Snell from the Camel Team.The below list is a best effort, and we may 
miss some updates, its better to use the http://vdiff.notsoclever.cc/"; rel="nofollow">Camel Dependencies Version 
Differences web tool which uses the released projects for 
comparison.Atomikos
  3.9.2 to 3.9.3Commons-codec 1.8 to 1.9Dozer 5.4.0 to 
5.5.1Groovy upgraded to 2.3.0JRuby 1.7.10 to 
1.7.12MongoDB-Java-Driver 2.11.4 to 2.12.0Scala 2.10.3 to 
2.10.4RabbitMQ AMQ Client 3.2.2 to 3.3.0CXF 2.7.11 to 
3.0.0Internal 
changesChanged ...Changes that may affect 
end usersPolling 
Consumer allows to configure initial queue size and whether to block 
when full when using the default EventDrivenPollingConsumer 
which most components does. We now block by default, as otherwise the message 
may be lost if the queue was full, and a new message was offered.Important 
changes to consider when upgradingJava 1.6 no lon
 ger supported.Getting the 
DistributionsBinary 
DistributionsDescriptionDownload LinkPGP Signature file of downloadWindows 
Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.14.0/apache-camel-2.14.0.zip";>apache-camel-2.14.0.ziphttp://www.apache.org/dist/camel/apache-camel/2.14.0/apache-camel-2.14.0.zi
 p.asc">apache-camel-2.14.0.zip.ascUnix/Linux/Cygwin Distributionhttp://www.apache.org/dyn/closer.cgi/camel/apache-camel/2.14.0/apache-camel-2.14.0.tar.gz";>apache-camel-2.14.0.tar.gzhttp://www.apache.org/dist/camel/apache-camel/2.14.0/apache-camel-2.14.0.tar.gz.asc";>apache-camel-2.14.0.tar.gz.ascSource DistributionDescriptionDownload LinkPGP Signature file 

[CONF] Apache Camel > Camel 2.14.0 Release

2014-06-10 Thread willem jiang (Confluence)














  


willem jiang edited the page:
 


Camel 2.14.0 Release   






...
New Annotations
New Data Formats 

 camel-barcode 

New Languages 
New Examples 
New Tutorials 
...






 View Online  · Like  · View Changes  
 Stop watching space  · Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[1/2] git commit: CAMEL-7494: Added support for enum for parameter json schema

2014-06-10 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/camel-2.13.x 0bc742b63 -> 85f7778b2
  refs/heads/master bd1045705 -> c59a0ff4f


CAMEL-7494: Added support for enum for parameter json schema


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

Branch: refs/heads/master
Commit: c59a0ff4f6b92946b10b1a37475efeda36c7181f
Parents: bd10457
Author: Claus Ibsen 
Authored: Tue Jun 10 15:16:44 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 15:17:23 2014 +0200

--
 .../org/apache/camel/impl/ParameterConfiguration.java  | 13 -
 ...aSetComponentConfigurationAndDocumentationTest.java |  2 ++
 2 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/c59a0ff4/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java 
b/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
index af6883c..652746a 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
@@ -19,6 +19,7 @@ package org.apache.camel.impl;
 import java.lang.reflect.Field;
 
 import org.apache.camel.spi.UriParam;
+import org.apache.camel.util.CollectionStringBuffer;
 
 import static org.apache.camel.util.StringQuoteHelper.doubleQuote;
 
@@ -68,6 +69,16 @@ public class ParameterConfiguration {
 String typeName = parameterType.getCanonicalName();
 // TODO would be nice to add a description; wonder if we can find that 
from somewhere
 // generated by the APT tool?
-return doubleQuote(name) + ": { \"type\": " + doubleQuote(typeName) + 
" }";
+
+if (parameterType.isEnum()) {
+typeName = "string";
+CollectionStringBuffer sb = new CollectionStringBuffer();
+for (Object value : parameterType.getEnumConstants()) {
+sb.append(doubleQuote(value.toString()));
+}
+return doubleQuote(name) + ": { \"type\": " + 
doubleQuote(typeName) + ", \"enum\": [ " +  sb.toString() + " ] }";
+} else {
+return doubleQuote(name) + ": { \"type\": " + 
doubleQuote(typeName) + " }";
+}
 }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/c59a0ff4/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
index 41eb4a9..7b886d5 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
@@ -43,6 +43,8 @@ public class 
DataSetComponentConfigurationAndDocumentationTest extends ContextTe
 
 assertTrue(json.contains("\"preloadSize\": { \"type\": \"long\" }"));
 assertTrue(json.contains("\"minRate\": { \"type\": \"int\" }"));
+assertTrue(json.contains("\"exchangePattern\": { \"type\": \"string\", 
\"enum\":"));
+assertTrue(json.contains("\"InOut\""));
 }
 
 @Test



[2/2] git commit: CAMEL-7494: Added support for enum for parameter json schema

2014-06-10 Thread davsclaus
CAMEL-7494: Added support for enum for parameter json schema


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

Branch: refs/heads/camel-2.13.x
Commit: 85f7778b24b261f43fd8a108290eaa349d3e3748
Parents: 0bc742b
Author: Claus Ibsen 
Authored: Tue Jun 10 15:16:44 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 15:17:41 2014 +0200

--
 .../org/apache/camel/impl/ParameterConfiguration.java  | 13 -
 ...aSetComponentConfigurationAndDocumentationTest.java |  2 ++
 2 files changed, 14 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/85f7778b/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
--
diff --git 
a/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java 
b/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
index af6883c..652746a 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/ParameterConfiguration.java
@@ -19,6 +19,7 @@ package org.apache.camel.impl;
 import java.lang.reflect.Field;
 
 import org.apache.camel.spi.UriParam;
+import org.apache.camel.util.CollectionStringBuffer;
 
 import static org.apache.camel.util.StringQuoteHelper.doubleQuote;
 
@@ -68,6 +69,16 @@ public class ParameterConfiguration {
 String typeName = parameterType.getCanonicalName();
 // TODO would be nice to add a description; wonder if we can find that 
from somewhere
 // generated by the APT tool?
-return doubleQuote(name) + ": { \"type\": " + doubleQuote(typeName) + 
" }";
+
+if (parameterType.isEnum()) {
+typeName = "string";
+CollectionStringBuffer sb = new CollectionStringBuffer();
+for (Object value : parameterType.getEnumConstants()) {
+sb.append(doubleQuote(value.toString()));
+}
+return doubleQuote(name) + ": { \"type\": " + 
doubleQuote(typeName) + ", \"enum\": [ " +  sb.toString() + " ] }";
+} else {
+return doubleQuote(name) + ": { \"type\": " + 
doubleQuote(typeName) + " }";
+}
 }
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/85f7778b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
--
diff --git 
a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
 
b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
index 41eb4a9..7b886d5 100644
--- 
a/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
+++ 
b/camel-core/src/test/java/org/apache/camel/component/dataset/DataSetComponentConfigurationAndDocumentationTest.java
@@ -43,6 +43,8 @@ public class 
DataSetComponentConfigurationAndDocumentationTest extends ContextTe
 
 assertTrue(json.contains("\"preloadSize\": { \"type\": \"long\" }"));
 assertTrue(json.contains("\"minRate\": { \"type\": \"int\" }"));
+assertTrue(json.contains("\"exchangePattern\": { \"type\": \"string\", 
\"enum\":"));
+assertTrue(json.contains("\"InOut\""));
 }
 
 @Test



[1/4] git commit: Fix for CAMEL-7486

2014-06-10 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/master dbc6dcce9 -> bd1045705


Fix for CAMEL-7486


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

Branch: refs/heads/master
Commit: 30f18e3f4c3211768b365c86a3b0f8c5be38e4b9
Parents: 86797a3
Author: Kevin Earls 
Authored: Tue Jun 10 13:53:38 2014 +0200
Committer: Kevin Earls 
Committed: Tue Jun 10 13:54:23 2014 +0200

--
 .../component/mybatis/MyBatisComponent.java |  9 +++-
 .../component/mybatis/MyBatisEndpoint.java  |  5 ++
 ...ponentConfigurationAndDocumentationTest.java | 57 
 3 files changed, 69 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/30f18e3f/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
--
diff --git 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
index 3650d7e..4a8585f 100644
--- 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
+++ 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisComponent.java
@@ -20,8 +20,9 @@ import java.io.IOException;
 import java.io.InputStream;
 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;
 import org.apache.camel.util.IOHelper;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ResourceHelper;
@@ -31,11 +32,15 @@ import org.apache.ibatis.session.SqlSessionFactoryBuilder;
 /**
  * @version 
  */
-public class MyBatisComponent extends DefaultComponent {
+public class MyBatisComponent extends UriEndpointComponent {
 
 private SqlSessionFactory sqlSessionFactory;
 private String configurationUri = "SqlMapConfig.xml";
 
+public MyBatisComponent() {
+super(MyBatisEndpoint.class);
+}
+
 @Override
 protected Endpoint createEndpoint(String uri, String remaining, 
Map parameters) throws Exception {
 MyBatisEndpoint answer = new MyBatisEndpoint(uri, this, remaining);

http://git-wip-us.apache.org/repos/asf/camel/blob/30f18e3f/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
--
diff --git 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
index f9a82e9..ae8511d 100644
--- 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
+++ 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
@@ -23,6 +23,8 @@ import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
 import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.camel.spi.UriEndpoint;
+import org.apache.camel.spi.UriParam;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.ibatis.session.ExecutorType;
 import org.apache.ibatis.session.SqlSessionFactory;
@@ -30,12 +32,15 @@ import org.apache.ibatis.session.SqlSessionFactory;
 /**
  * @version 
  */
+@UriEndpoint(scheme = "mybatis", consumerClass =  MyBatisConsumer.class)
 public class MyBatisEndpoint extends DefaultPollingEndpoint {
 
 private MyBatisProcessingStrategy processingStrategy;
+@UriParam
 private String statement;
 private StatementType statementType;
 private ExecutorType executorType;
+@UriParam
 private int maxMessagesPerPoll;
 
 public MyBatisEndpoint() {

http://git-wip-us.apache.org/repos/asf/camel/blob/30f18e3f/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisComponentConfigurationAndDocumentationTest.java
--
diff --git 
a/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisComponentConfigurationAndDocumentationTest.java
 
b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisComponentConfigurationAndDocumentationTest.java
new file mode 100644
index 000..0133b97
--- /dev/null
+++ 
b/components/camel-mybatis/src/test/java/org/apache/camel/component/mybatis/MyBatisComponentConfigurationAndDocumentationTest.java
@@ -0,0 +1,57 @@
+/**
+ * Licens

[2/4] git commit: Merge branch 'CAMEL-7482' of https://github.com/kevinearls/camel

2014-06-10 Thread davsclaus
Merge branch 'CAMEL-7482' of https://github.com/kevinearls/camel


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

Branch: refs/heads/master
Commit: f6fe64343b447655dbd7dfbc633c523e3d9a9196
Parents: dbc6dcc 30f18e3
Author: Claus Ibsen 
Authored: Tue Jun 10 14:15:52 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 14:15:52 2014 +0200

--
 .../component/mybatis/MyBatisComponent.java |  9 +++-
 .../component/mybatis/MyBatisEndpoint.java  |  5 ++
 ...ponentConfigurationAndDocumentationTest.java | 57 
 3 files changed, 69 insertions(+), 2 deletions(-)
--




[3/4] git commit: Polished

2014-06-10 Thread davsclaus
Polished


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

Branch: refs/heads/master
Commit: fc23b55bcc7817bef08e20a584094f53300ae137
Parents: f6fe643
Author: Claus Ibsen 
Authored: Tue Jun 10 14:19:03 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 14:19:03 2014 +0200

--
 .../org/apache/camel/component/mybatis/MyBatisEndpoint.java   | 7 ++-
 1 file changed, 2 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/fc23b55b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
--
diff --git 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
index ae8511d..ea944ce 100644
--- 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
+++ 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
@@ -35,7 +35,7 @@ import org.apache.ibatis.session.SqlSessionFactory;
 @UriEndpoint(scheme = "mybatis", consumerClass =  MyBatisConsumer.class)
 public class MyBatisEndpoint extends DefaultPollingEndpoint {
 
-private MyBatisProcessingStrategy processingStrategy;
+private MyBatisProcessingStrategy processingStrategy = new 
DefaultMyBatisProcessingStrategy();
 @UriParam
 private String statement;
 private StatementType statementType;
@@ -106,10 +106,7 @@ public class MyBatisEndpoint extends 
DefaultPollingEndpoint {
 this.executorType = ExecutorType.valueOf(executorType.toUpperCase());
 }
 
-public synchronized MyBatisProcessingStrategy getProcessingStrategy() {
-if (processingStrategy == null) {
-processingStrategy = new DefaultMyBatisProcessingStrategy();
-}
+public MyBatisProcessingStrategy getProcessingStrategy() {
 return processingStrategy;
 }
 



[4/4] git commit: CAMEL-7486: add statement type as uri param

2014-06-10 Thread davsclaus
CAMEL-7486: add statement type as uri param


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

Branch: refs/heads/master
Commit: bd104570520861002a9d25c61c01781b62ce3c79
Parents: fc23b55
Author: Claus Ibsen 
Authored: Tue Jun 10 14:21:24 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 14:21:24 2014 +0200

--
 .../java/org/apache/camel/component/mybatis/MyBatisEndpoint.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/bd104570/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
--
diff --git 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
index ea944ce..e11c8ca 100644
--- 
a/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
+++ 
b/components/camel-mybatis/src/main/java/org/apache/camel/component/mybatis/MyBatisEndpoint.java
@@ -36,10 +36,11 @@ import org.apache.ibatis.session.SqlSessionFactory;
 public class MyBatisEndpoint extends DefaultPollingEndpoint {
 
 private MyBatisProcessingStrategy processingStrategy = new 
DefaultMyBatisProcessingStrategy();
+private ExecutorType executorType;
 @UriParam
 private String statement;
+@UriParam
 private StatementType statementType;
-private ExecutorType executorType;
 @UriParam
 private int maxMessagesPerPoll;
 



[2/6] git commit: Upgraded splunk

2014-06-10 Thread davsclaus
Upgraded splunk


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

Branch: refs/heads/master
Commit: e403ba1d878caeffee7c663b69966d0cd15be6e4
Parents: 631860c
Author: Claus Ibsen 
Authored: Tue Jun 10 13:38:05 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:38:05 2014 +0200

--
 parent/pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/e403ba1d/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 36bd447..09792b7 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -372,7 +372,7 @@
 4.6.1_1
 4.6.1
 [4.5,5)
-1.2.0_1
+1.3.0_1
 2.2.5.RELEASE
 1.2.0
 1.5.0.RELEASE



[5/6] git commit: Upgrade AWS

2014-06-10 Thread davsclaus
Upgrade AWS

Conflicts:
parent/pom.xml


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

Branch: refs/heads/camel-2.13.x
Commit: 7bcf45efc6ea34d5aac0161522f2cc8c36f9095a
Parents: e7c6a8e
Author: Claus Ibsen 
Authored: Tue Jun 10 13:35:47 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:58:39 2014 +0200

--
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/7bcf45ef/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 5914b59..a107097 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -59,8 +59,8 @@
 4.3.1
 1.7.6
 1.7.6_1
-1.7.1_1
-1.7.1
+1.7.12_1
+1.7.12
 1.2.14
 3.1
 5.2_4



[6/6] git commit: Upgraded mustache

2014-06-10 Thread davsclaus
Upgraded mustache


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

Branch: refs/heads/camel-2.13.x
Commit: 0bc742b63cf72c12ea1bbf9ba59657ef55dcc125
Parents: 7bcf45e
Author: Claus Ibsen 
Authored: Tue Jun 10 13:40:00 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:58:57 2014 +0200

--
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/0bc742b6/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index a107097..cb6cfed 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -307,8 +307,8 @@
 2.11.4
 1.10
 20050913
-0.8.13
-0.8.13_1/
+0.8.15
+0.8.15_1/
 2.1.7.Final
 3.2.7
 3.0.1



[1/6] git commit: Upgrade AWS

2014-06-10 Thread davsclaus
Repository: camel
Updated Branches:
  refs/heads/camel-2.13.x e7c6a8e1e -> 0bc742b63
  refs/heads/master 86797a341 -> dbc6dcce9


Upgrade AWS


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

Branch: refs/heads/master
Commit: 631860c9b5b28879d212432b9cfeeefb8a123187
Parents: 86797a3
Author: Claus Ibsen 
Authored: Tue Jun 10 13:35:47 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:35:47 2014 +0200

--
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/631860c9/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 21c9748..36bd447 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -60,8 +60,8 @@
 4.3.1
 1.7.6
 1.7.6_1
-1.7.5_1
-1.7.5
+1.7.12_1
+1.7.12
 1.2.14
 3.1
 5.2_4



[3/6] git commit: Upgraded mustache

2014-06-10 Thread davsclaus
Upgraded mustache


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

Branch: refs/heads/master
Commit: 23496f395b333960e847f01b6b8fb9a543c14485
Parents: e403ba1
Author: Claus Ibsen 
Authored: Tue Jun 10 13:40:00 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:40:00 2014 +0200

--
 parent/pom.xml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/23496f39/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 09792b7..9c4bd60 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -302,8 +302,8 @@
 2.12.0
 1.10
 20050913
-0.8.13
-0.8.13_1/
+0.8.15
+0.8.15_1/
 2.1.7.Final
 3.2.7
 3.0.1



[4/6] git commit: Upgraded apid

2014-06-10 Thread davsclaus
Upgraded apid


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

Branch: refs/heads/master
Commit: dbc6dcce931860dc4b9f3d2c4de3c32259c609d7
Parents: 23496f3
Author: Claus Ibsen 
Authored: Tue Jun 10 13:57:36 2014 +0200
Committer: Claus Ibsen 
Committed: Tue Jun 10 13:57:36 2014 +0200

--
 .../main/java/org/apache/camel/component/amqp/AMQPComponent.java | 4 ++--
 .../test/java/org/apache/camel/component/amqp/AMQPRouteTest.java | 3 ++-
 parent/pom.xml   | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)
--


http://git-wip-us.apache.org/repos/asf/camel/blob/dbc6dcce/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
--
diff --git 
a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
 
b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
index 710158e..e889a85 100644
--- 
a/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
+++ 
b/components/camel-amqp/src/main/java/org/apache/camel/component/amqp/AMQPComponent.java
@@ -30,8 +30,6 @@ import org.apache.qpid.client.AMQConnectionFactory;
 
 /**
  * This component supports the AMQP protocol using the Client API of the 
Apache Qpid project.
- * 
- * @version 
  */
 public class AMQPComponent extends JmsComponent {
 
@@ -56,9 +54,11 @@ public class AMQPComponent extends JmsComponent {
 }
 return new AMQPComponent(ConnectionFactoryImpl.createFromURL(uri));
 }
+
 public static Component amqpComponentOld(String uri) throws 
URISyntaxException {
 return new AMQPComponent(new AMQConnectionFactory(uri));
 }
+
 public static Component amqpComponent(String uri) throws 
MalformedURLException {
 return new AMQPComponent(ConnectionFactoryImpl.createFromURL(uri));
 }

http://git-wip-us.apache.org/repos/asf/camel/blob/dbc6dcce/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
--
diff --git 
a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
 
b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
index 952ea7f..b388698 100644
--- 
a/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
+++ 
b/components/camel-amqp/src/test/java/org/apache/camel/component/amqp/AMQPRouteTest.java
@@ -74,7 +74,7 @@ public class AMQPRouteTest extends CamelTestSupport {
 protected CamelContext createCamelContext() throws Exception {
 CamelContext camelContext = super.createCamelContext();
 camelContext.addComponent("amqp0-9", 
amqpComponent("amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'", 
true));
-camelContext.addComponent("amqp1-0", 
amqpComponent("amqp://guest:guest@/test?brokerlist='tcp://localhost:5672'", 
false));
+camelContext.addComponent("amqp1-0", 
amqpComponent("amqp://guest:guest@localhost:5672?remote-host=test", false));
 return camelContext;
 }
 
@@ -84,6 +84,7 @@ public class AMQPRouteTest extends CamelTestSupport {
 from("amqp0-9:queue:ping")
 .to("log:routing")
 .to("mock:result");
+
 from("amqp1-0:queue:ping")
 .to("log:routing")
 .to("mock:result");

http://git-wip-us.apache.org/repos/asf/camel/blob/dbc6dcce/parent/pom.xml
--
diff --git a/parent/pom.xml b/parent/pom.xml
index 9c4bd60..8acc316 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -333,8 +333,8 @@
 0.2.1  
 1.5.1
 2.5.0
-0.26_1
-0.26
+0.28_1
+0.28
 1.8.6_1
 1.8.6
 [1.8,2)



svn commit: r912089 - in /websites/production/camel/content: cache/main.pageCache user-stories.html

2014-06-10 Thread buildbot
Author: buildbot
Date: Tue Jun 10 08:18:06 2014
New Revision: 912089

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/user-stories.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/user-stories.html
==
--- websites/production/camel/content/user-stories.html (original)
+++ websites/production/camel/content/user-stories.html Tue Jun 10 08:18:06 2014
@@ -75,22 +75,7 @@

 
 
-User 
Stories
-
-This page is intended as a place to collect user stories and feedback on 
Apache Camel. If you are using or have tried Apache Camel please add an entry 
or comment; or post to the Discussion Forums.
-
- Company or Project 
 Description 
 http://activemq.apache.org/";>Apache 
ActiveMQ  Uses 
Camel to add Enterprise Integration Patterns 
support into the http://activemq.apache.org/enterprise-integration-patterns.html";>ActiveMQ 
broker. If you run an out of the box ActiveMQ broker, look in 
conf/camel.xml and you'll see  with some 
example routing rules. Can be used to bridge ActiveMQ with any of the camel Components.  http://servicemix.apache.org/home.html";>Apache ServiceMix 
 Uses Camel as a 
routing engine as a http://servicemix.apache.org/servicemix-camel.html";>JBI service unit 
for use either in JBI or OSGi to route 
between JBI endpoints. See the http://servicemix.apache.org/3-beginner-using-apache-camel-inside-servicemix.html";>tutorial
 or http://servicemix.apache.org/camel-example.html";>example 
 http://fusesource.com/products/enterprise-camel/"; rel="nofollow">Fuse 
Mediation Router  http://fusesource.com/"; rel="nofollow">FuseSource 
provides a commercial distribution of Camel complete with additional features 
and support as well as improved documenation and samples.  http://fusesource.com/products/enterprise-servicemix/"; 
rel="nofollow">Fuse ESB  http://fusesource.com/"; rel="nofollow">FuseSource provides a 
commercial distribution of http://servicemix.apache.org/home.html";>Apache ServiceMix which 
includes http://fusesource.com/products/enterprise-camel/"; rel="nofollow">FUSE 
Mediation Router which is a distribution of Camel  http://fusesource.com/products/fuse-ide-camel/"; 
rel="nofollow">Fuse IDE  http://fusesource.com/"; rel="nofollow">FuseSource provides developer 
tooling for Camel, ServiceMix, and ActiveMQ. Fuse IDE for Camel is a graphical, 
Eclipse-based tool for integrating software components that works with Apache 
Camel or Fuse Mediation Router.  http://hawt.io/"; rel="nofollow">hawt.io  hawt.io is an open source HTML5 web 
application for visualising, managing and tracing Camel routes & endpoints, 
ActiveMQ brokers, JMX, OSGi and logging.  http://grails.org"; rel="nofollow">Grails
   The http://grails.org/plugin/routing"; 
rel="nofollow">Grails Camel Routing Plugin provides integration of Camel 
into Grails  http://wiki.open-esb.java.net/Wiki.jsp?page=CamelSE"; rel="nofollow">Open 
ESB Camel SE  
Provides a JBI Service Engine for https://open-esb.dev.java.net/"; rel="nofollow">Open ESB.  See the http://blogs.sun.com/polyblog/entry/camel_fuji"; rel="nofollow">example 
using OpenESB and Fuji  http://www.subrecord.org/"; rel="nofollow">SubRecord  Uses Camel for routing and EDA processing 
 http://openehealth.org/display/ipf2/Home"; rel="nofollow">Open eHealth 
Integration Platform  The Open eHealth Integration Platform (IPF) is an 
extension of the Apache Camel routing and mediation engine. It has an 
application programming layer based on the Groovy programming language and 
comes with comprehensive support for message processing and connecting systems 
in the eHealth domain.  http://code.google.com/p/camel-soap/"; rel="nofollow">Camel SOAP 
 Zero code WSDL 
based SOAP Client component for Apache Camel.  http://www.opensplice.com/section-item.asp?id=964"; 
rel="nofollow">PrismTech  PrismTech Simplifies Systems Integration & SOA 
Connectivity with Release of Open Source OpenSplice DDS Connector for Apache 
Camel.  
http://github.com/hyperthunk/axiom"; 
rel="nofollow">Axiom  Axiom is is a framework for testing integration 
scenarios and uses Apache Camel to interact with your integration stack. 
 http://www.regionh.dk/English/English.htm"; rel="nofollow">Capital Region 
of Denmark  
Chose to switch proprietary ESB to
  open source Apache Camel.  http://www.arla.com/"; rel="nofollow">Arla Foods  Uses Camel to integrate 
business backend with web application for farmers to access information about 
quality of their delivered milk. Application used in numerous european 
countries.  http://akkasource.org/"; rel="nofollow">Akka  Akka uses Apache Camel to implement 
additional messaging interfaces for http://do

svn commit: r912086 - in /websites/production/camel/content: cache/main.pageCache component-list-external.html components.html transport.html uris.html

2014-06-10 Thread buildbot
Author: buildbot
Date: Tue Jun 10 07:17:54 2014
New Revision: 912086

Log:
Production update by buildbot for camel

Modified:
websites/production/camel/content/cache/main.pageCache
websites/production/camel/content/component-list-external.html
websites/production/camel/content/components.html
websites/production/camel/content/transport.html
websites/production/camel/content/uris.html

Modified: websites/production/camel/content/cache/main.pageCache
==
Binary files - no diff available.

Modified: websites/production/camel/content/component-list-external.html
==
--- websites/production/camel/content/component-list-external.html (original)
+++ websites/production/camel/content/component-list-external.html Tue Jun 10 
07:17:54 2014
@@ -101,7 +101,13 @@
 GPLFor using a db4o datastore as a queue via the http://www.db4o.com/"; 
rel="nofollow">db4o libraryEsper / 
camel-esper in http://code.google.com/p/camel-extra/"; 
rel="nofollow">camel-extra
 
-GPLWorking with the http://esper.codehaus.org"; rel="nofollow">Esper Library for Event 
Stream ProcessingHibernate / 
camel-hibernate in http://code.google.com/p/camel-extra/"; 
rel="nofollow">camel-extra
+GPLWorking with the http://esper.codehaus.org"; rel="nofollow">Esper Library for Event 
Stream ProcessingFabric http://fabric8.io/gitbook/camelEndpointAmq.html"; rel="nofollow">AMQ / 
mq-fabric-camel in http://code.google.com/p/camel-extra/"; rel="nofollow">http://code.google.com/p/camel-extra/"; 
rel="nofollow">fhttp://fabric8.io/"; rel="nofollow">abric8
+
+ApacheThe http://fabric8.io/gitbook/camelEndpointAmq.html"; 
rel="nofollow">amq: endpoint works exactly like the 
activemq: endpoint in Apache Camel; only it uses the http://fabric8.io/"; 
rel="nofollow">fabric to automatically discover the broker. So there is no 
configuration required; it'll just work out of the box and automatically 
discover whatever ActiveMQ message brokers are available; with failover and 
load balancing.Fabric http://fabric8.io/gitbook/camelEndpointFabric.html"; 
rel="nofollow">Fabric / fabric-camel in http://code.google.com/p/ca
 mel-extra/" rel="nofollow">http://code.google.com/p/camel-extra/"; rel="nofollow">fhttp://fabric8.io/"; 
rel="nofollow">abric8
+
+ApacheThe http://fabric8.io/gitbook/camelEndpointFabric.html"; 
rel="nofollow">fabric: endpoint uses Fabric's discovery mechanism 
to expose physical sockets, HTTP endpoints, etc. into the http://fabric8.io/gitbook/registry.html"; 
rel="nofollow">runtime registry using a logical name so that clients can 
use the existing Camel Load 
Balancer.Fabric http://fabric8.io/gitbook/camelEndpointMaster.html"; 
rel="nofollow">Master / fabric-camel in http://code.google.com/p/camel-extra/"; 
rel="nofollow">http://co
 de.google.com/p/camel-extra/" rel="nofollow">fhttp://fabric8.io/"; 
rel="nofollow">abric8
+
+ApacheThe http://fabric8.io/gitbook/camelEndpointMaster.html"; 
rel="nofollow">master: endpoint provides a way to ensure only a 
single consumer in a cluster consumes from a given endpoint; with automatic 
failover if that JVM dies.Hibernate / 
camel-hibernate in http://code.google.com/p/camel-extra/"; 
rel="nofollow">camel-extra
 
 GPLFor using a database as a queue via the http://www.hibernate.org/"; 
rel="nofollow">Hibernate libraryJBI / 
servicemix-camel

Modified: websites/production/camel/content/components.html
==
--- websites/production/camel/content/components.html (original)
+++ websites/production/camel/content/components.html Tue Jun 10 07:17:54 2014
@@ -574,7 +574,13 @@ disruptor-vm:someName[?