camel git commit: CAMEL-11332: Add missing karaf and springboot tests
Repository: camel Updated Branches: refs/heads/master 1c539f42e -> ba392812e CAMEL-11332: Add missing karaf and springboot tests Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ba392812 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ba392812 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ba392812 Branch: refs/heads/master Commit: ba392812edb83f49026b40acd7fafb698cbbf1a7 Parents: 1c539f4 Author: Dmitry VolodinAuthored: Fri Jun 2 16:38:37 2017 +0300 Committer: Claus Ibsen Committed: Fri Jun 2 20:58:53 2017 +0200 -- .../camel/itest/karaf/CamelThriftTest.java | 34 ++ .../camel/itest/springboot/CamelThriftTest.java | 48 2 files changed, 82 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ba392812/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelThriftTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelThriftTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelThriftTest.java new file mode 100644 index 000..b5f3e16 --- /dev/null +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelThriftTest.java @@ -0,0 +1,34 @@ +/** + * 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.itest.karaf; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.ops4j.pax.exam.junit.PaxExam; + +@RunWith(PaxExam.class) +public class CamelThriftTest extends BaseKarafTest { + +public static final String COMPONENT = extractName(CamelThriftTest.class); + +@Test +public void test() throws Exception { +testDataFormat(COMPONENT); +} + + +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/ba392812/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelThriftTest.java -- diff --git a/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelThriftTest.java b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelThriftTest.java new file mode 100644 index 000..ac388de --- /dev/null +++ b/tests/camel-itest-spring-boot/src/test/java/org/apache/camel/itest/springboot/CamelThriftTest.java @@ -0,0 +1,48 @@ +/** + * 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.itest.springboot; + +import org.apache.camel.itest.springboot.util.ArquillianPackager; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.junit.Test; +import org.junit.runner.RunWith; + + +@RunWith(Arquillian.class) +public class CamelThriftTest extends AbstractSpringBootTestSupport { + +@Deployment +public static Archive createSpringBootPackage() throws Exception { +return ArquillianPackager.springBootPackage(createTestConfig()); +} + +public static ITestConfig createTestConfig() { +return new ITestConfigBuilder() +
camel git commit: Polish
Repository: camel Updated Branches: refs/heads/master e9996b21b -> 1c539f42e Polish Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1c539f42 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c539f42 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c539f42 Branch: refs/heads/master Commit: 1c539f42eefd20db6840207968da7c060bca05ac Parents: e9996b2 Author: Claus IbsenAuthored: Fri Jun 2 14:42:23 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 14:42:23 2017 +0200 -- .../main/java/org/apache/camel/language/simple/SimpleTokenizer.java | 1 - 1 file changed, 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1c539f42/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java b/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java index ddb3ee4..4718cbe 100644 --- a/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java +++ b/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java @@ -18,7 +18,6 @@ package org.apache.camel.language.simple; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; -import java.util.concurrent.atomic.AtomicBoolean; import org.apache.camel.language.simple.types.SimpleToken; import org.apache.camel.language.simple.types.SimpleTokenType;
camel git commit: CAMEL-11373: Add camel-twilio Karaf feature and update doc
Repository: camel Updated Branches: refs/heads/master 5c8fd80ad -> e9996b21b CAMEL-11373: Add camel-twilio Karaf feature and update doc Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e9996b21 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e9996b21 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e9996b21 Branch: refs/heads/master Commit: e9996b21b0117967852e15504f22583640115199 Parents: 5c8fd80 Author: Tadayoshi SatoAuthored: Fri Jun 2 21:34:46 2017 +0900 Committer: Claus Ibsen Committed: Fri Jun 2 14:40:48 2017 +0200 -- .../camel/component/twilio/TwilioEndpoint.java | 2 +- components/readme.adoc | 2 +- .../features/src/main/resources/features.xml| 9 ++ .../camel/itest/karaf/CamelTwilioTest.java | 33 4 files changed, 44 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e9996b21/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java -- diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java index 83c4d28..0df521b 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioEndpoint.java @@ -39,7 +39,7 @@ import org.apache.camel.util.component.ApiMethod; import org.apache.camel.util.component.ApiMethodPropertiesHelper; /** - * Represents a Twilio endpoint. + * The Twilio component allows you to interact with the Twilio REST APIs using Twilio Java SDK. */ @UriEndpoint(firstVersion = "2.20.0", scheme = "twilio", title = "Twilio", syntax = "twilio:apiName/methodName", consumerClass = TwilioConsumer.class, label = "api,messaging,cloud") http://git-wip-us.apache.org/repos/asf/camel/blob/e9996b21/components/readme.adoc -- diff --git a/components/readme.adoc b/components/readme.adoc index 2b69cbf..efb0aa0 100644 --- a/components/readme.adoc +++ b/components/readme.adoc @@ -744,7 +744,7 @@ Number of Components: 266 in 186 JAR artifacts (16 deprecated) `timer:timerName` | 1.0 | The timer component is used for generating message exchanges when a timer fires. | link:camel-twilio/src/main/docs/twilio-component.adoc[Twilio] (camel-twilio) + -`twilio:apiName/methodName` | 2.20 | Represents a Twilio endpoint. +`twilio:apiName/methodName` | 2.20 | The Twilio component allows you to interact with the Twilio REST APIs using Twilio Java SDK. | link:camel-twitter/src/main/docs/twitter-component.adoc[Twitter] (camel-twitter) + `twitter:kind` | 2.10 | *deprecated* Use twitter-directmessage twitter-search twitter-streaming and twitter-timeline instead of this component. http://git-wip-us.apache.org/repos/asf/camel/blob/e9996b21/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 677fd9a..6d556d2 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -1959,6 +1959,15 @@ camel-core mvn:org.apache.camel/camel-tika/${project.version} + +camel-core +wrap:mvn:com.twilio.sdk/twilio/${twilio-version} +mvn:joda-time/joda-time/${jodatime2-bundle-version} +mvn:com.fasterxml.jackson.core/jackson-core/${jackson2-version} +mvn:com.fasterxml.jackson.core/jackson-databind/${jackson2-version} +mvn:com.fasterxml.jackson.core/jackson-annotations/${jackson2-version} +mvn:org.apache.camel/camel-twilio/${project.version} + camel-core mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.twitter4j/${twitter4j-bundle-version} http://git-wip-us.apache.org/repos/asf/camel/blob/e9996b21/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelTwilioTest.java -- diff --git a/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelTwilioTest.java b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelTwilioTest.java new file mode 100644 index 000..b67178f --- /dev/null +++ b/tests/camel-itest-karaf/src/test/java/org/apache/camel/itest/karaf/CamelTwilioTest.java @@ -0,0 +1,33 @@ +/** + * Licensed to the Apache Software Foundation
camel git commit: Optimise - Make check if expression has simple start token quicker without object allocations needed.
Repository: camel Updated Branches: refs/heads/master 7d17d44a4 -> 5c8fd80ad Optimise - Make check if expression has simple start token quicker without object allocations needed. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5c8fd80a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5c8fd80a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5c8fd80a Branch: refs/heads/master Commit: 5c8fd80ad4960db65a7c369d6d0524fc57155fd9 Parents: 7d17d44 Author: Claus IbsenAuthored: Fri Jun 2 13:55:46 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 13:55:46 2017 +0200 -- .../camel/language/simple/SimpleTokenizer.java | 27 1 file changed, 16 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5c8fd80a/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java -- diff --git a/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java b/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java index 7c3aa1b..ddb3ee4 100644 --- a/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java +++ b/camel-core/src/main/java/org/apache/camel/language/simple/SimpleTokenizer.java @@ -18,6 +18,7 @@ package org.apache.camel.language.simple; import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.atomic.AtomicBoolean; import org.apache.camel.language.simple.types.SimpleToken; import org.apache.camel.language.simple.types.SimpleTokenType; @@ -32,6 +33,9 @@ public final class SimpleTokenizer { // use CopyOnWriteArrayList so we can modify it in the for loop when changing function start/end tokens private static final List KNOWN_TOKENS = new CopyOnWriteArrayList(); +// optimise to be able to quick check for start functions +private static final String[] FUNCTION_START = new String[]{"${", "$simple{"}; + static { // add known tokens KNOWN_TOKENS.add(new SimpleTokenType(TokenType.functionStart, "${")); @@ -93,16 +97,7 @@ public final class SimpleTokenizer { */ public static boolean hasFunctionStartToken(String expression) { if (expression != null) { -for (SimpleTokenType type : KNOWN_TOKENS) { -if (type.getType() == TokenType.functionStart) { -if (expression.contains(type.getValue())) { -return true; -} -} else { -// function start are always first -return false; -} -} +return expression.contains(FUNCTION_START[0]) || expression.contains(FUNCTION_START[1]); } return false; } @@ -117,8 +112,18 @@ public final class SimpleTokenizer { } } +if (startToken.length > 2) { +throw new IllegalArgumentException("At most 2 start tokens is allowed"); +} + +// reset +FUNCTION_START[0] = ""; +FUNCTION_START[1] = ""; + // add in start of list as its a more common token to be used -for (String token : startToken) { +for (int i = 0; i < startToken.length; i++) { +String token = startToken[i]; +FUNCTION_START[i] = token; KNOWN_TOKENS.add(0, new SimpleTokenType(TokenType.functionStart, token)); } }
camel git commit: Add to kit
Repository: camel Updated Branches: refs/heads/master 7cd23b0a3 -> 7d17d44a4 Add to kit Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d17d44a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d17d44a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d17d44a Branch: refs/heads/master Commit: 7d17d44a46849e42a338f0ebc6a48700b83cbb67 Parents: 7cd23b0 Author: Claus IbsenAuthored: Fri Jun 2 13:32:23 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 13:32:23 2017 +0200 -- apache-camel/pom.xml | 19 +++ apache-camel/src/main/descriptors/common-bin.xml | 3 +++ parent/pom.xml | 5 + 3 files changed, 27 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7d17d44a/apache-camel/pom.xml -- diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index 3c8b259..08de3f0 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -1035,6 +1035,10 @@ org.apache.camel + camel-thrift + + + org.apache.camel camel-tika @@ -2209,6 +2213,21 @@ org.apache.camel + camel-thrift-starter + ${project.version} + + + org.apache.camel + camel-tika-starter + ${project.version} + + + org.apache.camel + camel-twilio-starter + ${project.version} + + + org.apache.camel camel-twitter-starter ${project.version} http://git-wip-us.apache.org/repos/asf/camel/blob/7d17d44a/apache-camel/src/main/descriptors/common-bin.xml -- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 2073939..85e28f2 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -266,6 +266,7 @@ org.apache.camel:camel-test-karaf org.apache.camel:camel-test-spring org.apache.camel:camel-testng +org.apache.camel:camel-thrift org.apache.camel:camel-tika org.apache.camel:camel-twilio org.apache.camel:camel-twitter @@ -536,6 +537,8 @@ org.apache.camel:camel-tagsoup-starter org.apache.camel:camel-tarfile-starter org.apache.camel:camel-telegram-starter +org.apache.camel:camel-thrift-starter +org.apache.camel:camel-tika-starter org.apache.camel:camel-twilio-starter org.apache.camel:camel-twitter-starter org.apache.camel:camel-undertow-starter http://git-wip-us.apache.org/repos/asf/camel/blob/7d17d44a/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 5dd4f80..2634acd 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -2027,6 +2027,11 @@ org.apache.camel +camel-thrift +${project.version} + + +org.apache.camel camel-tika ${project.version}
[3/3] camel git commit: Regen
Regen Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7cd23b0a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7cd23b0a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7cd23b0a Branch: refs/heads/master Commit: 7cd23b0a3eeaafa3017a852325512fed71a6dbd7 Parents: 362a894 Author: Claus IbsenAuthored: Fri Jun 2 13:23:37 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 13:23:37 2017 +0200 -- camel-core/readme.adoc | 2 +- components/readme.adoc | 9 +++-- docs/user-manual/en/SUMMARY.md | 1 + .../spring-boot-dm/camel-spring-boot-dependencies/pom.xml | 5 + 4 files changed, 14 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7cd23b0a/camel-core/readme.adoc -- diff --git a/camel-core/readme.adoc b/camel-core/readme.adoc index f400b7f..6c4554c 100644 --- a/camel-core/readme.adoc +++ b/camel-core/readme.adoc @@ -103,7 +103,7 @@ Data Formats // dataformats: START -Number of Data Formats: 4 in 36 JAR artifacts (0 deprecated) +Number of Data Formats: 4 in 37 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== http://git-wip-us.apache.org/repos/asf/camel/blob/7cd23b0a/components/readme.adoc -- diff --git a/components/readme.adoc b/components/readme.adoc index f38e4ef..2b69cbf 100644 --- a/components/readme.adoc +++ b/components/readme.adoc @@ -2,7 +2,7 @@ Components ^^ // components: START -Number of Components: 265 in 185 JAR artifacts (16 deprecated) +Number of Components: 266 in 186 JAR artifacts (16 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -743,6 +743,9 @@ Number of Components: 265 in 185 JAR artifacts (16 deprecated) | link:../camel-core/src/main/docs/timer-component.adoc[Timer] (camel-core) + `timer:timerName` | 1.0 | The timer component is used for generating message exchanges when a timer fires. +| link:camel-twilio/src/main/docs/twilio-component.adoc[Twilio] (camel-twilio) + +`twilio:apiName/methodName` | 2.20 | Represents a Twilio endpoint. + | link:camel-twitter/src/main/docs/twitter-component.adoc[Twitter] (camel-twitter) + `twitter:kind` | 2.10 | *deprecated* Use twitter-directmessage twitter-search twitter-streaming and twitter-timeline instead of this component. @@ -811,7 +814,7 @@ Data Formats // dataformats: START -Number of Data Formats: 45 in 36 JAR artifacts (0 deprecated) +Number of Data Formats: 46 in 37 JAR artifacts (0 deprecated) [width="100%",cols="4,1,5",options="header"] |=== @@ -883,6 +886,8 @@ Number of Data Formats: 45 in 36 JAR artifacts (0 deprecated) | link:camel-tarfile/src/main/docs/tarfile-dataformat.adoc[Tar File] (camel-tarfile) | 2.16 | Camel Tar file support +| link:camel-thrift/src/main/docs/thrift-dataformat.adoc[Thrift] (camel-thrift) | 2.20 | Camel Apache Thrift data format and RPC support + | link:camel-tagsoup/src/main/docs/tidyMarkup-dataformat.adoc[TidyMarkup] (camel-tagsoup) | 2.0 | Camel TagSoup support | link:camel-univocity-parsers/src/main/docs/univocity-csv-dataformat.adoc[uniVocity CSV] (camel-univocity-parsers) | 2.15 | Camel UniVocity parsers data format support http://git-wip-us.apache.org/repos/asf/camel/blob/7cd23b0a/docs/user-manual/en/SUMMARY.md -- diff --git a/docs/user-manual/en/SUMMARY.md b/docs/user-manual/en/SUMMARY.md index b300274..c97e486 100644 --- a/docs/user-manual/en/SUMMARY.md +++ b/docs/user-manual/en/SUMMARY.md @@ -448,6 +448,7 @@ * [String Encoding](string-dataformat.adoc) * [Syslog](syslog-dataformat.adoc) * [Tar File](tarfile-dataformat.adoc) + * [Thrift](thrift-dataformat.adoc) * [TidyMarkup](tidyMarkup-dataformat.adoc) * [uniVocity CSV](univocity-csv-dataformat.adoc) * [uniVocity Fixed Length](univocity-fixed-dataformat.adoc) http://git-wip-us.apache.org/repos/asf/camel/blob/7cd23b0a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml -- diff --git a/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml b/platforms/spring-boot/spring-boot-dm/camel-spring-boot-dependencies/pom.xml index 69e2860..9687243 100644 ---
[2/3] camel git commit: CAMEL-11332: Create a new camel-thrift data format
CAMEL-11332: Create a new camel-thrift data format Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/362a8943 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/362a8943 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/362a8943 Branch: refs/heads/master Commit: 362a8943f9a12ab4cf5b99dfebf4ac51a777f58f Parents: 64e7388 Author: Dmitry VolodinAuthored: Mon May 29 11:42:37 2017 +0300 Committer: Claus Ibsen Committed: Fri Jun 2 12:58:50 2017 +0200 -- .../apache/camel/builder/DataFormatClause.java | 29 + .../apache/camel/model/MarshalDefinition.java | 2 + .../apache/camel/model/UnmarshalDefinition.java | 2 + .../model/dataformat/DataFormatsDefinition.java | 1 + .../model/dataformat/ThriftDataFormat.java | 107 +++ .../DataFormatTransformerDefinition.java| 2 + .../apache/camel/model/dataformat/jaxb.index| 1 + .../src/main/docs/protobuf-dataformat.adoc | 22 +- .../ProtobufMarshalAndUnmarshalSpringTest.java | 60 +- .../dataformat/protobuf/springDataFormat.xml| 21 +- components/camel-thrift/ReadMe.md | 30 + components/camel-thrift/pom.xml | 92 +++ .../src/main/docs/thrift-dataformat.adoc| 156 .../dataformat/thrift/ThriftDataFormat.java | 204 + .../src/main/resources/META-INF/LICENSE.txt | 203 + .../src/main/resources/META-INF/NOTICE.txt | 14 + .../services/org/apache/camel/dataformat/thrift | 18 + .../src/test/java/META-INF/MANIFEST.MF | 3 + .../ThriftMarshalAndUnmarshalJsonTest.java | 106 +++ .../ThriftMarshalAndUnmarshalSpringTest.java| 95 +++ .../thrift/ThriftMarshalAndUnmarshalTest.java | 108 +++ .../dataformat/thrift/generated/Operation.java | 55 ++ .../camel/dataformat/thrift/generated/Work.java | 735 +++ .../src/test/resources/log4j2.properties| 28 + .../dataformat/thrift/springDataFormat.xml | 57 ++ .../camel-thrift/src/test/thrift/readme.txt | 5 + .../src/test/thrift/tutorial-dataformat.thrift | 84 +++ components/pom.xml | 1 + .../src/main/resources/config.properties| 0 .../features/src/main/resources/features.xml| 6 + .../camel-thrift-starter/pom.xml| 61 ++ .../ThriftDataFormatAutoConfiguration.java | 129 .../ThriftDataFormatConfiguration.java | 76 ++ .../src/main/resources/META-INF/LICENSE.txt | 203 + .../src/main/resources/META-INF/NOTICE.txt | 11 + .../main/resources/META-INF/spring.factories| 19 + .../src/main/resources/META-INF/spring.provides | 17 + .../spring-boot/components-starter/pom.xml | 1 + 38 files changed, 2734 insertions(+), 30 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java -- diff --git a/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java b/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java index 0b18e91..ec719b8 100644 --- a/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java +++ b/camel-core/src/main/java/org/apache/camel/builder/DataFormatClause.java @@ -52,6 +52,7 @@ import org.apache.camel.model.dataformat.SoapJaxbDataFormat; import org.apache.camel.model.dataformat.StringDataFormat; import org.apache.camel.model.dataformat.SyslogDataFormat; import org.apache.camel.model.dataformat.TarFileDataFormat; +import org.apache.camel.model.dataformat.ThriftDataFormat; import org.apache.camel.model.dataformat.TidyMarkupDataFormat; import org.apache.camel.model.dataformat.XMLBeansDataFormat; import org.apache.camel.model.dataformat.XMLSecurityDataFormat; @@ -830,6 +831,34 @@ public class DataFormatClause> { public T syslog() { return dataFormat(new SyslogDataFormat()); } + +/** + * Uses the Thrift data format + */ +public T thrift() { +return dataFormat(new ThriftDataFormat()); +} + +public T thrift(Object defaultInstance) { +ThriftDataFormat dataFormat = new ThriftDataFormat(); +dataFormat.setDefaultInstance(defaultInstance); +return dataFormat(dataFormat); +} + +public T thrift(Object defaultInstance, String contentTypeFormat) { +ThriftDataFormat dataFormat = new ThriftDataFormat(); +dataFormat.setDefaultInstance(defaultInstance); +dataFormat.setContentTypeFormat(contentTypeFormat); +return dataFormat(dataFormat); +} + +public T thrift(String instanceClassName) { +return dataFormat(new ThriftDataFormat(instanceClassName)); +} + +
[1/3] camel git commit: CAMEL-11332: Create a new camel-thrift data format
Repository: camel Updated Branches: refs/heads/master 64e738852 -> 7cd23b0a3 http://git-wip-us.apache.org/repos/asf/camel/blob/362a8943/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java -- diff --git a/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java new file mode 100644 index 000..5e08c16 --- /dev/null +++ b/components/camel-thrift/src/test/java/org/apache/camel/dataformat/thrift/generated/Work.java @@ -0,0 +1,735 @@ +/** + * Autogenerated by Thrift Compiler (0.9.3) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.camel.dataformat.thrift.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import javax.annotation.Generated; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) +/** + * Structs are the basic complex data structures. They are comprised of fields + * which each have an integer identifier, a type, a symbolic name, and an + * optional default value. + * + * Fields can be declared "optional", which ensures they will not be included + * in the serialized output if they aren't set. Note that this requires some + * manual management in some languages. + */ +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2017-05-30") +public class Work implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Work"); + + private static final org.apache.thrift.protocol.TField NUM1_FIELD_DESC = new org.apache.thrift.protocol.TField("num1", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField NUM2_FIELD_DESC = new org.apache.thrift.protocol.TField("num2", org.apache.thrift.protocol.TType.I32, (short)2); + private static final org.apache.thrift.protocol.TField OP_FIELD_DESC = new org.apache.thrift.protocol.TField("op", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)4); + + private static final Map schemes = new HashMap (); + static { +schemes.put(StandardScheme.class, new WorkStandardSchemeFactory()); +schemes.put(TupleScheme.class, new WorkTupleSchemeFactory()); + } + + public int num1; // required + public int num2; // required + /** + * + * @see Operation + */ + public Operation op; // required + public String comment; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +NUM1((short)1, "num1"), +NUM2((short)2, "num2"), +/** + * + * @see Operation + */ +OP((short)3, "op"), +COMMENT((short)4, "comment"); + +private static final Map byName = new HashMap (); + +static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { +byName.put(field.getFieldName(), field); + } +} + +/** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ +public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { +case 1: // NUM1 + return NUM1; +case 2: // NUM2 + return NUM2; +case 3: // OP + return OP; +case 4: // COMMENT + return COMMENT; +default: + return null; + } +} + +/** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ +public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if
Message from KM_C224e
SKM_C224e14824461294.pdf Description: Adobe PDF document
[2/2] camel git commit: CAMEL-11369: camel-spring-boot-starter generator paste incorrect default value
CAMEL-11369: camel-spring-boot-starter generator paste incorrect default value Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/93ec3595 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/93ec3595 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/93ec3595 Branch: refs/heads/master Commit: 93ec35952feb5bdcd58a7ac6ad0f07307ed0d367 Parents: 7a83142 Author: Dmitry VolodinAuthored: Fri Jun 2 10:42:40 2017 +0300 Committer: Claus Ibsen Committed: Fri Jun 2 12:56:12 2017 +0200 -- .../camel/maven/packaging/SpringBootAutoConfigurationMojo.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/93ec3595/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index 7230dfe..0980afc 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -1054,7 +1054,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { prop.getField().getJavaDoc().setFullText(option.getDescription()); } if (!Strings.isBlank(option.getDefaultValue())) { -if ("java.lang.String".equals(option.getType())) { +if ("java.lang.String".equals(option.getJavaType())) { prop.getField().setStringInitializer(option.getDefaultValue()); } else if ("long".equals(option.getJavaType()) || "java.lang.Long".equals(option.getJavaType())) { // the value should be a Long number @@ -1149,7 +1149,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { prop.getField().getJavaDoc().setFullText(option.getDescription()); } if (!Strings.isBlank(option.getDefaultValue())) { -if ("java.lang.String".equals(option.getType())) { +if ("java.lang.String".equals(option.getJavaType())) { prop.getField().setStringInitializer(option.getDefaultValue()); } else if ("long".equals(option.getJavaType()) || "java.lang.Long".equals(option.getJavaType())) { // the value should be a Long number
[1/2] camel git commit: CAMEL-11369: regen components and add missing default values
Repository: camel Updated Branches: refs/heads/master 7a8314212 -> 64e738852 CAMEL-11369: regen components and add missing default values Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/64e73885 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/64e73885 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/64e73885 Branch: refs/heads/master Commit: 64e738852e4193524a821f37d1da77f60ad9127b Parents: 93ec359 Author: Dmitry VolodinAuthored: Fri Jun 2 11:49:13 2017 +0300 Committer: Claus Ibsen Committed: Fri Jun 2 12:56:12 2017 +0200 -- .../base64/springboot/Base64DataFormatConfiguration.java | 2 +- .../castor/springboot/CastorDataFormatConfiguration.java | 2 +- .../crypto/springboot/CryptoDataFormatConfiguration.java | 4 ++-- .../springboot/FlatpackDataFormatConfiguration.java | 4 ++-- .../springboot/MimeMultipartDataFormatConfiguration.java | 2 +- .../springboot/ProtobufDataFormatConfiguration.java | 3 +-- .../soap/springboot/SoapJaxbDataFormatConfiguration.java | 2 +- .../springboot/TidyMarkupDataFormatConfiguration.java | 2 +- .../springboot/UniVocityCsvDataFormatConfiguration.java | 10 +- .../UniVocityFixedWidthDataFormatConfiguration.java | 4 ++-- .../springboot/UniVocityTsvDataFormatConfiguration.java | 6 +++--- .../springboot/XMLSecurityDataFormatConfiguration.java| 8 12 files changed, 24 insertions(+), 25 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/64e73885/platforms/spring-boot/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java -- diff --git a/platforms/spring-boot/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java index 02c66a3..71c48bd 100644 --- a/platforms/spring-boot/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-base64-starter/src/main/java/org/apache/camel/dataformat/base64/springboot/Base64DataFormatConfiguration.java @@ -39,7 +39,7 @@ public class Base64DataFormatConfiguration /** * The line separators to use. By default \r\n is used. */ -private String lineSeparator; +private String lineSeparator = "\\r\\n"; /** * Instead of emitting '' and '/' we emit '-' and '_' respectively. urlSafe * is only applied to encode operations. Decoding seamlessly handles both http://git-wip-us.apache.org/repos/asf/camel/blob/64e73885/platforms/spring-boot/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java -- diff --git a/platforms/spring-boot/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java index 949e4cf..f425cc6 100644 --- a/platforms/spring-boot/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-castor-starter/src/main/java/org/apache/camel/dataformat/castor/springboot/CastorDataFormatConfiguration.java @@ -42,7 +42,7 @@ public class CastorDataFormatConfiguration /** * Encoding to use when marshalling an Object to XML. Is by default UTF-8 */ -private String encoding; +private String encoding = "UTF-8"; /** * Add additional packages to Castor XmlContext */ http://git-wip-us.apache.org/repos/asf/camel/blob/64e73885/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java -- diff --git a/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java b/platforms/spring-boot/components-starter/camel-crypto-starter/src/main/java/org/apache/camel/converter/crypto/springboot/CryptoDataFormatConfiguration.java index de42e1a..ca51dd1 100644 ---
[4/4] camel git commit: camel-spring-boot - Allow to configure if breadcrumb is in use or not.
camel-spring-boot - Allow to configure if breadcrumb is in use or not. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7a831421 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7a831421 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7a831421 Branch: refs/heads/master Commit: 7a8314212d4a273685e93ae401b805a42736e46f Parents: b646977 Author: Claus IbsenAuthored: Fri Jun 2 11:39:15 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 11:39:15 2017 +0200 -- .../camel/spring/boot/CamelAutoConfiguration.java | 1 + .../spring/boot/CamelConfigurationProperties.java | 13 + 2 files changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7a831421/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java index c05b66d..6b8ab26 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelAutoConfiguration.java @@ -156,6 +156,7 @@ public class CamelAutoConfiguration { camelContext.setHandleFault(config.isHandleFault()); camelContext.setAutoStartup(config.isAutoStartup()); camelContext.setAllowUseOriginalMessage(config.isAllowUseOriginalMessage()); +camelContext.setUseBreadcrumb(config.isUseBreadcrumb()); if (camelContext.getManagementStrategy().getManagementAgent() != null) { camelContext.getManagementStrategy().getManagementAgent().setEndpointRuntimeStatisticsEnabled(config.isEndpointRuntimeStatisticsEnabled()); http://git-wip-us.apache.org/repos/asf/camel/blob/7a831421/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java index 6d6aa29..6393682 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelConfigurationProperties.java @@ -301,6 +301,11 @@ public class CamelConfigurationProperties { private boolean endpointRuntimeStatisticsEnabled; /** + * Set whether breadcrumb is enabled. + */ +private boolean useBreadcrumb = true; + +/** * Sets the JMX statistics level * The level can be set to Extended to gather additional information * @@ -692,6 +697,14 @@ public class CamelConfigurationProperties { this.endpointRuntimeStatisticsEnabled = endpointRuntimeStatisticsEnabled; } +public boolean isUseBreadcrumb() { +return useBreadcrumb; +} + +public void setUseBreadcrumb(boolean useBreadcrumb) { +this.useBreadcrumb = useBreadcrumb; +} + public ManagementStatisticsLevel getJmxManagementStatisticsLevel() { return jmxManagementStatisticsLevel; }
[2/4] camel git commit: Optimise - Bean component - Dont set multi parameter header if not really needed. Also it should be deprecated as its some old cruft.
Optimise - Bean component - Dont set multi parameter header if not really needed. Also it should be deprecated as its some old cruft. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cec467ff Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cec467ff Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cec467ff Branch: refs/heads/master Commit: cec467ff7c512e9b04e05448273aa6938dc406a8 Parents: 40db0a7 Author: Claus IbsenAuthored: Fri Jun 2 11:14:08 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 11:16:09 2017 +0200 -- .../src/main/java/org/apache/camel/Exchange.java | 1 + .../component/bean/AbstractBeanProcessor.java | 16 ++-- .../apache/camel/component/bean/MethodInfo.java| 17 - 3 files changed, 19 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cec467ff/camel-core/src/main/java/org/apache/camel/Exchange.java -- diff --git a/camel-core/src/main/java/org/apache/camel/Exchange.java b/camel-core/src/main/java/org/apache/camel/Exchange.java index 87fcf13..56e0780 100644 --- a/camel-core/src/main/java/org/apache/camel/Exchange.java +++ b/camel-core/src/main/java/org/apache/camel/Exchange.java @@ -89,6 +89,7 @@ public interface Exchange { String BATCH_SIZE = "CamelBatchSize"; String BATCH_COMPLETE = "CamelBatchComplete"; String BEAN_METHOD_NAME = "CamelBeanMethodName"; +@Deprecated String BEAN_MULTI_PARAMETER_ARRAY = "CamelBeanMultiParameterArray"; String BINDING= "CamelBinding"; // do not prefix with Camel and use lower-case starting letter as its a shared key http://git-wip-us.apache.org/repos/asf/camel/blob/cec467ff/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java index 858253e..88d78c7 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java @@ -146,15 +146,15 @@ public abstract class AbstractBeanProcessor implements AsyncProcessor { } // set temporary header which is a hint for the bean info that introspect the bean -if (in.getHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY) == null) { -in.setHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY, isMultiParameterArray()); +if (isMultiParameterArray()) { +in.setHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY, Boolean.TRUE); } - -MethodInvocation invocation; // set explicit method name to invoke as a header, which is how BeanInfo can detect it if (explicitMethodName != null) { in.setHeader(Exchange.BEAN_METHOD_NAME, explicitMethodName); } + +MethodInvocation invocation; try { invocation = beanInfo.createInvocation(bean, exchange); } catch (Throwable e) { @@ -163,8 +163,12 @@ public abstract class AbstractBeanProcessor implements AsyncProcessor { return true; } finally { // must remove headers as they were provisional -in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY); -in.removeHeader(Exchange.BEAN_METHOD_NAME); +if (isMultiParameterArray()) { +in.removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY); +} +if (explicitMethodName != null) { +in.removeHeader(Exchange.BEAN_METHOD_NAME); +} } if (invocation == null) { http://git-wip-us.apache.org/repos/asf/camel/blob/cec467ff/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java index fa04efc..f2aedb9 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java @@ -639,14 +639,11 @@ public class MethodInfo { @SuppressWarnings("unchecked") public T evaluate(Exchange exchange, Class type) { Object body = exchange.getIn().getBody(); -boolean multiParameterArray = false; -if
[1/4] camel git commit: Optimise - No need to evalulate bean parameter arguments if the method has no parameters.
Repository: camel Updated Branches: refs/heads/master e5cbba043 -> 7a8314212 Optimise - No need to evalulate bean parameter arguments if the method has no parameters. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/40db0a7a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/40db0a7a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/40db0a7a Branch: refs/heads/master Commit: 40db0a7a6aa4a3f5eef19f04982d60b85787f657 Parents: e5cbba0 Author: Claus IbsenAuthored: Fri Jun 2 11:00:17 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 11:00:17 2017 +0200 -- .../java/org/apache/camel/component/bean/BeanInfo.java | 4 ++-- .../java/org/apache/camel/component/bean/MethodInfo.java | 11 +-- 2 files changed, 11 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/40db0a7a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 43ddb9b..00f6557 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -198,7 +198,7 @@ public class BeanInfo { for (List infos : operations.values()) { for (MethodInfo info : infos) { if (explicitMethod.equals(info.getMethod())) { -return info.createMethodInvocation(pojo, exchange); +return info.createMethodInvocation(pojo, info.hasParameters(), exchange); } } } @@ -293,7 +293,7 @@ public class BeanInfo { } if (methodInfo != null) { LOG.trace("Chosen method to invoke: {} on bean: {}", methodInfo, pojo); -return methodInfo.createMethodInvocation(pojo, exchange); +return methodInfo.createMethodInvocation(pojo, methodInfo.hasParameters(), exchange); } LOG.debug("Cannot find suitable method to invoke on bean: {}", pojo); http://git-wip-us.apache.org/repos/asf/camel/blob/40db0a7a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java index f3b7a4e..fa04efc 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java @@ -24,6 +24,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -243,8 +244,14 @@ public class MethodInfo { return method.toString(); } -public MethodInvocation createMethodInvocation(final Object pojo, final Exchange exchange) { -final Object[] arguments = parametersExpression.evaluate(exchange, Object[].class); +public MethodInvocation createMethodInvocation(final Object pojo, boolean hasParameters, final Exchange exchange) { +final Object[] arguments; +if (hasParameters) { + arguments = parametersExpression.evaluate(exchange, Object[].class); +} else { +arguments = null; +} + return new MethodInvocation() { public Method getMethod() { return method;
[3/4] camel git commit: Optimise - Bean component - Dont remove non existing header
Optimise - Bean component - Dont remove non existing header Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b646977b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b646977b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b646977b Branch: refs/heads/master Commit: b646977baa6421c55e2019fbdc1e2759beef0bae Parents: cec467f Author: Claus IbsenAuthored: Fri Jun 2 11:28:34 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 11:28:34 2017 +0200 -- .../main/java/org/apache/camel/component/bean/MethodInfo.java | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b646977b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java index f2aedb9..e384247 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/MethodInfo.java @@ -649,7 +649,7 @@ public class MethodInfo { // if there was an explicit method name to invoke, then we should support using // any provided parameter values in the method name -String methodName = exchange.getIn().getHeader(Exchange.BEAN_METHOD_NAME, "", String.class); +String methodName = exchange.getIn().getHeader(Exchange.BEAN_METHOD_NAME, String.class); // the parameter values is between the parenthesis String methodParameters = StringHelper.betweenOuterPair(methodName, '(', ')'); // use an iterator to walk the parameter values @@ -668,7 +668,9 @@ public class MethodInfo { if (multiParameterArray) { exchange.getIn().removeHeader(Exchange.BEAN_MULTI_PARAMETER_ARRAY); } -exchange.getIn().removeHeader(Exchange.BEAN_METHOD_NAME); +if (methodName != null) { +exchange.getIn().removeHeader(Exchange.BEAN_METHOD_NAME); +} Object[] answer = evaluateParameterExpressions(exchange, body, multiParameterArray, it); return (T) answer;
[2/2] camel git commit: Polished
Polished Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/09eb1511 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/09eb1511 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/09eb1511 Branch: refs/heads/master Commit: 09eb1511aaedef6cfdbd07e4331405eea2ab1815 Parents: eb69733 Author: Claus IbsenAuthored: Fri Jun 2 09:48:35 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 10:10:11 2017 +0200 -- .../apache/camel/component/bean/BeanInfo.java | 38 +--- 1 file changed, 9 insertions(+), 29 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/09eb1511/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 018ed9b..3448ff8 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -507,8 +507,8 @@ public class BeanInfo { return new MethodInfo(camelContext, clazz, method, parameters, bodyParameters, hasCustomAnnotation, hasHandlerAnnotation); } +@SuppressWarnings("unchecked") protected List[] collectParameterAnnotations(Class c, Method m) { -@SuppressWarnings("unchecked") List[] annotations = new List[m.getParameterCount()]; for (int i = 0; i < annotations.length; i++) { annotations[i] = new ArrayList(); @@ -883,7 +883,7 @@ public class BeanInfo { return answer; } // try to choose among multiple methods with annotations -MethodInfo chosen = chooseMethodWithCustomAnnotations(exchange, possibles); +MethodInfo chosen = chooseMethodWithCustomAnnotations(possibles); if (chosen != null) { return chosen; } @@ -953,8 +953,7 @@ public class BeanInfo { return null; } -private MethodInfo chooseMethodWithCustomAnnotations(Exchange exchange, Collection possibles) -throws AmbiguousMethodCallException { +private MethodInfo chooseMethodWithCustomAnnotations(Collection possibles) { // if we have only one method with custom annotations let's choose that MethodInfo chosen = null; for (MethodInfo possible : possibles) { @@ -1043,9 +1042,7 @@ public class BeanInfo { while (clazz != null && !clazz.equals(Object.class)) { for (Class interfaceClazz : clazz.getInterfaces()) { -for (Method interfaceMethod : interfaceClazz.getDeclaredMethods()) { -answer.add(interfaceMethod); -} +Collections.addAll(answer, interfaceClazz.getDeclaredMethods()); } clazz = clazz.getSuperclass(); } @@ -1068,14 +1065,8 @@ public class BeanInfo { } private void removeNonMatchingMethods(List methods, String name) { -Iterator it = methods.iterator(); -while (it.hasNext()) { -MethodInfo info = it.next(); -if (!matchMethod(info.getMethod(), name)) { -// method does not match so remove it -it.remove(); -} -} +// method does not match so remove it +methods.removeIf(info -> !matchMethod(info.getMethod(), name)); } private void removeAllAbstractMethods(List methods) { @@ -1103,7 +1094,7 @@ public class BeanInfo { // do not use qualifier for name matching String name = methodName; if (name.contains("(")) { -name = ObjectHelper.before(name, "("); +name = StringHelper.before(name, "("); } // must match name @@ -1118,7 +1109,7 @@ public class BeanInfo { } // match qualifier types which is used to select among overloaded methods -String types = ObjectHelper.between(methodName, "(", ")"); +String types = StringHelper.between(methodName, "(", ")"); if (ObjectHelper.isNotEmpty(types)) { // we must qualify based on types to match method String[] parameters = StringQuoteHelper.splitSafeQuote(types, ','); @@ -1226,11 +1217,10 @@ public class BeanInfo { } /** - * Gets the list of methods (unsorted) + * Gets the list of methods sorted by A..Z method name. * * @return the methods. */ -@Deprecated public List getMethods() { if (operations.isEmpty()) { return Collections.emptyList(); @@ -1240,17 +1230,7 @@ public class BeanInfo {
[1/2] camel git commit: Optimise - Bean component - Only try to choose methods if there is 2 or more to choose amongas otherwise we can just use the default method.
Repository: camel Updated Branches: refs/heads/master eb69733b4 -> e5cbba043 Optimise - Bean component - Only try to choose methods if there is 2 or more to choose amongas otherwise we can just use the default method. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e5cbba04 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e5cbba04 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e5cbba04 Branch: refs/heads/master Commit: e5cbba043819e2f17fb25c5d0ac162f3c32acc11 Parents: 09eb151 Author: Claus IbsenAuthored: Fri Jun 2 10:10:05 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 10:10:11 2017 +0200 -- .../apache/camel/component/bean/BeanInfo.java | 8 ++-- .../bean/BeanInvokeSingleMethodNoBodyTest.java | 43 .../bean/MySingleMethodNoBodyBean.java | 24 +++ 3 files changed, 71 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e5cbba04/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 3448ff8..43ddb9b 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -211,14 +211,14 @@ public class BeanInfo { // do not use qualifier for name String name = methodName; if (methodName.contains("(")) { -name = ObjectHelper.before(methodName, "("); +name = StringHelper.before(methodName, "("); // the must be a ending parenthesis if (!methodName.endsWith(")")) { throw new IllegalArgumentException("Method should end with parenthesis, was " + methodName); } // and there must be an even number of parenthesis in the syntax // (we can use betweenOuterPair as it return null if the syntax is invalid) -if (ObjectHelper.betweenOuterPair(methodName, '(', ')') == null) { +if (StringHelper.betweenOuterPair(methodName, '(', ')') == null) { throw new IllegalArgumentException("Method should have even pair of parenthesis, was " + methodName); } } @@ -284,8 +284,8 @@ public class BeanInfo { } } -if (methodInfo == null) { -// no name or type +if (methodInfo == null && methodMap.size() >= 2) { +// only try to choose if there is at least 2 methods methodInfo = chooseMethod(pojo, exchange, null); } if (methodInfo == null) { http://git-wip-us.apache.org/repos/asf/camel/blob/e5cbba04/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeSingleMethodNoBodyTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeSingleMethodNoBodyTest.java b/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeSingleMethodNoBodyTest.java new file mode 100644 index 000..3762914 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/component/bean/BeanInvokeSingleMethodNoBodyTest.java @@ -0,0 +1,43 @@ +/** + * 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.component.bean; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; + +public class BeanInvokeSingleMethodNoBodyTest extends ContextTestSupport { + +public void testBeanInvokeSingleMethodNoBody() throws Exception { +getMockEndpoint("mock:result").expectedBodiesReceived("Hello"); + +template.sendBody("direct:start", "Hi"); + +assertMockEndpointsSatisfied(); +} + +
[2/2] camel git commit: [Minor] Clean up use of deprecated method
[Minor] Clean up use of deprecated method Signed-off-by: Gregor ZurowskiProject: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/eb69733b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/eb69733b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/eb69733b Branch: refs/heads/master Commit: eb69733b4539870195c0bbd139ab97e782a11849 Parents: 3d818dc Author: Gregor Zurowski Authored: Fri Jun 2 09:31:49 2017 +0200 Committer: Gregor Zurowski Committed: Fri Jun 2 09:31:49 2017 +0200 -- .../java/org/apache/camel/spring/boot/FilePropertySource.java| 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/eb69733b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FilePropertySource.java -- diff --git a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FilePropertySource.java b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FilePropertySource.java index e2aa295..94de504 100644 --- a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FilePropertySource.java +++ b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/FilePropertySource.java @@ -20,7 +20,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.util.Properties; -import org.apache.camel.util.ObjectHelper; +import org.apache.camel.util.StringHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.ApplicationContext; @@ -39,7 +39,7 @@ public class FilePropertySource extends PropertySource { public FilePropertySource(String name, ApplicationContext applicationContext, String directory) { super(name); -ObjectHelper.notEmpty(directory, "directory"); +StringHelper.notEmpty(directory, "directory"); Properties loaded = new Properties(); try {
[1/2] camel git commit: [Minor] Clean up use of deprecated method
Repository: camel Updated Branches: refs/heads/master 6721bb4b4 -> eb69733b4 [Minor] Clean up use of deprecated method Signed-off-by: Gregor ZurowskiProject: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3d818dc3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3d818dc3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3d818dc3 Branch: refs/heads/master Commit: 3d818dc34b87cfff517ea2a7b14edfb077126c3d Parents: 6721bb4 Author: Gregor Zurowski Authored: Fri Jun 2 09:28:36 2017 +0200 Committer: Gregor Zurowski Committed: Fri Jun 2 09:28:36 2017 +0200 -- .../camel/spring/boot/RouteConfigWithCamelContextInjected.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3d818dc3/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/RouteConfigWithCamelContextInjected.java -- diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/RouteConfigWithCamelContextInjected.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/RouteConfigWithCamelContextInjected.java index 8f239b3..042f7a8 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/RouteConfigWithCamelContextInjected.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/RouteConfigWithCamelContextInjected.java @@ -32,7 +32,7 @@ public class RouteConfigWithCamelContextInjected { @Bean public RoutesBuilder routeCreatedWithInjectedCamelContext() { -Assert.notNull(camelContext); +Assert.notNull(camelContext, "camelContext must not be null"); return new RouteBuilder() { @Override public void configure() throws Exception {
[1/2] camel git commit: CAMEL-11178: Corrected a wrong variable renaming I've proposed once
Repository: camel Updated Branches: refs/heads/master a6d702959 -> 6721bb4b4 CAMEL-11178: Corrected a wrong variable renaming I've proposed once Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6721bb4b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6721bb4b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6721bb4b Branch: refs/heads/master Commit: 6721bb4b4fe94d0164cca1a9062edff4e0dcbe5d Parents: 368559c Author: aldettingerAuthored: Thu Jun 1 17:23:01 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:17:14 2017 +0200 -- .../main/java/org/apache/camel/component/bean/BeanInfo.java | 8 1 file changed, 4 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6721bb4b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 5440177..018ed9b 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -328,7 +328,7 @@ public class BeanInfo { methods.addAll(extraMethods); } -Set overriddenMethods = new HashSet(); +Set overrides = new HashSet(); // do not remove duplicates form class from the Java itself as they have some "duplicates" we need boolean javaClass = clazz.getName().startsWith("java.") || clazz.getName().startsWith("javax."); @@ -348,12 +348,12 @@ public class BeanInfo { } // skip duplicates which may be assign compatible (favor keep first added method when duplicate) if (ObjectHelper.isOverridingMethod(getType(), source, target, false)) { -overriddenMethods.add(target); +overrides.add(target); } } } -methods.removeAll(overriddenMethods); -overriddenMethods.clear(); +methods.removeAll(overrides); +overrides.clear(); } // now introspect the methods and filter non valid methods
[2/2] camel git commit: CAMEL-11178: Added a test to ensure that default methods are explicitly supported in bean binding
CAMEL-11178: Added a test to ensure that default methods are explicitly supported in bean binding Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/368559c2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/368559c2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/368559c2 Branch: refs/heads/master Commit: 368559c2cdf38e0a5bfb93ea9158b00fa2ea1705 Parents: a6d7029 Author: aldettingerAuthored: Thu Jun 1 16:38:55 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:17:14 2017 +0200 -- ...ultMethodCalledFromSimpleExpressionTest.java | 53 1 file changed, 53 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/368559c2/camel-core/src/test/java/org/apache/camel/component/bean/issues/DefaultMethodCalledFromSimpleExpressionTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/component/bean/issues/DefaultMethodCalledFromSimpleExpressionTest.java b/camel-core/src/test/java/org/apache/camel/component/bean/issues/DefaultMethodCalledFromSimpleExpressionTest.java new file mode 100644 index 000..2d24c56 --- /dev/null +++ b/camel-core/src/test/java/org/apache/camel/component/bean/issues/DefaultMethodCalledFromSimpleExpressionTest.java @@ -0,0 +1,53 @@ +/** + * 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.component.bean.issues; + +import org.apache.camel.ContextTestSupport; +import org.apache.camel.builder.RouteBuilder; + +public class DefaultMethodCalledFromSimpleExpressionTest extends ContextTestSupport { + +private static final String DEFAULT_METHOD_CONTENT = "A.defaultMethod() has been called"; + +public void testDefaultMethodFromSimpleExpression() throws Exception { + getMockEndpoint("mock:result").expectedBodiesReceived(DEFAULT_METHOD_CONTENT); + +template.sendBodyAndProperty("direct:defaultMethod", "", "myObject", new B() { +}); + +assertMockEndpointsSatisfied(); +} + +@Override +protected RouteBuilder createRouteBuilder() throws Exception { +return new RouteBuilder() { +@Override +public void configure() throws Exception { + from("direct:defaultMethod").setBody(simple("${exchangeProperty.myObject.defaultMethod}")).to("mock:result"); +} +}; +} + +public interface A { +default String defaultMethod() { +return DEFAULT_METHOD_CONTENT; +} +} + +public interface B extends A { +} +}
[5/7] camel git commit: Optimise bean to not create unnessary objects.
Optimise bean to not create unnessary objects. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/099eac4f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/099eac4f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/099eac4f Branch: refs/heads/master Commit: 099eac4f30d23e8d03473ff72337e39331a78272 Parents: 39ef98e Author: Claus IbsenAuthored: Thu Jun 1 22:40:53 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:14 2017 +0200 -- .../camel/component/bean/AbstractBeanProcessor.java | 6 ++ .../org/apache/camel/component/bean/BeanInfo.java | 16 2 files changed, 18 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/099eac4f/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java index beeb692..858253e 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/AbstractBeanProcessor.java @@ -266,10 +266,8 @@ public abstract class AbstractBeanProcessor implements AsyncProcessor { // don't allow if any of the methods has a @Handler annotation // as the @Handler annotation takes precedence and is supposed to trigger invocation // of the given method -for (MethodInfo method : info.getMethods()) { -if (method.hasHandlerAnnotation()) { -return false; -} +if (info.hasAnyMethodHandlerAnnotation()) { +return false; } // fallback and allow using the processor http://git-wip-us.apache.org/repos/asf/camel/blob/099eac4f/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 2e99efa..43cd788 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -1230,6 +1230,7 @@ public class BeanInfo { * * @return the methods. */ +@Deprecated public List getMethods() { if (operations.isEmpty()) { return Collections.emptyList(); @@ -1247,6 +1248,7 @@ public class BeanInfo { * * @return the methods. */ +@Deprecated public List getSortedMethods() { List methods = getMethods(); if (methods.size() > 1) { @@ -1257,6 +1259,20 @@ public class BeanInfo { } /** + * Does any of the methods have a Canel @Handler annotation. + */ +public boolean hasAnyMethodHandlerAnnotation() { +for (List list : operations.values()) { +for (MethodInfo mi : list) { +if (mi.hasHandlerAnnotation()) { +return true; +} +} +} +return false; +} + +/** * Get the operation(s) with the given name. We can have multiple when methods is overloaded. * * Shorthand method names for getters is supported, so you can pass in eg 'name' and Camel
[7/7] camel git commit: CAMEL-11373: Remove unnecessary converters and polish code/doc
CAMEL-11373: Remove unnecessary converters and polish code/doc Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a6d70295 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a6d70295 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a6d70295 Branch: refs/heads/master Commit: a6d70295912a84e4ae712f80e7f80e3878bdc3f4 Parents: 3d73e49 Author: Tadayoshi SatoAuthored: Fri Jun 2 10:27:50 2017 +0900 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:14 2017 +0200 -- .../src/main/descriptors/common-bin.xml | 3 +- .../src/main/docs/twilio-component.adoc | 14 +- .../component/twilio/TwilioConfiguration.java | 1 - .../camel/component/twilio/TwilioConverter.java | 259 --- 4 files changed, 9 insertions(+), 268 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/apache-camel/src/main/descriptors/common-bin.xml -- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index a3dd322..2073939 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -75,7 +75,7 @@ org.apache.camel:camel-docker org.apache.camel:camel-dozer org.apache.camel:camel-drill - org.apache.camel:camel-dropbox +org.apache.camel:camel-dropbox org.apache.camel:camel-eclipse org.apache.camel:camel-ehcache org.apache.camel:camel-ejb @@ -536,6 +536,7 @@ org.apache.camel:camel-tagsoup-starter org.apache.camel:camel-tarfile-starter org.apache.camel:camel-telegram-starter +org.apache.camel:camel-twilio-starter org.apache.camel:camel-twitter-starter org.apache.camel:camel-undertow-starter org.apache.camel:camel-univocity-parsers-starter http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/docs/twilio-component.adoc -- diff --git a/components/camel-twilio/src/main/docs/twilio-component.adoc b/components/camel-twilio/src/main/docs/twilio-component.adoc index 16c0d8e..4fd68e8 100644 --- a/components/camel-twilio/src/main/docs/twilio-component.adoc +++ b/components/camel-twilio/src/main/docs/twilio-component.adoc @@ -148,14 +148,14 @@ would override a *`CamelTwilio.option`* header. Endpoint can be one of: -[width="100%",cols="50%,50%",options="header"] +[width="100%",cols="20%,20%,60%",options="header"] |=== -| Endpoint | Shorthand Alias -| *creator* | create -| *deleter* | delete -| *fetcher* | fetch -| *reader* | read -| *updater* | update +| Endpoint | Shorthand Alias | Description +| *creator* | create | Make the request to the Twilio API to perform the create +| *deleter* | delete | Make the request to the Twilio API to perform the delete +| *fetcher* | fetch | Make the request to the Twilio API to perform the fetch +| *reader* | read| Make the request to the Twilio API to perform the read +| *updater* | update | Make the request to the Twilio API to perform the update |=== Available endpoints differ depending on the endpoint prefixes. http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java -- diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java index cef2b3a..4ff4427 100644 --- a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java +++ b/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConfiguration.java @@ -63,7 +63,6 @@ public class TwilioConfiguration implements Cloneable { * @return the API Name */ public TwilioApiName getApiName() { - return apiName; } http://git-wip-us.apache.org/repos/asf/camel/blob/a6d70295/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java -- diff --git a/components/camel-twilio/src/main/java/org/apache/camel/component/twilio/TwilioConverter.java
[1/7] camel git commit: Optimise bean to not create unnessary objects. Optimise internal processor to use Object[] instead of ArrayList for states.
Repository: camel Updated Branches: refs/heads/master f824fb0bf -> a6d702959 Optimise bean to not create unnessary objects. Optimise internal processor to use Object[] instead of ArrayList for states. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/39ef98ee Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/39ef98ee Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/39ef98ee Branch: refs/heads/master Commit: 39ef98eefeb165416a3cd8c76845012909a185dc Parents: 7e85684 Author: Claus IbsenAuthored: Thu Jun 1 22:27:45 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:13 2017 +0200 -- .../apache/camel/component/bean/BeanInfo.java | 21 +--- .../camel/processor/CamelInternalProcessor.java | 11 +- .../processor/SharedCamelInternalProcessor.java | 11 +- .../camel/component/bean/BeanInfoTest.java | 12 --- 4 files changed, 35 insertions(+), 20 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/39ef98ee/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 21251f1..2e99efa 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -1226,7 +1226,7 @@ public class BeanInfo { } /** - * Gets the list of methods sorted by A..Z method name. + * Gets the list of methods (unsorted) * * @return the methods. */ @@ -1239,13 +1239,20 @@ public class BeanInfo { for (Collection col : operations.values()) { methods.addAll(col); } +return methods; +} -// sort the methods by name A..Z -methods.sort(new Comparator() { -public int compare(MethodInfo o1, MethodInfo o2) { -return o1.getMethod().getName().compareTo(o2.getMethod().getName()); -} -}); +/** + * Gets the list of methods sorted by A..Z method name. + * + * @return the methods. + */ +public List getSortedMethods() { +List methods = getMethods(); +if (methods.size() > 1) { +// sort the methods by name A..Z +methods.sort(Comparator.comparing(o -> o.getMethod().getName())); +} return methods; } http://git-wip-us.apache.org/repos/asf/camel/blob/39ef98ee/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java -- diff --git a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java index 2514d37..d315ecc 100644 --- a/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java +++ b/camel-core/src/main/java/org/apache/camel/processor/CamelInternalProcessor.java @@ -140,13 +140,14 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor { return true; } -final List states = new ArrayList(advices.size()); +// optimise to use object array for states +final Object[] states = new Object[advices.size()]; // optimise for loop using index access to avoid creating iterator object for (int i = 0; i < advices.size(); i++) { CamelInternalProcessorAdvice task = advices.get(i); try { Object state = task.before(exchange); -states.add(state); +states[i] = state; } catch (Throwable e) { exchange.setException(e); callback.done(true); @@ -225,11 +226,11 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor { */ private final class InternalCallback implements AsyncCallback { -private final List states; +private final Object[] states; private final Exchange exchange; private final AsyncCallback callback; -private InternalCallback(List states, Exchange exchange, AsyncCallback callback) { +private InternalCallback(Object[] states, Exchange exchange, AsyncCallback callback) { this.states = states; this.exchange = exchange; this.callback = callback; @@ -245,7 +246,7 @@ public class CamelInternalProcessor extends DelegateAsyncProcessor { try { for (int i = advices.size() - 1; i >= 0; i--) {
[2/7] camel git commit: CAMEL-11373: Create a Camel Twilio component
http://git-wip-us.apache.org/repos/asf/camel/blob/e2310430/components/camel-twilio/src/main/resources/META-INF/LICENSE.txt -- diff --git a/components/camel-twilio/src/main/resources/META-INF/LICENSE.txt b/components/camel-twilio/src/main/resources/META-INF/LICENSE.txt new file mode 100644 index 000..6b0b127 --- /dev/null +++ b/components/camel-twilio/src/main/resources/META-INF/LICENSE.txt @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 +http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their +
[4/7] camel git commit: Optimise when calling bean to introspect and choose method to avoid creating unnessasary objects.
Optimise when calling bean to introspect and choose method to avoid creating unnessasary objects. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7e85684a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7e85684a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7e85684a Branch: refs/heads/master Commit: 7e85684acbc0eedc32c59c530acbd79b112dd985 Parents: e231043 Author: Claus IbsenAuthored: Thu Jun 1 22:04:48 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:13 2017 +0200 -- .../apache/camel/component/bean/BeanInfo.java | 144 --- 1 file changed, 94 insertions(+), 50 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7e85684a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index ab38e15..21251f1 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -552,84 +552,125 @@ public class BeanInfo { // must use defensive copy, to avoid altering the shared lists // and we want to remove unwanted operations from these local lists -final List localOperationsWithBody = new ArrayList(operationsWithBody); -final List localOperationsWithNoBody = new ArrayList(operationsWithNoBody); -final List localOperationsWithCustomAnnotation = new ArrayList(operationsWithCustomAnnotation); -final List localOperationsWithHandlerAnnotation = new ArrayList(operationsWithHandlerAnnotation); +List localOperationsWithBody = null; +if (!operationsWithBody.isEmpty()) { +localOperationsWithBody = new ArrayList<>(operationsWithBody); +} +List localOperationsWithNoBody = null; +if (!operationsWithNoBody.isEmpty()) { +localOperationsWithNoBody = new ArrayList<>(operationsWithNoBody); +} +List localOperationsWithCustomAnnotation = null; +if (!operationsWithCustomAnnotation.isEmpty()) { +localOperationsWithCustomAnnotation = new ArrayList<>(operationsWithCustomAnnotation); +} +List localOperationsWithHandlerAnnotation = null; +if (!operationsWithHandlerAnnotation.isEmpty()) { +localOperationsWithHandlerAnnotation = new ArrayList<>(operationsWithHandlerAnnotation); +} // remove all abstract methods -removeAllAbstractMethods(localOperationsWithBody); -removeAllAbstractMethods(localOperationsWithNoBody); -removeAllAbstractMethods(localOperationsWithCustomAnnotation); -removeAllAbstractMethods(localOperationsWithHandlerAnnotation); +if (localOperationsWithBody != null) { +removeAllAbstractMethods(localOperationsWithBody); +} +if (localOperationsWithNoBody != null) { +removeAllAbstractMethods(localOperationsWithNoBody); +} +if (localOperationsWithCustomAnnotation != null) { +removeAllAbstractMethods(localOperationsWithCustomAnnotation); +} +if (localOperationsWithHandlerAnnotation != null) { +removeAllAbstractMethods(localOperationsWithHandlerAnnotation); +} if (name != null) { // filter all lists to only include methods with this name -removeNonMatchingMethods(localOperationsWithHandlerAnnotation, name); -removeNonMatchingMethods(localOperationsWithCustomAnnotation, name); -removeNonMatchingMethods(localOperationsWithBody, name); -removeNonMatchingMethods(localOperationsWithNoBody, name); +if (localOperationsWithHandlerAnnotation != null) { +removeNonMatchingMethods(localOperationsWithHandlerAnnotation, name); +} +if (localOperationsWithCustomAnnotation != null) { +removeNonMatchingMethods(localOperationsWithCustomAnnotation, name); +} +if (localOperationsWithBody != null) { +removeNonMatchingMethods(localOperationsWithBody, name); +} +if (localOperationsWithNoBody != null) { +removeNonMatchingMethods(localOperationsWithNoBody, name); +} } else { // remove all getter/setter as we do not want to consider these methods - removeAllSetterOrGetterMethods(localOperationsWithHandlerAnnotation); -
[6/7] camel git commit: Optimise bean to not create unnessary objects.
Optimise bean to not create unnessary objects. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3d73e49c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3d73e49c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3d73e49c Branch: refs/heads/master Commit: 3d73e49c1ed644a499d164595b9750e44d1f96bd Parents: 099eac4 Author: Claus IbsenAuthored: Thu Jun 1 22:50:29 2017 +0200 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:14 2017 +0200 -- .../java/org/apache/camel/component/bean/BeanInfo.java | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3d73e49c/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java index 43cd788..5440177 100644 --- a/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java +++ b/camel-core/src/main/java/org/apache/camel/component/bean/BeanInfo.java @@ -1262,14 +1262,7 @@ public class BeanInfo { * Does any of the methods have a Canel @Handler annotation. */ public boolean hasAnyMethodHandlerAnnotation() { -for (List list : operations.values()) { -for (MethodInfo mi : list) { -if (mi.hasHandlerAnnotation()) { -return true; -} -} -} -return false; +return !operationsWithHandlerAnnotation.isEmpty(); } /** @@ -1284,7 +1277,7 @@ public class BeanInfo { private List getOperations(String methodName) { // do not use qualifier for name if (methodName.contains("(")) { -methodName = ObjectHelper.before(methodName, "("); +methodName = StringHelper.before(methodName, "("); } List answer = operations.get(methodName);
[3/7] camel git commit: CAMEL-11373: Create a Camel Twilio component
CAMEL-11373: Create a Camel Twilio component Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e2310430 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e2310430 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e2310430 Branch: refs/heads/master Commit: e23104309cc32f608dc28b0f34e764583dcb988b Parents: f824fb0 Author: Tadayoshi SatoAuthored: Thu Jun 1 19:53:33 2017 +0900 Committer: Claus Ibsen Committed: Fri Jun 2 09:05:13 2017 +0200 -- apache-camel/pom.xml| 4 + .../src/main/descriptors/common-bin.xml | 1 + components/camel-twilio/pom.xml | 703 +++ .../src/main/docs/twilio-component.adoc | 194 + .../camel/component/twilio/TwilioComponent.java | 100 +++ .../component/twilio/TwilioConfiguration.java | 131 .../camel/component/twilio/TwilioConsumer.java | 42 ++ .../camel/component/twilio/TwilioConverter.java | 298 .../camel/component/twilio/TwilioEndpoint.java | 135 .../camel/component/twilio/TwilioProducer.java | 44 ++ .../twilio/internal/TwilioConstants.java| 33 + .../twilio/internal/TwilioPropertiesHelper.java | 39 + .../src/main/resources/META-INF/LICENSE.txt | 203 ++ .../src/main/resources/META-INF/NOTICE.txt | 11 + .../services/org/apache/camel/TypeConverter | 18 + .../services/org/apache/camel/component/twilio | 18 + .../twilio/AbstractTwilioTestSupport.java | 82 +++ .../twilio/AccountIntegrationTest.java | 104 +++ .../src/test/resources/log4j2.properties| 32 + .../src/test/resources/test-options.properties | 24 + components/pom.xml | 1 + docs/user-manual/en/SUMMARY.md | 1 + parent/pom.xml | 6 + .../camel-twilio-starter/pom.xml| 61 ++ .../TwilioComponentAutoConfiguration.java | 128 .../TwilioComponentConfiguration.java | 148 .../src/main/resources/META-INF/LICENSE.txt | 203 ++ .../src/main/resources/META-INF/NOTICE.txt | 11 + ...dditional-spring-configuration-metadata.json | 10 + .../main/resources/META-INF/spring.factories| 19 + .../src/main/resources/META-INF/spring.provides | 17 + .../spring-boot/components-starter/pom.xml | 1 + 32 files changed, 2822 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/e2310430/apache-camel/pom.xml -- diff --git a/apache-camel/pom.xml b/apache-camel/pom.xml index 2529409..3c8b259 100644 --- a/apache-camel/pom.xml +++ b/apache-camel/pom.xml @@ -1039,6 +1039,10 @@ org.apache.camel + camel-twilio + + + org.apache.camel camel-twitter http://git-wip-us.apache.org/repos/asf/camel/blob/e2310430/apache-camel/src/main/descriptors/common-bin.xml -- diff --git a/apache-camel/src/main/descriptors/common-bin.xml b/apache-camel/src/main/descriptors/common-bin.xml index 01a32d6..a3dd322 100644 --- a/apache-camel/src/main/descriptors/common-bin.xml +++ b/apache-camel/src/main/descriptors/common-bin.xml @@ -267,6 +267,7 @@ org.apache.camel:camel-test-spring org.apache.camel:camel-testng org.apache.camel:camel-tika +org.apache.camel:camel-twilio org.apache.camel:camel-twitter org.apache.camel:camel-undertow org.apache.camel:camel-univocity-parsers http://git-wip-us.apache.org/repos/asf/camel/blob/e2310430/components/camel-twilio/pom.xml -- diff --git a/components/camel-twilio/pom.xml b/components/camel-twilio/pom.xml new file mode 100644 index 000..a3e8dcd --- /dev/null +++ b/components/camel-twilio/pom.xml @@ -0,0 +1,703 @@ + + +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 +components +2.20.0-SNAPSHOT + + + camel-twilio + jar + Camel :: Twilio + Camel Component for Twilio + + +twilio +Twilio +org.apache.camel.component.twilio +org.apache.camel.component.twilio.internal + +${componentPackage} +${outPackage} + org.apache.camel.spi.ComponentResolver;component=twilio + + + + + org.apache.camel + camel-core + + + + + com.twilio.sdk + twilio + ${twilio-version} + + + + + org.apache.camel + spi-annotations + ${project.version} +