You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2020/08/06 07:24:38 UTC
[camel-karaf-examples] 01/02: CAMEL-15102: Move osgi examples to
camel-karaf-examples
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-karaf-examples.git
commit 409ba31c0267870d812f587c14ba2c6d2dfbfd64
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu Aug 6 09:19:58 2020 +0200
CAMEL-15102: Move osgi examples to camel-karaf-examples
---
.gitattributes | 4 +
.gitignore | 27 +
.mvn/wrapper/MavenWrapperDownloader.java | 117 ++++
.mvn/wrapper/maven-wrapper.jar | Bin 0 -> 50710 bytes
.mvn/wrapper/maven-wrapper.properties | 2 +
LICENSE.txt | 203 +++++++
NOTICE.txt | 11 +
README.md | 16 +
.../README.adoc | 119 +++++
.../camel-example-artemis-amqp-blueprint/pom.xml | 278 ++++++++++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../resources/OSGI-INF/blueprint/camel-context.xml | 64 +++
.../src/main/resources/features.xml | 31 ++
.../src/main/resources/log4j2.properties | 28 +
.../example/artemis/amqp/ArtemisAmqpIntTest.java | 61 +++
.../artemis/amqp/EmbeddedBrokerSupport.java | 48 ++
.../OSGI-INF/blueprint/embedded-broker.xml | 63 +++
.../src/test/resources/broker.xml | 48 ++
examples/camel-example-cxf-blueprint/README.adoc | 112 ++++
examples/camel-example-cxf-blueprint/pom.xml | 117 ++++
.../reportincident/ReportIncidentRoutes.java | 45 ++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../resources/META-INF/wsdl/report_incident.wsdl | 92 ++++
.../resources/OSGI-INF/blueprint/camel-context.xml | 47 ++
examples/camel-example-fhir-osgi/README.adoc | 166 ++++++
...pache.camel.example.fhir.osgi.configuration.cfg | 19 +
examples/camel-example-fhir-osgi/pom.xml | 260 +++++++++
.../src/main/data/hl7v2.patient | 1 +
.../apache/camel/example/fhir/osgi/FhirRoute.java | 65 +++
.../resources/OSGI-INF/blueprint/camel-context.xml | 35 ++
.../src/main/resources/log4j2.properties | 23 +
.../apache/camel/example/fhir/osgi/FhirOsgiIT.java | 79 +++
.../camel/example/fhir/osgi/PaxExamOptions.java | 71 +++
.../camel-example-olingo4-blueprint/README.adoc | 75 +++
examples/camel-example-olingo4-blueprint/pom.xml | 71 +++
.../blueprint/Olingo4TestConfiguration.java | 51 ++
.../main/resources/OSGI-INF/blueprint/odata.xml | 49 ++
.../src/main/resources/data/person1.json | 5 +
.../src/main/resources/data/person2.json | 5 +
examples/camel-example-openapi-osgi/README.adoc | 67 +++
examples/camel-example-openapi-osgi/pom.xml | 99 ++++
.../java/org/apache/camel/example/rest/User.java | 47 ++
.../org/apache/camel/example/rest/UserService.java | 76 +++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../main/resources/OSGI-INF/blueprint/camel.xml | 109 ++++
.../src/main/resources/log4j2.properties | 23 +
.../README.adoc | 87 +++
.../camel-example-servlet-rest-blueprint/pom.xml | 108 ++++
.../java/org/apache/camel/example/rest/User.java | 47 ++
.../org/apache/camel/example/rest/UserService.java | 63 +++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../main/resources/OSGI-INF/blueprint/camel.xml | 81 +++
.../src/main/resources/log4j2.properties | 23 +
.../README.adoc | 90 ++++
.../camel-example-servlet-rest-karaf-jaas/pom.xml | 109 ++++
.../java/org/apache/camel/example/rest/User.java | 47 ++
.../org/apache/camel/example/rest/UserService.java | 63 +++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../main/resources/OSGI-INF/blueprint/camel.xml | 81 +++
.../src/main/resources/log4j2.properties | 23 +
.../org.ops4j.pax.web.context-camelrestdsl.cfg | 7 +
examples/camel-example-sql-blueprint/README.adoc | 65 +++
examples/camel-example-sql-blueprint/pom.xml | 145 +++++
.../org/apache/camel/example/sql/DatabaseBean.java | 74 +++
.../org/apache/camel/example/sql/OrderBean.java | 52 ++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../resources/OSGI-INF/blueprint/camel-context.xml | 78 +++
.../src/main/resources/features.xml | 33 ++
.../src/main/resources/log4j2.properties | 23 +
.../src/main/resources/sql.properties | 29 +
examples/camel-example-swagger-osgi/README.adoc | 67 +++
examples/camel-example-swagger-osgi/pom.xml | 99 ++++
.../java/org/apache/camel/example/rest/User.java | 53 ++
.../org/apache/camel/example/rest/UserService.java | 76 +++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../main/resources/OSGI-INF/blueprint/camel.xml | 109 ++++
.../src/main/resources/log4j2.properties | 23 +
.../README.adoc | 58 ++
.../camel-example-transformer-blueprint/pom.xml | 158 ++++++
.../resources/OSGI-INF/blueprint/camel-context.xml | 55 ++
.../src/main/resources/features.xml | 28 +
.../src/main/resources/log4j2.properties | 28 +
.../src/main/resources/transform.xsl | 32 ++
.../README.adoc | 68 +++
.../pom.xml | 62 +++
.../src/main/resources/META-INF/LICENSE.txt | 203 +++++++
.../src/main/resources/META-INF/NOTICE.txt | 11 +
.../resources/OSGI-INF/blueprint/camel-twitter.xml | 45 ++
.../src/main/resources/twitter.properties | 24 +
.../src/main/resources/webapp/index.html | 82 +++
examples/pom.xml | 595 +++++++++++++++++++++
mvnw | 310 +++++++++++
mvnw.cmd | 182 +++++++
100 files changed, 8123 insertions(+)
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..604cdf8
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,4 @@
+# OS specific line endings for the Maven wrapper script
+mvnw text eol=lf
+mvnw.cmd text eol=crlf
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5d69a55
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,27 @@
+target
+*.iml
+*.ipr
+*.iws
+.idea
+.DS_Store
+.classpath
+.ekstazi
+.project
+.settings
+.checkstyle
+*.log
+test-salesforce-login.properties
+dependency-reduced-pom.xml
+id_file
+components/camel-solr/data
+*.epoch
+.factorypath
+.pmd
+.sts4-cache
+log-camel-lsp.out
+.vscode
+*.code-workspace
+components/camel-cxf/activemq-data
+*.swp
+.flattened-pom.xml
+.java-version
diff --git a/.mvn/wrapper/MavenWrapperDownloader.java b/.mvn/wrapper/MavenWrapperDownloader.java
new file mode 100644
index 0000000..b901097
--- /dev/null
+++ b/.mvn/wrapper/MavenWrapperDownloader.java
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2007-present the original author or authors.
+ *
+ * Licensed 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.
+ */
+import java.net.*;
+import java.io.*;
+import java.nio.channels.*;
+import java.util.Properties;
+
+public class MavenWrapperDownloader {
+
+ private static final String WRAPPER_VERSION = "0.5.6";
+ /**
+ * Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
+ */
+ private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ + WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
+
+ /**
+ * Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
+ * use instead of the default one.
+ */
+ private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
+ ".mvn/wrapper/maven-wrapper.properties";
+
+ /**
+ * Path where the maven-wrapper.jar will be saved to.
+ */
+ private static final String MAVEN_WRAPPER_JAR_PATH =
+ ".mvn/wrapper/maven-wrapper.jar";
+
+ /**
+ * Name of the property which should be used to override the default download url for the wrapper.
+ */
+ private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
+
+ public static void main(String args[]) {
+ System.out.println("- Downloader started");
+ File baseDirectory = new File(args[0]);
+ System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
+
+ // If the maven-wrapper.properties exists, read it and check if it contains a custom
+ // wrapperUrl parameter.
+ File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
+ String url = DEFAULT_DOWNLOAD_URL;
+ if(mavenWrapperPropertyFile.exists()) {
+ FileInputStream mavenWrapperPropertyFileInputStream = null;
+ try {
+ mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
+ Properties mavenWrapperProperties = new Properties();
+ mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
+ url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
+ } catch (IOException e) {
+ System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
+ } finally {
+ try {
+ if(mavenWrapperPropertyFileInputStream != null) {
+ mavenWrapperPropertyFileInputStream.close();
+ }
+ } catch (IOException e) {
+ // Ignore ...
+ }
+ }
+ }
+ System.out.println("- Downloading from: " + url);
+
+ File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
+ if(!outputFile.getParentFile().exists()) {
+ if(!outputFile.getParentFile().mkdirs()) {
+ System.out.println(
+ "- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
+ }
+ }
+ System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
+ try {
+ downloadFileFromURL(url, outputFile);
+ System.out.println("Done");
+ System.exit(0);
+ } catch (Throwable e) {
+ System.out.println("- Error downloading");
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+
+ private static void downloadFileFromURL(String urlString, File destination) throws Exception {
+ if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
+ String username = System.getenv("MVNW_USERNAME");
+ char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
+ Authenticator.setDefault(new Authenticator() {
+ @Override
+ protected PasswordAuthentication getPasswordAuthentication() {
+ return new PasswordAuthentication(username, password);
+ }
+ });
+ }
+ URL website = new URL(urlString);
+ ReadableByteChannel rbc;
+ rbc = Channels.newChannel(website.openStream());
+ FileOutputStream fos = new FileOutputStream(destination);
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ fos.close();
+ rbc.close();
+ }
+
+}
diff --git a/.mvn/wrapper/maven-wrapper.jar b/.mvn/wrapper/maven-wrapper.jar
new file mode 100644
index 0000000..2cc7d4a
Binary files /dev/null and b/.mvn/wrapper/maven-wrapper.jar differ
diff --git a/.mvn/wrapper/maven-wrapper.properties b/.mvn/wrapper/maven-wrapper.properties
new file mode 100644
index 0000000..642d572
--- /dev/null
+++ b/.mvn/wrapper/maven-wrapper.properties
@@ -0,0 +1,2 @@
+distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
+wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/NOTICE.txt b/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..4453ed6
--- /dev/null
+++ b/README.md
@@ -0,0 +1,16 @@
+# Apache Camel Karaf Examples
+
+![master build](https://github.com/apache/camel-karaf-examples/workflows/master%20build/badge.svg)
+[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.camel/apache-camel/badge.svg?style=flat-square)](https://maven-badges.herokuapp.com/maven-central/org.apache.camel/apache-camel)
+[![Javadocs](http://www.javadoc.io/badge/org.apache.camel/apache-camel.svg?color=brightgreen)](http://www.javadoc.io/doc/org.apache.camel/camel-core)
+[![Stack Overflow](https://img.shields.io/:stack%20overflow-apache--camel-brightgreen.svg)](http://stackoverflow.com/questions/tagged/apache-camel)
+[![Gitter](https://img.shields.io/gitter/room/apache/apache-camel.js.svg)](https://gitter.im/apache/apache-camel)
+[![Twitter](https://img.shields.io/twitter/follow/ApacheCamel.svg?label=Follow&style=social)](https://twitter.com/ApacheCamel)
+
+
+[Apache Camel](http://camel.apache.org/) is a powerful open source integration framework based on known
+Enterprise Integration Patterns with powerful bean integration.
+
+### Introduction
+
+This project provides examples for Apache Camel Karaf.
diff --git a/examples/camel-example-artemis-amqp-blueprint/README.adoc b/examples/camel-example-artemis-amqp-blueprint/README.adoc
new file mode 100644
index 0000000..3432708
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/README.adoc
@@ -0,0 +1,119 @@
+== Camel Artemis AMQP Messaging
+
+This example shows how to produce/consume messages between Apache Camel
+and ActiveMQ Artemis using the AMQP component based on the JMS 2.0
+Apache Qpid Proton client library.
+
+One benefit of using Camel's AMQP component is to allow connectivity to
+Qpid's Dispatch Router enabling flexible and scalable interconnect
+between any AMQP endpoints.
+
+The example includes a JUnit to showcase how to embed an AMQP enabled
+Artemis Broker. This permits building and testing the code in complete
+isolation.
+
+When deployed in a running environment, Camel will attempt to connect to
+an already existing Artemis broker using the default AMQP port (5672).
+
+=== Test with embedded Artemis
+
+The JUnit with an included embedded Artemis Broker can be triggered
+using Maven.
+
+....
+mvn test -P itest
+....
+
+=== Install ActiveMQ Artemis
+
+To automate downloading, unpacking and configuration of Apache ActiveMQ
+Artemis with latest defined version a special profile is added. It's
+necessary to run following Maven command for do this during example
+install:
+
+....
+mvn install -P artemis
+....
+
+=== Run ActiveMQ Artemis
+
+To start configured ActiveMQ Artemis instance in a shell use:
+
+....
+$ target/artemis-instance/bin/artemis run
+....
+
+Which startup ActiveMQ Artemis in the foreground and keeps it running
+until you hit ctrl+c to shutdown ActiveMQ Artemis.
+
+=== Run Camel
+
+Start the Camel application:
+
+....
+mvn camel:run -DskipTests=true
+....
+
+Once started, Camel will be listening for HTTP requests (port 9090) as a
+trigger mechanism to fire AMQP messages to Artemis.
+
+From your prefered browser hit the following URL:
+
+....
+http://localhost:9090/message
+....
+
+Or alternatively, using cURL:
+
+....
+curl http://localhost:9090/message
+....
+
+The above actions should render on screen:
+
+....
+Hello from Camel's AMQP example
+....
+
+To stop the example hit ctrl+c.
+
+=== ActiveMQ Artemis web console
+
+You can browse the Artemis web console: http://localhost:8161/console to
+see activity such as number of consumers and producers or acknoledged
+messages.
+
+=== Run with Karaf
+
+You will need to install this example first to your local maven
+repository with:
+
+....
+mvn install
+....
+
+Then you can install this example from the shell using this example's
+`+features.xml+` for easy provisioning:
+
+....
+feature:repo-add mvn:org.apache.camel.example/camel-example-artemis-amqp-blueprint/${version}/xml/features
+feature:install camel-example-artemis-amqp-blueprint
+....
+
+And you can see the application running by tailing the logs:
+
+....
+log:tail
+....
+
+And you can use ctrl+c to stop tailing the log.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-artemis-amqp-blueprint/pom.xml b/examples/camel-example-artemis-amqp-blueprint/pom.xml
new file mode 100644
index 0000000..214525b
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/pom.xml
@@ -0,0 +1,278 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-artemis-amqp-blueprint</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: ActiveMQ Artemis :: AMQP</name>
+ <description>Demonstrates ActiveMQ Artemis using Camel's AMQP component.
+ </description>
+
+ <properties>
+ <category>Messaging</category>
+ <camel.osgi.import.additional>
+ org.apache.qpid.*;version="[0.20,1)",
+ </camel.osgi.import.additional>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <!-- Add Camel Karaf BOM -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-bom</artifactId>
+ <version>${camel.karaf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint-main</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-netty-http</artifactId>
+ </dependency>
+
+ <!-- Embbeded Artemis AMQP JMS Broker -->
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-server</artifactId>
+ <version>${activemq-artemis-version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>io.netty</groupId>
+ <artifactId>netty-all</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-jms-server</artifactId>
+ <version>${activemq-artemis-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-amqp-protocol</artifactId>
+ <version>${activemq-artemis-version}</version>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.qpid</groupId>
+ <artifactId>proton-j</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Camel's AMQP connectivity -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-amqp</artifactId>
+ </dependency>
+
+ <!-- Testing -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-test-blueprint</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Test Logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- to generate the MANIFEST-FILE of the bundle -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ </plugin>
+
+ <!-- to run the example using mvn camel:run -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ <configuration>
+ <useBlueprint>true</useBlueprint>
+ </configuration>
+ </plugin>
+
+ <!-- to attach Features descritor for Karaf deployment -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/classes/features.xml</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*IntTest*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <!-- to run the test you need to enable this profile: mvn test -P itest -->
+ <profile>
+ <id>itest</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>**/*.xml</exclude>
+ </excludes>
+ <includes>
+ <include>**/*IntTest*</include>
+ </includes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ <profile>
+ <id>artemis</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>download-artemis-broker</id>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>apache-artemis</artifactId>
+ <version>${activemq-artemis-version}</version>
+ <classifier>bin</classifier>
+ <type>zip</type>
+ <overWrite>false</overWrite>
+ <outputDirectory>${project.build.directory}/</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.activemq</groupId>
+ <artifactId>artemis-maven-plugin</artifactId>
+ <version>${activemq-artemis-version}</version>
+ <executions>
+ <execution>
+ <id>create</id>
+ <goals>
+ <goal>create</goal>
+ </goals>
+ <configuration>
+ <home>${project.build.directory}/apache-artemis-${activemq-artemis-version}</home>
+ <instance>${project.build.directory}/artemis-instance</instance>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
new file mode 100644
index 0000000..1a2684d
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">
+
+ <!-- blueprint property placeholders -->
+ <cm:property-placeholder persistent-id="my-placeholders" update-strategy="reload">
+ <cm:default-properties>
+ <cm:property name="netty.port" value="9090"/>
+ </cm:default-properties>
+ </cm:property-placeholder>
+
+ <!-- JMS QPid Proton Configuration -->
+ <bean id="jmsConnectionFactory" class="org.apache.qpid.jms.JmsConnectionFactory">
+ <property name="remoteURI" value="amqp://localhost:5672"/>
+ </bean>
+
+ <!-- Camel AMQP Component configuration -->
+ <bean id="amqp" class="org.apache.camel.component.amqp.AMQPComponent">
+ <property name="connectionFactory" ref="jmsConnectionFactory"/>
+ </bean>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- AMQP producer example (HTTP triggered) -->
+ <route id="amqp-producer">
+ <from uri="netty-http:http:localhost:{{netty.port}}/message"/>
+ <log message="got Netty request, about to send AMQP message."/>
+ <to uri="amqp:queue:myqueue"/>
+ </route>
+
+ <!-- AMQP Consumer example -->
+ <route id="amqp-consumer">
+ <from uri="amqp:queue:myqueue"/>
+ <log message="got AMQP request, about to respond."/>
+ <setBody>
+ <simple>Hello from Camel's AMQP example</simple>
+ </setBody>
+ </route>
+
+ </camelContext>
+</blueprint>
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/main/resources/features.xml b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/features.xml
new file mode 100644
index 0000000..5e117e8
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/features.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<features>
+ <repository>mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features</repository>
+
+ <feature name="${project.artifactId}" version="${camel.version}">
+ <feature version="${camel.version}">camel</feature>
+ <feature version="${camel.version}">camel-blueprint</feature>
+ <feature version="${camel.version}">camel-amqp</feature>
+ <feature version="${camel.version}">camel-netty-http</feature>
+ <bundle>mvn:org.apache.camel.example/${project.artifactId}/${camel.version}</bundle>
+ </feature>
+
+</features>
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/main/resources/log4j2.properties b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..56ee6f3
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/main/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.out.ref = out
+
+# turn on logging on camel-jms to see more activity
+# logger.jms.name = org.apache.camel.component.jms
+# logger.jms.level = TRACE
+
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
new file mode 100644
index 0000000..2152934
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/ArtemisAmqpIntTest.java
@@ -0,0 +1,61 @@
+/*
+ * 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.example.artemis.amqp;
+
+import java.util.Dictionary;
+
+import org.apache.camel.test.AvailablePortFinder;
+import org.apache.camel.test.blueprint.CamelBlueprintTestSupport;
+import org.junit.Test;
+
+public class ArtemisAmqpIntTest extends CamelBlueprintTestSupport {
+
+ @Override
+ protected String getBlueprintDescriptor() {
+ return "/OSGI-INF/blueprint/camel-context.xml,"
+
+ //We add the embedded Artemis Broker
+ + "/OSGI-INF/blueprint/embedded-broker.xml";
+ }
+
+ @Override
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ protected String useOverridePropertiesWithConfigAdmin(Dictionary props) {
+ //obtain an available port
+ int port = AvailablePortFinder.getNextAvailable();
+
+ if (port != 9090) {
+ //override the Netty port to use
+ props.put("netty.port", "" + port);
+
+ //return the PID of the config-admin we are using in the blueprint xml file
+ return "my-placeholders";
+ } else {
+ // no update needed
+ return null;
+ }
+ }
+
+ @Test
+ public void testEmbeddedBroker() throws Exception {
+ //trigger
+ String response = template.requestBody("netty-http:http://localhost:{{netty.port}}/message", null, String.class);
+
+ //response validation
+ assertEquals("not expected", "Hello from Camel's AMQP example", response);
+ }
+}
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.java
new file mode 100644
index 0000000..2313810
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/java/org/apache/camel/example/artemis/amqp/EmbeddedBrokerSupport.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.example.artemis.amqp;
+
+import org.apache.activemq.artemis.jms.server.embedded.EmbeddedJMS;
+import org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager;
+
+// import org.apache.activemq.artemis.core.config.impl.SecurityConfiguration;
+// import org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule;
+
+
+//#################################################
+// Blueprint does not support Bean inheritance (necessary for Artemis EmbeddedJMS)
+// We need therefore a 'support' class
+//#################################################
+public class EmbeddedBrokerSupport extends EmbeddedJMS {
+
+ public EmbeddedBrokerSupport(ActiveMQJAASSecurityManager securityManager) throws Exception {
+ this.setSecurityManager(securityManager);
+ this.start();
+
+ //if you need more twicking use Java to customise as follows:
+ // SecurityConfiguration securityConfig = new SecurityConfiguration();
+ // securityConfig.addUser("guest", "guest");
+ // securityConfig.addRole("guest", "guest");
+ // securityConfig.setDefaultUser("guest");
+ // ActiveMQJAASSecurityManager securityManager = new ActiveMQJAASSecurityManager(InVMLoginModule.class.getName(), securityConfig);
+ // this.setSecurityManager(securityManager);
+ }
+
+ public void close() throws Exception {
+ this.stop();
+ }
+}
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml
new file mode 100644
index 0000000..0cc179e
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/OSGI-INF/blueprint/embedded-broker.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
+ http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.1.0.xsd">
+
+
+ <!-- Security Manager with default user -->
+ <bean id="securityManager" class="org.apache.activemq.artemis.spi.core.security.ActiveMQJAASSecurityManager">
+ <argument value="org.apache.activemq.artemis.spi.core.security.jaas.InVMLoginModule"/>
+ <argument>
+ <bean class="org.apache.activemq.artemis.core.config.impl.SecurityConfiguration">
+ <argument>
+ <map>
+ <entry key="guest" value="guest"/>
+ </map>
+ </argument>
+ <argument>
+ <map>
+ <entry key="guest">
+ <list>
+ <value>guest</value>
+ </list>
+ </entry>
+ </map>
+ </argument>
+ <property name="defaultUser" value="guest"/>
+ </bean>
+ </argument>
+ </bean>
+
+ <!-- Blueprint does not support Bean inheritance (necessary for Artemis EmbeddedJMS)
+ We need therefore a 'support' class -->
+ <bean id="embeddedJMS"
+ class="org.apache.camel.example.artemis.amqp.EmbeddedBrokerSupport"
+ destroy-method="close">
+ <argument ref="securityManager"/>
+ </bean>
+
+
+
+</blueprint>
diff --git a/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml
new file mode 100644
index 0000000..746eaf3
--- /dev/null
+++ b/examples/camel-example-artemis-amqp-blueprint/src/test/resources/broker.xml
@@ -0,0 +1,48 @@
+<?xml version='1.0'?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="urn:activemq"
+ xsi:schemaLocation="urn:activemq /schema/artemis-server.xsd">
+
+ <core xmlns="urn:activemq:core">
+
+ <persistence-enabled>false</persistence-enabled>
+
+
+ <acceptors>
+ <!-- AMQP Acceptor. Listens on default AMQP port for AMQP traffic.-->
+ <acceptor name="amqp">tcp://0.0.0.0:5672?tcpSendBufferSize=1048576;tcpReceiveBufferSize=1048576;protocols=AMQP;useEpoll=true;amqpCredits=1000;amqpMinCredits=300</acceptor>
+ </acceptors>
+
+
+ <security-settings>
+ <!--security for example queue-->
+ <security-setting match="#">
+ <permission type="createDurableQueue" roles="guest"/>
+ <permission type="deleteDurableQueue" roles="guest"/>
+ <permission type="createNonDurableQueue" roles="guest"/>
+ <permission type="deleteNonDurableQueue" roles="guest"/>
+ <permission type="consume" roles="guest"/>
+ <permission type="send" roles="guest"/>
+ </security-setting>
+ </security-settings>
+
+ </core>
+</configuration>
\ No newline at end of file
diff --git a/examples/camel-example-cxf-blueprint/README.adoc b/examples/camel-example-cxf-blueprint/README.adoc
new file mode 100644
index 0000000..30b5ad0
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/README.adoc
@@ -0,0 +1,112 @@
+== CXF OSGI Example using Blueprint
+
+=== Introduction
+
+A simple example which receives web service calls (via a CXF consumer,
+using bean binding) and writes these requests into the file system. It's
+not a very useful use case, but the goal of this example is to show you
+how you can use the CXF consumer component in an OSGI environment with
+the OSGI HTTP service. If your target container is Apache Karaf or
+Apache ServiceMix, you can use PAX Web to setup and start an OSGI HTTP
+service. All Camel bundles using a Camel CXF consumer can use this HTTP
+service without needing to start individual Jetty instances. Another
+advantage is that all provided services can now share the same port.
+
+=== Build
+
+You will need to compile this example first:
+
+....
+mvn install
+....
+
+=== Run
+
+To run the example on Apache Karaf 4.x or newer
+
+==== Step 1: Karaf
+
+Launch the server
+
+....
+karaf / karaf.bat
+....
+
+==== Step 2: Add features
+
+Add features required
+
+....
+feature:repo-add camel ${version}
+feature:install war
+feature:install cxf
+feature:install camel
+feature:install camel-jaxb
+feature:install camel-cxf
+....
+
+==== Step 3: Deploy
+
+Deploy the example
+
+....
+install -s mvn:org.apache.camel.example/camel-example-cxf-blueprint/${version}
+....
+
+==== Step 4: Verify that your service is available using the following url in the browser.
+
+We assume you're using Karaf's default PAX Web configuration which uses
+port `8181` for http. If you would like to use another port or https,
+change the configuration in `+${KARAF_HOME}/etc/org.ops4j.pax.web.cfg+`.
+The immediate extension after the hostname and port (`cxf` in the
+below URL) is configured via the org.apache.cxf.osgi.cfg file (Please
+see http://team.ops4j.org/wiki//display/paxweb/Pax+Web for more
+information on PAX Web).
+
+....
+http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl
+....
+
+http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl
+
+==== Step 5: Start SOAPUI (2.x or later)
+
+Create a new project called camel-example-cxf-osgi Point to the
+following url:
+http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident?wsdl
+Open the request 1 (under camel-example-cxf-blueprint –>
+ReportIncidentBinding –> ReportIncident) and copy/paste a SOAP message
+generated by the unit test, for example:
+
+....
+ <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+ <soap:Header />
+ <soap:Body>
+ <ns2:inputReportIncident xmlns:ns2="http://reportincident.example.camel.apache.org">
+ <incidentId>111</incidentId>
+ <incidentDate>2011-03-05</incidentDate>
+ <givenName>Christian</givenName>
+ <familyName>Mueller</familyName>
+ <summary>Bla</summary>
+ <details>Bla bla</details>
+ <email>cmueller@apache.org</email>
+ <phone>0049 69 1234567</phone>
+ </ns2:inputReportIncident>
+ </soap:Body>
+ </soap:Envelope>
+....
+
+==== Step 6: Check the file system
+
+Check the folder `target/inbox/` in the Karaf base directory to see
+that a message has arrived.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-cxf-blueprint/pom.xml b/examples/camel-example-cxf-blueprint/pom.xml
new file mode 100644
index 0000000..48f518e
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-cxf-blueprint</artifactId>
+ <name>Camel :: Example :: CXF :: Blueprint</name>
+ <description>An example which use a CXF consumer and the OSGI HTTP Service</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>OSGi</category>
+ <title>CXF Blueprint</title>
+
+ <camel.osgi.export.pkg>
+ org.apache.camel.example.reportincident*
+ </camel.osgi.export.pkg>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cxf</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- CXF wsdl2java generator, will plugin to the compile goal -->
+ <plugin>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-codegen-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-sources</id>
+ <phase>generate-sources</phase>
+ <configuration>
+ <fork>${cxf.codegenplugin.forkmode}</fork>
+ <additionalJvmArgs>${cxf.codegen.jvmArgs}</additionalJvmArgs>
+ <sourceRoot>${basedir}/target/generated/src/main/java</sourceRoot>
+ <wsdlOptions>
+ <wsdlOption>
+ <wsdl>${basedir}/src/main/resources/META-INF/wsdl/report_incident.wsdl</wsdl>
+ </wsdlOption>
+ </wsdlOptions>
+ </configuration>
+ <goals>
+ <goal>wsdl2java</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/examples/camel-example-cxf-blueprint/src/main/java/org/apache/camel/example/reportincident/ReportIncidentRoutes.java b/examples/camel-example-cxf-blueprint/src/main/java/org/apache/camel/example/reportincident/ReportIncidentRoutes.java
new file mode 100644
index 0000000..98e74ca
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/src/main/java/org/apache/camel/example/reportincident/ReportIncidentRoutes.java
@@ -0,0 +1,45 @@
+/*
+ * 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.example.reportincident;
+
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * Our routes that we can build using Camel DSL as we extend the RouteBuilder class.
+ * <p/>
+ * In the configure method we have all kind of DSL methods we use for expressing our routes.
+ */
+public class ReportIncidentRoutes extends RouteBuilder {
+
+ @Override
+ public void configure() throws Exception {
+ // webservice responses
+ OutputReportIncident ok = new OutputReportIncident();
+ ok.setCode("OK");
+
+ OutputReportIncident accepted = new OutputReportIncident();
+ accepted.setCode("Accepted");
+
+ from("cxf:bean:reportIncident")
+ .convertBodyTo(InputReportIncident.class)
+ .wireTap("file://target/inbox/?fileName=request-${date:now:yyyy-MM-dd-HHmmssSSS}")
+ .choice().when(simple("${body.givenName} == 'Claus'"))
+ .transform(constant(ok))
+ .otherwise()
+ .transform(constant(accepted));
+ }
+}
diff --git a/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl b/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl
new file mode 100644
index 0000000..764e90f
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/src/main/resources/META-INF/wsdl/report_incident.wsdl
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+
+<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://reportincident.example.camel.apache.org"
+ xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ targetNamespace="http://reportincident.example.camel.apache.org">
+
+ <!-- Type definitions for input- and output parameters for webservice -->
+ <wsdl:types>
+ <xs:schema targetNamespace="http://reportincident.example.camel.apache.org">
+ <xs:element name="inputReportIncident">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="xs:string" name="incidentId"/>
+ <xs:element type="xs:string" name="incidentDate"/>
+ <xs:element type="xs:string" name="givenName"/>
+ <xs:element type="xs:string" name="familyName"/>
+ <xs:element type="xs:string" name="summary"/>
+ <xs:element type="xs:string" name="details"/>
+ <xs:element type="xs:string" name="email"/>
+ <xs:element type="xs:string" name="phone"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="outputReportIncident">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element type="xs:string" name="code"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+
+ <!-- Message definitions for input and output -->
+ <wsdl:message name="inputReportIncident">
+ <wsdl:part name="in" element="tns:inputReportIncident"/>
+ </wsdl:message>
+ <wsdl:message name="outputReportIncident">
+ <wsdl:part name="out" element="tns:outputReportIncident"/>
+ </wsdl:message>
+
+ <!-- Port (interface) definitions -->
+ <wsdl:portType name="ReportIncidentEndpoint">
+ <wsdl:operation name="ReportIncident">
+ <wsdl:input message="tns:inputReportIncident"/>
+ <wsdl:output message="tns:outputReportIncident"/>
+ </wsdl:operation>
+ </wsdl:portType>
+
+ <!-- Port bindings to transports and encoding - HTTP, document literal encoding is used -->
+ <wsdl:binding name="ReportIncidentBinding" type="tns:ReportIncidentEndpoint">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="ReportIncident">
+ <soap:operation
+ soapAction="http://reportincident.example.camel.apache.org/ReportIncident"
+ style="document"/>
+ <wsdl:input>
+ <soap:body parts="in" use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body parts="out" use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+
+ <!-- Service definition -->
+ <wsdl:service name="ReportIncidentEndpointService">
+ <wsdl:port name="ReportIncidentEndpoint" binding="tns:ReportIncidentBinding">
+ <soap:address location="http://localhost:8181/cxf/camel-example-cxf-blueprint/webservices/incident"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
diff --git a/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml b/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
new file mode 100644
index 0000000..eea1857
--- /dev/null
+++ b/examples/camel-example-cxf-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
+ xmlns:cxf="http://cxf.apache.org/blueprint/core"
+ xmlns:camel="http://camel.apache.org/schema/blueprint"
+ xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
+ http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+ ">
+
+ <camelcxf:cxfEndpoint id="reportIncident"
+ address="/camel-example-cxf-blueprint/webservices/incident"
+ endpointName="s:ReportIncidentEndpoint"
+ serviceName="s:ReportIncidentEndpointService"
+ wsdlURL="META-INF/wsdl/report_incident.wsdl"
+ serviceClass="org.apache.camel.example.reportincident.ReportIncidentEndpoint"
+ xmlns:s="http://reportincident.example.camel.apache.org"/>
+
+ <bean id="reportIncidentRoutes" class="org.apache.camel.example.reportincident.ReportIncidentRoutes"/>
+
+ <camelContext id="camel" xmlns="http://camel.apache.org/schema/blueprint">
+ <routeBuilder ref="reportIncidentRoutes"/>
+ </camelContext>
+
+</blueprint>
diff --git a/examples/camel-example-fhir-osgi/README.adoc b/examples/camel-example-fhir-osgi/README.adoc
new file mode 100644
index 0000000..d560afe
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/README.adoc
@@ -0,0 +1,166 @@
+== FHIR Example - OSGi
+
+=== Introduction
+
+This is an example application of the `+camel-fhir+` component that can
+be executed inside an OSGi container. We will be using Apache Karaf.
+
+The example assumes you have a running FHIR server at your disposal. You
+may use
+https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jpaserver-example[hapi-fhir-jpa-server-example]
+
+By default, the example uses
+`+http://localhost:8080/hapi-fhir-jpaserver-example/baseDstu3+` as the
+FHIR server URL, DSTU3 as the FHIR version and
+`+target/work/fhir/input+` as the directory to look for HL7V2 patients.
+However, you can edit the
+`+org.apache.camel.example.fhir.osgi.configuration.cfg+` file to
+override the defaults and provide your own configuration.
+
+=== Build
+
+You will need to build this example first:
+
+[source,sh]
+----
+$ mvn install
+----
+
+=== Run OSGi / Karaf
+
+This example can be executed within Karaf 4.x
+
+To run the example, from the command line:
+
+[arabic]
+. In the Karaf install root directory, start Karaf:
++
+[source,sh]
+----
+$ bin/karaf
+----
+. Install the pre-requisites:
++
+[source,sh]
+----
+karaf@root()> repo-add camel ${version}
+karaf@root()> feature:install camel-blueprint camel-hl7 camel-fhir
+----
+. Copy the configuration file
+org.apache.camel.example.fhir.osgi.configuration.cfg to the etc/
+directory of your Karaf installation:
+`+InstallDir/etc/org.apache.camel.example.fhir.osgi.configuration.cfg+`
+. Then install and start the example:
++
+[source,sh]
+----
+karaf@root()> install -s mvn:org.apache.camel.example/camel-example-fhir-osgi/${version}
+----
+
+When the Camel application runs, you should see a folder created under
+`+work/fhir/input+`. Copy the file `+hl7v2.patient+` located in the
+`+data+` folder into it.
+
+By tailing the log with:
+
+....
+```sh
+karaf@root()> log:tail
+```
+....
+
+The following messages should be displayed:
+
+....
+```
+2018-07-17 17:02:35,590 | INFO | nt Dispatcher: 1 | FhirContext | 52 - ca.uhn.hapi.fhir.hapi-fhir-base - 3.3.0 | Creating new FHIR context for FHIR version [DSTU3]
+2018-07-17 17:02:35,631 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Route: fhir-example-osgi started and consuming from: file://work/fhir/input
+2018-07-17 17:02:35,631 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Total 1 routes, of which 1 are started
+2018-07-17 17:02:35,632 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-fhir) started in 0.853 seconds
+2018-07-17 17:03:06,157 | INFO | /work/fhir/input | fhir-example-osgi | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Converting hl7v2.patient
+2018-07-17 17:03:06,577 | INFO | /work/fhir/input | fhir-example-osgi | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Inserting Patient: {"resourceType":"Patient","id":"100005056","name":[{"family":"Freeman","given":["Vincent"]}]}
+2018-07-17 17:03:08,829 | INFO | d #2 - CamelFhir | fhir-example-osgi | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Patient created successfully: true
+```
+....
+
+Hit ctrl+c to exit the log command.
+
+Camel commands can be used to gain some insights on the Camel context,
+e.g.:
+
+* The `+camel:context-list+` displays the Camel context:
++
+....
+karaf@root()> camel:context-list
+ Context Status Total # Failed # Inflight # Uptime
+ ------- ------ ------- -------- ---------- ------
+ camel-fhir Started 1 0 0 3 minute
+....
+* The `+camel:route-list+` command displays the Camel routes:
++
+....
+karaf@root()> camel:route-list
+ Context Route Status Total # Failed # Inflight # Uptime
+ ------- ----- ------ ------- -------- ---------- ------
+ camel-fhir fhir-example-osgi Started 1 0 0 4 minutes
+....
+* And the `+camel:route-info+` command displays route information:
++
+....
+karaf@root()> camel:route-info camel-fhir fhir-example-osgi
+Camel Route fhir-example-osgi
+ Camel Context: camel-fhir
+ State: Started
+ State: Started
+
+
+Statistics
+ Exchanges Total: 1
+ Exchanges Completed: 1
+ Exchanges Failed: 0
+ Exchanges Inflight: 0
+ Min Processing Time: 2674 ms
+ Max Processing Time: 2674 ms
+ Mean Processing Time: 2674 ms
+ Total Processing Time: 2674 ms
+ Last Processing Time: 2674 ms
+ Delta Processing Time: 2674 ms
+ Start Statistics Date: 2018-07-17 17:02:35
+ Reset Statistics Date: 2018-07-17 17:02:35
+ First Exchange Date: 2018-07-17 17:03:08
+ Last Exchange Date: 2018-07-17 17:03:08
+....
+
+Finally, you can stop the example with:
+
+....
+```sh
+karaf@root()> uninstall camel-example-fhir-osgi
+```
+....
+
+And check in the log that the Camel context has been gracefully
+shutdown:
+
+....
+```
+2018-07-17 17:09:32,418 | INFO | xample-fhir-osgi | BlueprintExtender | 12 - org.apache.aries.blueprint.core - 1.8.3 | Destroying BlueprintContainer for bundle org.apache.camel.example.camel-example-fhir-osgi/2.23.0.SNAPSHOT
+2018-07-17 17:09:32,420 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Stopping CamelContext: camel-fhir
+2018-07-17 17:09:32,421 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-fhir) is shutting down
+2018-07-17 17:09:32,423 | INFO | nt Dispatcher: 1 | DefaultShutdownStrategy | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Starting to graceful shutdown 1 routes (timeout 300 seconds)
+2018-07-17 17:09:32,427 | INFO | 3 - ShutdownTask | DefaultShutdownStrategy | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Route: fhir-example-osgi shutdown complete, was consuming from: file://work/fhir/input
+2018-07-17 17:09:32,428 | INFO | nt Dispatcher: 1 | DefaultShutdownStrategy | 61 - org.apache.camel.camel-core - 2.23.0.SNAPSHOT | Graceful shutdown of 1 routes completed in 0 seconds
+2018-07-17 17:09:32,438 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-fhir) uptime 6 minutes
+2018-07-17 17:09:32,438 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 59 - org.apache.camel.camel-blueprint - 2.23.0.SNAPSHOT | Apache Camel 3.0.0-SNAPSHOT (CamelContext: camel-fhir) is shutdown in 0.017 seconds
+```
+....
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-fhir-osgi/org.apache.camel.example.fhir.osgi.configuration.cfg b/examples/camel-example-fhir-osgi/org.apache.camel.example.fhir.osgi.configuration.cfg
new file mode 100644
index 0000000..7c159c3
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/org.apache.camel.example.fhir.osgi.configuration.cfg
@@ -0,0 +1,19 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+serverUrl=http://localhost:8080/hapi-fhir-jpaserver-example/baseDstu3
+fhirVersion=DSTU3
+input=work/fhir/input
\ No newline at end of file
diff --git a/examples/camel-example-fhir-osgi/pom.xml b/examples/camel-example-fhir-osgi/pom.xml
new file mode 100644
index 0000000..e41c09d
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/pom.xml
@@ -0,0 +1,260 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-fhir-osgi</artifactId>
+ <name>Camel :: Example :: FHIR :: OSGi</name>
+ <description>An example running Camel FHIR using OSGi Blueprint</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>Health Care</category>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <!-- Add Camel Karaf BOM -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-fhir</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-hl7</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>ca.uhn.hapi</groupId>
+ <artifactId>hapi-structures-v24</artifactId>
+ <version>${hapi-version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.inject</groupId>
+ <artifactId>javax.inject</artifactId>
+ <version>1</version>
+ </dependency>
+
+
+ <!-- OSGi API -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ <scope>provided</scope>
+ <version>${osgi-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ <scope>provided</scope>
+ <version>${osgi-version}</version>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <scope>runtime</scope>
+ <version>${log4j2-version}</version>
+ </dependency>
+
+ <!-- test -->
+
+ <!-- PAX Exam -->
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam</artifactId>
+ <scope>test</scope>
+ <version>${pax-exam-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-spi</artifactId>
+ <version>${pax-exam-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-junit4</artifactId>
+ <scope>test</scope>
+ <version>${pax-exam-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.exam</groupId>
+ <artifactId>pax-exam-container-karaf</artifactId>
+ <version>${pax-exam-version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.url</groupId>
+ <artifactId>pax-url-aether</artifactId>
+ <version>${pax-url-aether}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.ops4j.pax.tinybundles</groupId>
+ <artifactId>tinybundles</artifactId>
+ <version>${tinybundles-version}</version>
+ <scope>test</scope>
+ </dependency>
+
+ <!-- Karaf & Command Shell -->
+ <dependency>
+ <groupId>org.apache.karaf</groupId>
+ <artifactId>apache-karaf</artifactId>
+ <version>${karaf4-version}</version>
+ <type>zip</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.karaf.features</groupId>
+ <artifactId>framework</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Karaf Features -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>apache-camel</artifactId>
+ <version>${camel.version}</version>
+ <classifier>features</classifier>
+ <type>xml</type>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <!-- Easier to get the local artifact from the integration tests -->
+ <finalName>${project.artifactId}</finalName>
+
+ <plugins>
+
+ <!-- Camel plugin to run the example in Java SE -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.servicemix.tooling</groupId>
+ <artifactId>depends-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-depends-file</id>
+ <goals>
+ <goal>generate-depends-file</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>org.apache.camel.example.fhir.osgi*</Export-Package>
+ <Import-Package>*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>it-fhir</id>
+ <build>
+ <plugins>
+ <!-- Execute in the integration-test phase so that the packaged JAR can be used -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <include>**/*IT.java</include>
+ </includes>
+ <forkedProcessTimeoutInSeconds>300</forkedProcessTimeoutInSeconds>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
diff --git a/examples/camel-example-fhir-osgi/src/main/data/hl7v2.patient b/examples/camel-example-fhir-osgi/src/main/data/hl7v2.patient
new file mode 100644
index 0000000..b5ecbe7
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/main/data/hl7v2.patient
@@ -0,0 +1 @@
+MSH|^~\&|Amalga HIS|BUM|New Tester|MS|20111121103141||ORU^R01|2847970-201111211031|P|2.4|||AL|NE|764|ASCII|||
PID||100005056|100005056||Freeman^Vincent^""^^""|""|19810813000000|F||CA|Street 1^""^""^""^34000^SGP^^""~""^""^""^""^Danling Street 5th^THA^^""||326-2275^PRN^PH^^66^675~476-5059^ORN^CP^^66^359~(123)456-7890^ORN^FX^^66^222~^NET^X.400^a@a.a~^NET^X.400^dummy@hotmail.com|(123)456-7890^WPN^PH^^66|UNK|S|BUD||BP000111899|D99999^""||CA|Bangkok|||THA||THA|""|N
PV1||OPD ||||""^""^""||||CNSLT|||||C|VIP|||6262618|PB1||||||||||||||||||||||||20101208134638
PV2|||^Unknown|""^""||||""|""|0||""|||||||||||||||||||||||||||||HP1
ORC|NW|""|BMC1102771601|""|CM||^^^^^""|||||||||""^""^^^""
OBR|1|""|BMC1102771601|""^Brain (CT)||20111028124215||||||||||||||||||CTSCAN|F||^^^^^ROUTINE|||""||||||""|||||||||||^""
OBX|1|FT|""^Brain (CT)||++++ text of report goes here +++|||REQAT|||FINAL|||20111121103040||75929^Gosselin^Angelina
\ No newline at end of file
diff --git a/examples/camel-example-fhir-osgi/src/main/java/org/apache/camel/example/fhir/osgi/FhirRoute.java b/examples/camel-example-fhir-osgi/src/main/java/org/apache/camel/example/fhir/osgi/FhirRoute.java
new file mode 100644
index 0000000..9da94b1
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/main/java/org/apache/camel/example/fhir/osgi/FhirRoute.java
@@ -0,0 +1,65 @@
+/*
+ * 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.example.fhir.osgi;
+
+import ca.uhn.hl7v2.HL7Exception;
+import ca.uhn.hl7v2.model.v24.message.ORU_R01;
+import ca.uhn.hl7v2.model.v24.segment.PID;
+import org.apache.camel.LoggingLevel;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.http.ProtocolException;
+import org.hl7.fhir.dstu3.model.Patient;
+
+public class FhirRoute extends RouteBuilder {
+
+ @Override
+ public void configure() {
+ from("file:{{input}}").routeId("fhir-example-osgi")
+ .onException(ProtocolException.class)
+ .handled(true)
+ .log(LoggingLevel.ERROR, "Error connecting to FHIR server with URL:{{serverUrl}}, "
+ + "please check the org.apache.camel.example.fhir.osgi.configuration.cfg configuration file ${exception.message}")
+ .end()
+ .onException(HL7Exception.class)
+ .handled(true)
+ .log(LoggingLevel.ERROR, "Error unmarshalling ${file:name} ${exception.message}")
+ .end()
+ .log("Converting ${file:name}")
+ // unmarshall file to hl7 message
+ .unmarshal().hl7()
+ // very simple mapping from a HLV2 patient to dstu3 patient
+ .process(exchange -> {
+ ORU_R01 msg = exchange.getIn().getBody(ORU_R01.class);
+ final PID pid = msg.getPATIENT_RESULT().getPATIENT().getPID();
+ String surname = pid.getPatientName()[0].getFamilyName().getFn1_Surname().getValue();
+ String name = pid.getPatientName()[0].getGivenName().getValue();
+ String patientId = msg.getPATIENT_RESULT().getPATIENT().getPID().getPatientID().getCx1_ID().getValue();
+ Patient patient = new Patient();
+ patient.addName().addGiven(name);
+ patient.getNameFirstRep().setFamily(surname);
+ patient.setId(patientId);
+ exchange.getIn().setBody(patient);
+ })
+ // marshall to JSON for logging
+ .marshal().fhirJson("{{fhirVersion}}")
+ .log("Inserting Patient: ${body}")
+ // create Patient in our FHIR server
+ .to("fhir://create/resource?inBody=resourceAsString&serverUrl={{serverUrl}}&fhirVersion={{fhirVersion}}")
+ // log the outcome
+ .log("Patient created successfully: ${body.getCreated}");
+ }
+}
diff --git a/examples/camel-example-fhir-osgi/src/main/resources/OSGI-INF/blueprint/camel-context.xml b/examples/camel-example-fhir-osgi/src/main/resources/OSGI-INF/blueprint/camel-context.xml
new file mode 100644
index 0000000..650f76a
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xsi:schemaLocation="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
+
+ <cm:property-placeholder id="placeholder" persistent-id="org.apache.camel.example.fhir.osgi.configuration" />
+
+ <bean id="fhirRoute" class="org.apache.camel.example.fhir.osgi.FhirRoute"/>
+
+ <camelContext id="camel-fhir" xmlns="http://camel.apache.org/schema/blueprint">
+ <routeBuilder ref="fhirRoute"/>
+ </camelContext>
+
+</blueprint>
diff --git a/examples/camel-example-fhir-osgi/src/main/resources/log4j2.properties b/examples/camel-example-fhir-osgi/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..9deb51c
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.console.ref = console
diff --git a/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/FhirOsgiIT.java b/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/FhirOsgiIT.java
new file mode 100644
index 0000000..68414ab
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/FhirOsgiIT.java
@@ -0,0 +1,79 @@
+/*
+ * 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.example.fhir.osgi;
+
+import java.io.File;
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+
+import javax.inject.Inject;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.ServiceStatus;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.CoreOptions;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.ops4j.pax.exam.CoreOptions.options;
+import static org.ops4j.pax.exam.CoreOptions.streamBundle;
+import static org.ops4j.pax.exam.CoreOptions.when;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.debugConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class FhirOsgiIT {
+
+ @Inject
+ private CamelContext context;
+
+ @Configuration
+ public Option[] config() throws IOException {
+ return options(
+ PaxExamOptions.KARAF.option(),
+ PaxExamOptions.CAMEL_FHIR.option(),
+ streamBundle(
+ TinyBundles.bundle()
+ .read(
+ Files.newInputStream(
+ Paths.get("target")
+ .resolve("camel-example-fhir-osgi.jar")))
+ .build()),
+ when(false)
+ .useOptions(
+ debugConfiguration("5005", true)),
+ CoreOptions.composite(editConfigurationFilePut(
+ "etc/org.apache.camel.example.fhir.osgi.configuration.cfg",
+ new File("org.apache.camel.example.fhir.osgi.configuration.cfg")))
+ );
+ }
+
+ @Test
+ public void testRouteStatus() {
+ assertNotNull(context);
+ assertEquals("Route status is incorrect!", ServiceStatus.Started, context.getRouteController().getRouteStatus("fhir-example-osgi"));
+ }
+}
diff --git a/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/PaxExamOptions.java b/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/PaxExamOptions.java
new file mode 100644
index 0000000..f470523
--- /dev/null
+++ b/examples/camel-example-fhir-osgi/src/test/java/org/apache/camel/example/fhir/osgi/PaxExamOptions.java
@@ -0,0 +1,71 @@
+/*
+ * 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.example.fhir.osgi;
+
+import java.io.File;
+
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.karaf.options.LogLevelOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+
+import static org.ops4j.pax.exam.CoreOptions.maven;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.configureConsole;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
+import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
+
+public enum PaxExamOptions {
+
+ KARAF(
+ karafDistributionConfiguration()
+ .frameworkUrl(
+ maven()
+ .groupId("org.apache.karaf")
+ .artifactId("apache-karaf")
+ .versionAsInProject()
+ .type("zip"))
+ .name("Apache Karaf")
+ .useDeployFolder(false)
+ .unpackDirectory(new File("target/paxexam/unpack/")),
+ keepRuntimeFolder(),
+ // Don't bother with local console output as it just ends up cluttering the logs
+ configureConsole().ignoreLocalConsole(),
+ // Force the log level to INFO so we have more details during the test. It defaults to WARN.
+ logLevel(LogLevelOption.LogLevel.INFO)
+ ),
+ CAMEL_FHIR(
+ features(
+ maven()
+ .groupId("org.apache.camel.karaf")
+ .artifactId("apache-camel")
+ .type("xml")
+ .classifier("features")
+ .versionAsInProject(),
+ "camel-blueprint", "camel-fhir", "camel-hl7")
+ );
+
+ private final Option[] options;
+
+ PaxExamOptions(Option... options) {
+ this.options = options;
+ }
+
+ public Option option() {
+ return new DefaultCompositeOption(options);
+ }
+}
diff --git a/examples/camel-example-olingo4-blueprint/README.adoc b/examples/camel-example-olingo4-blueprint/README.adoc
new file mode 100644
index 0000000..ff346b8
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/README.adoc
@@ -0,0 +1,75 @@
+== Camel Olingo4 OSGI Example using Blueprint
+
+=== Introduction
+
+This example shows how to use the camel-olingo4 component in an OSGI
+environment. We will use the the sample OData 4.0 remote TripPinservice
+published on http://services.odata.org/TripPinRESTierService by creating
+two People who’s data are loaded from a directory.
+
+==== OSGi / Karaf
+
+This example can be executed within Karaf 4.x. and relies on the
+`+camel-olingo4+` feature.
+
+To run the example, from the command line:
+
+[arabic]
+. In the Karaf install root directory, start Karaf:
++
+[source,sh]
+----
+$ bin/karaf
+----
+. Install the pre-requisites:
++
+[source,sh]
+----
+karaf@root()> repo-add camel ${version}
+karaf@root()> feature:install camel-blueprint camel-olingo4
+----
+. Then install and start the example:
++
+[source,sh]
+----
+karaf@root()> install -s mvn:org.apache.camel.example/camel-example-olingo4-blueprint/${version}
+----
+. Copy the files found in `+src/main/resources+` to the
+`+work/odata/input+` in the karaf install root directory created by the
+camel route.
+
+By tailing the log with:
+
+[source,sh]
+----
+karaf@root()> log:tail
+----
+
+The following messages should be displayed:
+
+....
+2017-11-29 15:46:22,524 | INFO | nt Dispatcher: 1 | BlueprintCamelContext | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Apache Camel 2.21.0-SNAPSHOT (CamelContext: odata4-example-context) started in 0.102 seconds
+2017-11-29 15:46:23,528 | INFO | work/odata/input | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Receiving file person2.json
+2017-11-29 15:46:23,528 | INFO | work/odata/input | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Sending file person2.json to OData Test Service
+2017-11-29 15:46:24,317 | INFO | work/odata/input | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Receiving file person1.json
+2017-11-29 15:46:24,317 | INFO | work/odata/input | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Sending file person1.json to OData Test Service
+2017-11-29 15:46:24,665 | INFO | I/O dispatcher 1 | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Done creating person with properties [ClientPropertyImpl{name=UserName, value=jdoe, annotations=[]}, ClientPropertyImpl{name=FirstName, value=John, annotations=[]}, ClientPropertyImpl{name=LastName, value=Doe, annotations=[]}, ClientPropertyImpl{name=MiddleName, value=, annotations=[]}, ClientPropertyImpl{name=Gender, value=Male, annotations=[]}, Cl [...]
+2017-11-29 15:46:24,689 | INFO | I/O dispatcher 2 | odata-route | 62 - org.apache.camel.camel-core - 2.21.0.SNAPSHOT | Done creating person with properties [ClientPropertyImpl{name=UserName, value=jmorrow, annotations=[]}, ClientPropertyImpl{name=FirstName, value=Jerome, annotations=[]}, ClientPropertyImpl{name=LastName, value=Morrow, annotations=[]}, ClientPropertyImpl{name=MiddleName, value=, annotations=[]}, ClientPropertyImpl{name=Gender, value=Male, annotations [...]
+....
+
+You can uninstall the example with:
+
+[source,sh]
+----
+karaf@root()> uninstall camel-example-olingo4-blueprint
+----
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-olingo4-blueprint/pom.xml b/examples/camel-example-olingo4-blueprint/pom.xml
new file mode 100644
index 0000000..5d08796
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/pom.xml
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-olingo4-blueprint</artifactId>
+ <name>Camel :: Example :: Olingo4 :: OSGi</name>
+ <description>An example which use the Olingo4 component in OSGi Blueprint</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>OSGi</category>
+ <title>Olingo4 OSGi</title>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <!-- Add Camel Karaf BOM -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-bom</artifactId>
+ <version>${camel.karaf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-olingo4</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/examples/camel-example-olingo4-blueprint/src/main/java/org/apache/camel/example/olingo4/blueprint/Olingo4TestConfiguration.java b/examples/camel-example-olingo4-blueprint/src/main/java/org/apache/camel/example/olingo4/blueprint/Olingo4TestConfiguration.java
new file mode 100644
index 0000000..6d7083b
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/src/main/java/org/apache/camel/example/olingo4/blueprint/Olingo4TestConfiguration.java
@@ -0,0 +1,51 @@
+/*
+ * 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.example.olingo4.blueprint;
+
+import java.io.IOException;
+
+import org.apache.camel.component.olingo4.Olingo4Configuration;
+import org.apache.http.HttpHost;
+import org.apache.http.client.methods.HttpGet;
+import org.apache.http.client.methods.HttpUriRequest;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.HttpContext;
+
+public class Olingo4TestConfiguration extends Olingo4Configuration {
+
+ public Olingo4TestConfiguration() {
+ setServiceUri(getTestServiceUri("http://services.odata.org/TripPinRESTierService"));
+ setContentType("application/json;charset=utf-8");
+ }
+
+ protected String getTestServiceUri(String baseUrl) {
+ CloseableHttpClient httpclient = HttpClients.createDefault();
+ HttpGet httpGet = new HttpGet(baseUrl);
+ HttpContext httpContext = new BasicHttpContext();
+ try {
+ httpclient.execute(httpGet, httpContext);
+ } catch (IOException e) {
+ throw new RuntimeException("Error getting OData Test service URI using base URL:" + baseUrl);
+ }
+ HttpUriRequest currentReq = (HttpUriRequest)httpContext.getAttribute("http.request");
+ HttpHost currentHost = (HttpHost)httpContext.getAttribute("http.target_host");
+ String currentUrl = currentHost.toURI() + currentReq.getURI();
+ return currentUrl;
+ }
+}
diff --git a/examples/camel-example-olingo4-blueprint/src/main/resources/OSGI-INF/blueprint/odata.xml b/examples/camel-example-olingo4-blueprint/src/main/resources/OSGI-INF/blueprint/odata.xml
new file mode 100644
index 0000000..80f25a4
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/src/main/resources/OSGI-INF/blueprint/odata.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
+
+ <bean id="odata4" class="org.apache.camel.component.olingo4.Olingo4Component">
+ <property name="configuration" ref="odata4Configuration"/>
+ </bean>
+
+ <bean id="odata4Configuration" class="org.apache.camel.example.olingo4.blueprint.Olingo4TestConfiguration"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint" id="odata4-example-context">
+ <route id="odata-route">
+
+ <from uri="file:work/odata/input" />
+
+ <log message="Receiving file ${file:name}" />
+ <log message="Sending file ${file:name} to OData Test Service" />
+
+ <unmarshal>
+ <string charset="UTF-8"/>
+ </unmarshal>
+
+ <to uri="odata4://create/People"/>
+
+ <log message="Done creating person with properties ${body.properties}" />
+ </route>
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/examples/camel-example-olingo4-blueprint/src/main/resources/data/person1.json b/examples/camel-example-olingo4-blueprint/src/main/resources/data/person1.json
new file mode 100644
index 0000000..ee373c6
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/src/main/resources/data/person1.json
@@ -0,0 +1,5 @@
+{
+ "UserName": "jmorrow",
+ "FirstName": "Jerome",
+ "LastName": "Morrow"
+}
\ No newline at end of file
diff --git a/examples/camel-example-olingo4-blueprint/src/main/resources/data/person2.json b/examples/camel-example-olingo4-blueprint/src/main/resources/data/person2.json
new file mode 100644
index 0000000..283f207
--- /dev/null
+++ b/examples/camel-example-olingo4-blueprint/src/main/resources/data/person2.json
@@ -0,0 +1,5 @@
+{
+"UserName": "jdoe",
+"FirstName": "John",
+"LastName": "Doe"
+}
\ No newline at end of file
diff --git a/examples/camel-example-openapi-osgi/README.adoc b/examples/camel-example-openapi-osgi/README.adoc
new file mode 100644
index 0000000..dfa7ff9
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/README.adoc
@@ -0,0 +1,67 @@
+== Camel OpenApi OSGi Example
+
+=== Introduction
+
+This is an example that uses the rest-dsl to define a rest services
+which provides three operations
+
+* GET user/{id} - Find user by id
+* PUT user - Updates or create a user
+* GET user/findAll - Find all users
+
+=== Build
+
+You will need to install this example first:
+
+....
+mvn install
+....
+
+=== Run
+
+This example needs to be deployed on Apache Karaf/SerivceMix first:
+
+feature:repo-add camel ${version} feature:install camel feature:install
+camel-jackson feature:install camel-jetty feature:install
+camel-openapi-java
+
+And then install the example
+
+install -s
+mvn:org.apache.camel.example/camel-example-openapi-osgi/${version}
+
+The rest service can be accessed from the following url
+
+....
+curl http://127.0.0.1:8080/camel-example-openapi-osgi/rest/user
+....
+
+http://127.0.0.1:8080/camel-example-openapi-osgi/rest/user
+
+For example to get a user with id 123
+
+....
+curl http://127.0.0.1:8080/camel-example-openapi-osgi/rest/user/123
+....
+
+http://127.0.0.1:8080/camel-example-openapi-osgi/rest/user/123
+
+The rest services provides OpenApi API in json or yaml format which can
+be accessed from the following url
+
+....
+curl http://127.0.0.1:8080/camel-example-openapi-osgi/rest/api-docs/myCamel/openapi.json
+curl http://127.0.0.1:8080/camel-example-openapi-osgi/rest/api-docs/myCamel/openapi.yaml
+....
+
+http://127.0.0.1:8080/camel-example-openapi-osgi/rest/api-docs/myCamel/openapi.json
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-openapi-osgi/pom.xml b/examples/camel-example-openapi-osgi/pom.xml
new file mode 100644
index 0000000..df437e2
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-openapi-osgi</artifactId>
+ <name>Camel :: Example :: OpenApi :: OSGi</name>
+ <description>An example using REST DSL in XML and OpenApi API</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>OSGi</category>
+ <title>OpenApi OSGi</title>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jetty</artifactId>
+ </dependency>
+
+ <!-- openapi api -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-openapi-java</artifactId>
+ </dependency>
+
+ <!-- use for json binding -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jackson</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>org.apache.camel.example.rest*</Export-Package>
+ <Import-Package>*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/User.java b/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/User.java
new file mode 100644
index 0000000..4fd237b
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/User.java
@@ -0,0 +1,47 @@
+/*
+ * 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.example.rest;
+
+public class User {
+
+ private int id;
+ private String name;
+
+ public User() {
+ }
+
+ public User(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/UserService.java b/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/UserService.java
new file mode 100644
index 0000000..83545ea
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/src/main/java/org/apache/camel/example/rest/UserService.java
@@ -0,0 +1,76 @@
+/*
+ * 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.example.rest;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Random;
+import java.util.TreeMap;
+
+/**
+ * A {@link org.apache.camel.example.rest.User} service which we rest enable the routes defined in the XML file.
+ */
+public class UserService {
+
+ // use a tree map so they become sorted
+ private final Map<String, User> users = new TreeMap<>();
+
+ private Random ran = new Random();
+
+ public UserService() {
+ users.put("123", new User(123, "John Doe"));
+ users.put("456", new User(456, "Donald Duck"));
+ users.put("789", new User(789, "Slow Turtle"));
+ }
+
+ /**
+ * Gets a user by the given id
+ *
+ * @param id the id of the user
+ * @return the user, or <tt>null</tt> if no user exists
+ */
+ public User getUser(String id) {
+ if ("789".equals(id)) {
+ // simulate some cpu processing time when returning the slow turtle
+ int delay = 500 + ran.nextInt(1500);
+ try {
+ Thread.sleep(delay);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ return users.get(id);
+ }
+
+ /**
+ * List all users
+ *
+ * @return the list of all users
+ */
+ public Collection<User> listUsers() {
+ return users.values();
+ }
+
+ /**
+ * Updates or creates the given user
+ *
+ * @param user the user
+ */
+ public void updateUser(User user) {
+ users.put("" + user.getId(), user);
+ }
+}
diff --git a/examples/camel-example-openapi-osgi/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-openapi-osgi/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-openapi-osgi/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-openapi-osgi/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-openapi-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml b/examples/camel-example-openapi-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml
new file mode 100644
index 0000000..e8f8895
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- a bean for user services -->
+ <bean id="userService" class="org.apache.camel.example.rest.UserService"/>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- configure rest to use the camel-servlet component, and use json binding mode -->
+ <!-- and tell to output json in pretty print mode -->
+ <!-- setup context path and port number that Apache Tomcat will deploy this application with,
+ as we use the servlet component, then we need to aid Camel to tell it these details so Camel
+ knows the url to the REST services.
+ Notice: This is optional, but needed if the RestRegistry should enlist accurate information.
+ You can access the RestRegistry from JMX at runtime -->
+ <!-- also enable openapi api, using the apiContextPath
+ and enable CORS so the swagger-ui web console can access the openapi api docs -->
+ <restConfiguration component="jetty" bindingMode="json"
+ contextPath="camel-example-openapi-osgi/rest" port="8080"
+ apiContextPath="api-docs" apiContextListing="true"
+ enableCORS="true">
+
+ <!-- we want json output in pretty mode -->
+ <dataFormatProperty key="prettyPrint" value="true"/>
+
+ <!-- setup openapi api descriptions -->
+ <apiProperty key="base.path" value="rest"/>
+ <apiProperty key="api.version" value="1.2.3"/>
+ <apiProperty key="api.title" value="User Services"/>
+ <apiProperty key="api.description" value="Camel Rest Example with OpenApi that provides an User REST service"/>
+ <apiProperty key="api.contact.name" value="The Apache Camel team"/>
+
+ </restConfiguration>
+
+ <!-- defines the rest services using the context-path /user -->
+ <rest path="/user" consumes="application/json" produces="application/json">
+ <description>User rest service</description>
+
+ <!-- this is a rest GET to view an user by the given id -->
+ <get uri="/{id}" outType="org.apache.camel.example.rest.User">
+ <description>Find user by id</description>
+ <param name="id" type="path" description="The id of the user to get" dataType="integer"/>
+ <responseMessage message="The user that was found"/>
+ <responseMessage code="404" message="User not found"/>
+ <route>
+ <to uri="bean:userService?method=getUser(${header.id})"/>
+ <filter>
+ <simple>${body} == null</simple>
+ <setHeader name="Exchange.HTTP_RESPONSE_CODE">
+ <constant>404</constant>
+ </setHeader>
+ </filter>
+ </route>
+ </get>
+
+ <!-- this is a rest PUT to create/update an user -->
+ <put type="org.apache.camel.example.rest.User">
+ <description>Updates or create a user</description>
+ <param name="body" type="body" description="The user to update or create"/>
+ <to uri="bean:userService?method=updateUser"/>
+ </put>
+
+ <!-- this is a rest GET to find all users -->
+ <get uri="/findAll" outType="org.apache.camel.example.rest.User[]">
+ <description>Find all users</description>
+ <responseMessage message="All the users"/>
+ <to uri="bean:userService?method=listUsers"/>
+ </get>
+ </rest>
+
+ <!-- defines the rest services using the context-path /echo -->
+ <rest path="/echo" consumes="application/text" produces="application/text">
+ <description>Echo rest service</description>
+
+ <get uri="/ping">
+ <description>A ping service</description>
+ <route>
+ <transform>
+ <constant>pong</constant>
+ </transform>
+ </route>
+ </get>
+
+ </rest>
+
+ </camelContext>
+
+</blueprint>
diff --git a/examples/camel-example-openapi-osgi/src/main/resources/log4j2.properties b/examples/camel-example-openapi-osgi/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..9deb51c
--- /dev/null
+++ b/examples/camel-example-openapi-osgi/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.console.ref = console
diff --git a/examples/camel-example-servlet-rest-blueprint/README.adoc b/examples/camel-example-servlet-rest-blueprint/README.adoc
new file mode 100644
index 0000000..b400350
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/README.adoc
@@ -0,0 +1,87 @@
+== Camel Servlet REST and OSGi Blueprint example
+
+=== Introduction
+
+This example shows how to use Servlet REST to define REST endpoints in
+Camel routes using the Rest DSL
+
+=== Build
+
+You will need to compile this example first:
+
+....
+mvn install
+....
+
+=== Run
+
+To install Apache Camel in Karaf you type in the shell (we use version
+$\{camel.version}):
+
+....
+feature:repo-add camel ${camel.version}
+feature:install camel
+....
+
+First you need to install the following features in Karaf/ServiceMix
+with:
+
+....
+feature:install camel-servlet
+feature:install camel-jackson
+feature:install war
+....
+
+Then you can install the Camel example:
+
+....
+install -s mvn:org.apache.camel.example/camel-example-servlet-rest-blueprint/${camel.version}
+....
+
+And you can see the application running by tailing the logs
+
+....
+log:tail
+....
+
+And you can use ctrl+c to stop tailing the log.
+
+There is a user REST service that supports the following operations
+
+* GET /user/\{id} - to view a user with the given id
+* GET /user/final - to view all users
+* PUT /user - to update/create an user
+
+The view operations are HTTP GET, and update is using HTTP PUT.
+
+From a web browser you can access the first two services using the
+following links
+
+....
+ http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/123 - to view the user with id 123
+ http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/findAll - to list all users
+....
+
+From the command shell you can use curl to access the service as shown
+below:
+
+....
+curl -X GET -H "Accept: application/json" http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/123
+curl -X GET -H "Accept: application/json" http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/findAll
+curl -X PUT -d "{ \"id\": 666, \"name\": \"The devil\"}" -H "Accept: application/json" http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user
+....
+
+=== Configuration
+
+This example is implemented in XML DSL in the
+`+src/main/resources/OSGI-INF/blueprint/camel.xml+` file.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-servlet-rest-blueprint/pom.xml b/examples/camel-example-servlet-rest-blueprint/pom.xml
new file mode 100644
index 0000000..6e81db0
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/pom.xml
@@ -0,0 +1,108 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-servlet-rest-blueprint</artifactId>
+ <name>Camel :: Example :: Servlet :: OSGi</name>
+ <description>An example using Servlet Rest with OSGi Blueprint</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>OSGi</category>
+ <title>Servlet REST Blueprint</title>
+
+ <camel.osgi.import.pkg>
+ *
+ </camel.osgi.import.pkg>
+ <camel.osgi.export.pkg>
+ *
+ </camel.osgi.export.pkg>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ <version>${camel.karaf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-servlet</artifactId>
+ </dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.camel</groupId>-->
+ <!--<artifactId>camel-swagger</artifactId>-->
+ <!--</dependency>-->
+
+ <!-- use for json binding -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jackson</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/User.java b/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/User.java
new file mode 100644
index 0000000..4fd237b
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/User.java
@@ -0,0 +1,47 @@
+/*
+ * 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.example.rest;
+
+public class User {
+
+ private int id;
+ private String name;
+
+ public User() {
+ }
+
+ public User(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/UserService.java b/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/UserService.java
new file mode 100644
index 0000000..1ad0b50
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/src/main/java/org/apache/camel/example/rest/UserService.java
@@ -0,0 +1,63 @@
+/*
+ * 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.example.rest;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * A {@link org.apache.camel.example.rest.User} service which we rest enable from the {@link org.apache.camel.example.rest.UserRouteBuilder}.
+ */
+public class UserService {
+
+ // use a tree map so they become sorted
+ private final Map<String, User> users = new TreeMap<>();
+
+ public UserService() {
+ users.put("123", new User(123, "John Doe"));
+ users.put("456", new User(456, "Donald Duck"));
+ }
+
+ /**
+ * Gets a user by the given id
+ *
+ * @param id the id of the user
+ * @return the user, or <tt>null</tt> if no user exists
+ */
+ public User getUser(String id) {
+ return users.get(id);
+ }
+
+ /**
+ * List all users
+ *
+ * @return the list of all users
+ */
+ public Collection<User> listUsers() {
+ return users.values();
+ }
+
+ /**
+ * Updates or creates the given user
+ *
+ * @param user the user
+ */
+ public void updateUser(User user) {
+ users.put("" + user.getId(), user);
+ }
+}
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-servlet-rest-blueprint/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-servlet-rest-blueprint/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/resources/OSGI-INF/blueprint/camel.xml b/examples/camel-example-servlet-rest-blueprint/src/main/resources/OSGI-INF/blueprint/camel.xml
new file mode 100644
index 0000000..e630bca
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/src/main/resources/OSGI-INF/blueprint/camel.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- to setup camel servlet with OSGi HttpService -->
+ <reference id="httpService" interface="org.osgi.service.http.HttpService"/>
+
+ <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
+ init-method="register"
+ destroy-method="unregister">
+ <property name="alias" value="/camel-example-servlet-rest-blueprint/rest"/>
+ <property name="httpService" ref="httpService"/>
+ <property name="servlet" ref="camelServlet"/>
+ </bean>
+
+ <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
+
+ <!-- a bean for user services -->
+ <bean id="userService" class="org.apache.camel.example.rest.UserService"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- configure rest to use the camel-servlet component, and use json binding mode -->
+ <!-- and tell to output json in pretty print mode -->
+ <!-- setup context path and port number that Apache Tomcat will deploy this application with,
+ as we use the servlet component, then we need to aid Camel to tell it these details so Camel
+ knows the url to the REST services.
+ Notice: This is optional, but needed if the RestRegistry should enlist accurate information.
+ You can access the RestRegistry from JMX at runtime -->
+ <restConfiguration component="servlet" bindingMode="json" contextPath="/camel-example-servlet-rest-blueprint/rest"
+ port="8181">
+ <dataFormatProperty key="prettyPrint" value="true"/>
+ </restConfiguration>
+
+ <!-- defines the rest services using the context-path /user -->
+ <rest path="/user" consumes="application/json" produces="application/json">
+ <description>User rest service</description>
+
+ <!-- this is a rest GET to view an user by the given id -->
+ <get uri="/{id}" outType="org.apache.camel.example.rest.User">
+ <description>Find user by id</description>
+ <to uri="bean:userService?method=getUser(${header.id})"/>
+ </get>
+
+ <!-- this is a rest PUT to create/update an user -->
+ <put type="org.apache.camel.example.rest.User">
+ <description>Updates or create a user</description>
+ <to uri="bean:userService?method=updateUser"/>
+ </put>
+
+ <!-- this is a rest GET to find all users -->
+ <get uri="/findAll" outType="org.apache.camel.example.rest.User[]">
+ <description>Find all users</description>
+ <to uri="bean:userService?method=listUsers"/>
+ </get>
+
+ </rest>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/examples/camel-example-servlet-rest-blueprint/src/main/resources/log4j2.properties b/examples/camel-example-servlet-rest-blueprint/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..9deb51c
--- /dev/null
+++ b/examples/camel-example-servlet-rest-blueprint/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.console.ref = console
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/README.adoc b/examples/camel-example-servlet-rest-karaf-jaas/README.adoc
new file mode 100644
index 0000000..d4e7e67
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/README.adoc
@@ -0,0 +1,90 @@
+== Camel Servlet REST and Karaf Jaas example
+
+=== Introduction
+
+This example shows how to use Servlet REST to define REST endpoints in Camel routes using the Rest DSL. REST endpoint protected by Basic Auth, delegate user/password authentication to Karaf Jaas Service
+
+=== Build
+
+You will need to compile this example first:
+
+....
+mvn install
+....
+
+=== Copy security configuration file
+ copy src/main/resources/org.ops4j.pax.web.context-camelrestdsl.cfg
+ to $KARAF_HOME/etc folder
+
+=== Run
+
+To install Apache Camel in Karaf you type in the shell (we use version
+$\{camel.version}):
+
+....
+feature:repo-add camel ${camel.version}
+feature:install camel
+....
+
+First you need to install the following features in Karaf/ServiceMix
+with:
+
+....
+feature:install camel-servlet
+feature:install camel-jackson
+feature:install war
+....
+
+Then you can install the Camel example:
+
+....
+install -s mvn:org.apache.camel.example/camel-example-servlet-rest-karaf-jaas/${camel.version}
+....
+
+And you can see the application running by tailing the logs
+
+....
+log:tail
+....
+
+And you can use ctrl+c to stop tailing the log.
+
+There is a user REST service that supports the following operations
+
+* GET /user/\{id} - to view a user with the given id
+* GET /user/final - to view all users
+* PUT /user - to update/create an user
+
+The view operations are HTTP GET, and update is using HTTP PUT.
+
+From a web browser you can access the first two services using the
+following links(need to input karaf/karaf as user/password in the pop up dialog)
+
+....
+ http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/123 - to view the user with id 123
+ http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/findAll - to list all users
+....
+
+From the command shell you can use curl to access the service as shown
+below:
+
+....
+curl -X GET -H "Accept: application/json" --basic -u karaf:karaf http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/123
+curl -X GET -H "Accept: application/json" --basic -u karaf:karaf http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user/findAll
+curl -X PUT -d "{ \"id\": 666, \"name\": \"The devil\"}" -H "Accept: application/json" --basic -u karaf:karaf http://localhost:8181/camel-example-servlet-rest-blueprint/rest/user
+....
+
+=== Configuration
+
+This example is implemented in XML DSL in the
+`+src/main/resources/OSGI-INF/blueprint/camel.xml+` file.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/pom.xml b/examples/camel-example-servlet-rest-karaf-jaas/pom.xml
new file mode 100644
index 0000000..2a63f14
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/pom.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-servlet-rest-karaf-jaas</artifactId>
+ <name>Camel :: Example :: Servlet REST :: Karaf Jaas</name>
+ <description>An example using Servlet REST with OSGi Blueprint, and REST endpoint protected by Basic Auth, delegate user/password authentication to Karaf Jaas Service</description>
+ <packaging>jar</packaging>
+
+
+ <properties>
+ <category>OSGi</category>
+ <title>Servlet REST Blueprint</title>
+
+ <camel.osgi.import.pkg>
+ *
+ </camel.osgi.import.pkg>
+ <camel.osgi.export.pkg>
+ *
+ </camel.osgi.export.pkg>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ <version>${camel.karaf.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-servlet</artifactId>
+ </dependency>
+ <!--<dependency>-->
+ <!--<groupId>org.apache.camel</groupId>-->
+ <!--<artifactId>camel-swagger</artifactId>-->
+ <!--</dependency>-->
+
+ <!-- use for json binding -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jackson</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/User.java b/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/User.java
new file mode 100644
index 0000000..4fd237b
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/User.java
@@ -0,0 +1,47 @@
+/*
+ * 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.example.rest;
+
+public class User {
+
+ private int id;
+ private String name;
+
+ public User() {
+ }
+
+ public User(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/UserService.java b/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/UserService.java
new file mode 100644
index 0000000..1ad0b50
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/java/org/apache/camel/example/rest/UserService.java
@@ -0,0 +1,63 @@
+/*
+ * 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.example.rest;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.TreeMap;
+
+/**
+ * A {@link org.apache.camel.example.rest.User} service which we rest enable from the {@link org.apache.camel.example.rest.UserRouteBuilder}.
+ */
+public class UserService {
+
+ // use a tree map so they become sorted
+ private final Map<String, User> users = new TreeMap<>();
+
+ public UserService() {
+ users.put("123", new User(123, "John Doe"));
+ users.put("456", new User(456, "Donald Duck"));
+ }
+
+ /**
+ * Gets a user by the given id
+ *
+ * @param id the id of the user
+ * @return the user, or <tt>null</tt> if no user exists
+ */
+ public User getUser(String id) {
+ return users.get(id);
+ }
+
+ /**
+ * List all users
+ *
+ * @return the list of all users
+ */
+ public Collection<User> listUsers() {
+ return users.values();
+ }
+
+ /**
+ * Updates or creates the given user
+ *
+ * @param user the user
+ */
+ public void updateUser(User user) {
+ users.put("" + user.getId(), user);
+ }
+}
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/OSGI-INF/blueprint/camel.xml b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/OSGI-INF/blueprint/camel.xml
new file mode 100644
index 0000000..e630bca
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/OSGI-INF/blueprint/camel.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- to setup camel servlet with OSGi HttpService -->
+ <reference id="httpService" interface="org.osgi.service.http.HttpService"/>
+
+ <bean class="org.apache.camel.component.servlet.osgi.OsgiServletRegisterer"
+ init-method="register"
+ destroy-method="unregister">
+ <property name="alias" value="/camel-example-servlet-rest-blueprint/rest"/>
+ <property name="httpService" ref="httpService"/>
+ <property name="servlet" ref="camelServlet"/>
+ </bean>
+
+ <bean id="camelServlet" class="org.apache.camel.component.servlet.CamelHttpTransportServlet"/>
+
+ <!-- a bean for user services -->
+ <bean id="userService" class="org.apache.camel.example.rest.UserService"/>
+
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- configure rest to use the camel-servlet component, and use json binding mode -->
+ <!-- and tell to output json in pretty print mode -->
+ <!-- setup context path and port number that Apache Tomcat will deploy this application with,
+ as we use the servlet component, then we need to aid Camel to tell it these details so Camel
+ knows the url to the REST services.
+ Notice: This is optional, but needed if the RestRegistry should enlist accurate information.
+ You can access the RestRegistry from JMX at runtime -->
+ <restConfiguration component="servlet" bindingMode="json" contextPath="/camel-example-servlet-rest-blueprint/rest"
+ port="8181">
+ <dataFormatProperty key="prettyPrint" value="true"/>
+ </restConfiguration>
+
+ <!-- defines the rest services using the context-path /user -->
+ <rest path="/user" consumes="application/json" produces="application/json">
+ <description>User rest service</description>
+
+ <!-- this is a rest GET to view an user by the given id -->
+ <get uri="/{id}" outType="org.apache.camel.example.rest.User">
+ <description>Find user by id</description>
+ <to uri="bean:userService?method=getUser(${header.id})"/>
+ </get>
+
+ <!-- this is a rest PUT to create/update an user -->
+ <put type="org.apache.camel.example.rest.User">
+ <description>Updates or create a user</description>
+ <to uri="bean:userService?method=updateUser"/>
+ </put>
+
+ <!-- this is a rest GET to find all users -->
+ <get uri="/findAll" outType="org.apache.camel.example.rest.User[]">
+ <description>Find all users</description>
+ <to uri="bean:userService?method=listUsers"/>
+ </get>
+
+ </rest>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/log4j2.properties b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..9deb51c
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.console.ref = console
diff --git a/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/org.ops4j.pax.web.context-camelrestdsl.cfg b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/org.ops4j.pax.web.context-camelrestdsl.cfg
new file mode 100644
index 0000000..5dd68fe
--- /dev/null
+++ b/examples/camel-example-servlet-rest-karaf-jaas/src/main/resources/org.ops4j.pax.web.context-camelrestdsl.cfg
@@ -0,0 +1,7 @@
+bundle.symbolicName=camel-example-servlet-rest-blueprint
+login.config.authMethod=BASIC
+login.config.realmName=karaf
+context.id=default
+
+security.constraint.1.url = /camel-example-servlet-rest-blueprint/*
+security.constraint.1.roles = admin
diff --git a/examples/camel-example-sql-blueprint/README.adoc b/examples/camel-example-sql-blueprint/README.adoc
new file mode 100644
index 0000000..2c40663
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/README.adoc
@@ -0,0 +1,65 @@
+== Camel SQL Blueprint Example
+
+=== Introduction
+
+This example shows how to exchange data using a shared database table.
+
+The example has two Camel routes. The first route insert new data into
+the table, triggered by a timer to run every 5th second.
+
+The second route pickup the newly inserted rows from the table, process
+the row(s), and mark the row(s) as processed when done; to avoid picking
+up the same rows again.
+
+=== Build
+
+You will need to compile this example first: mvn install
+
+=== Run with maven
+
+To run the example type
+
+....
+mvn camel:run
+....
+
+To stop the example hit ctrl+c
+
+This example uses Blueprint to setup and configure the database, as well
+the CamelContext. You can see this in the following file: In the
+src/main/resources/OSGI-INF/blueprint/camel-context.xml
+
+=== Run with Karaf
+
+You will need to install this example first to your local maven
+repository with:
+
+....
+mvn install
+....
+
+Then you can install this example from the shell using this example’s
+`+features.xml+` for easy provisioning:
+
+....
+feature:repo-add mvn:org.apache.camel.example/camel-example-sql-blueprint/${version}/xml/features
+feature:install camel-example-sql-blueprint
+....
+
+And you can see the application running by tailing the logs:
+
+....
+log:tail
+....
+
+And you can use ctrl+c to stop tailing the log.
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-sql-blueprint/pom.xml b/examples/camel-example-sql-blueprint/pom.xml
new file mode 100644
index 0000000..4415523
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/pom.xml
@@ -0,0 +1,145 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-sql-blueprint</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: SQL :: OSGi</name>
+ <description>An example for showing Camel using SQL component with OSGi Blueprint</description>
+
+ <properties>
+ <category>OSGi</category>
+ <title>SQL Blueprint</title>
+
+ <camel.osgi.export.pkg>org.apache.camel.example.sql.*</camel.osgi.export.pkg>
+ <!-- dynamic import for the Derby JDBC driver -->
+ <camel.osgi.dynamic>*</camel.osgi.dynamic>
+ <camel.osgi.import>org.apache.derby.jdbc,*</camel.osgi.import>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <!-- Add Camel Karaf BOM -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-bom</artifactId>
+ <version>${camel.karaf.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- Camel -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-sql</artifactId>
+ </dependency>
+
+ <!-- jdbc -->
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>${derby-version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.commons</groupId>
+ <artifactId>commons-dbcp2</artifactId>
+ <version>${commons-dbcp2-version}</version>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Allows the routes to be run via 'mvn camel:run' -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/classes/features.xml</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/DatabaseBean.java b/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/DatabaseBean.java
new file mode 100644
index 0000000..1eeac17
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/DatabaseBean.java
@@ -0,0 +1,74 @@
+/*
+ * 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.example.sql;
+
+import javax.sql.DataSource;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.jdbc.core.JdbcTemplate;
+
+/**
+ * Bean that creates the database table
+ */
+public class DatabaseBean {
+
+ private static final Logger LOG = LoggerFactory.getLogger(DatabaseBean.class);
+ private DataSource dataSource;
+
+ public DataSource getDataSource() {
+ return dataSource;
+ }
+
+ public void setDataSource(DataSource dataSource) {
+ this.dataSource = dataSource;
+ }
+
+ public void create() throws Exception {
+ JdbcTemplate jdbc = new JdbcTemplate(dataSource);
+
+ String sql = "create table orders (\n"
+ + " id integer primary key,\n"
+ + " item varchar(10),\n"
+ + " amount varchar(5),\n"
+ + " description varchar(30),\n"
+ + " processed boolean\n"
+ + ")";
+
+ LOG.info("Creating table orders ...");
+
+ try {
+ jdbc.execute("drop table orders");
+ } catch (Throwable e) {
+ // ignore
+ }
+
+ jdbc.execute(sql);
+
+ LOG.info("... created table orders");
+ }
+
+ public void destroy() throws Exception {
+ JdbcTemplate jdbc = new JdbcTemplate(dataSource);
+
+ try {
+ jdbc.execute("drop table orders");
+ } catch (Throwable e) {
+ // ignore
+ }
+ }
+}
diff --git a/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/OrderBean.java b/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/OrderBean.java
new file mode 100644
index 0000000..feb0cba
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/java/org/apache/camel/example/sql/OrderBean.java
@@ -0,0 +1,52 @@
+/*
+ * 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.example.sql;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+/**
+ * Bean that generates and process orders.
+ */
+public class OrderBean {
+
+ private int counter;
+ private Random ran = new Random();
+
+ /**
+ * Generates a new order structured as a {@link Map}
+ */
+ public Map<String, Object> generateOrder() {
+ Map<String, Object> answer = new HashMap<>();
+ answer.put("id", counter++);
+ answer.put("item", counter % 2 == 0 ? 111 : 222);
+ answer.put("amount", ran.nextInt(10) + 1);
+ answer.put("description", counter % 2 == 0 ? "Camel in Action" : "ActiveMQ in Action");
+ return answer;
+ }
+
+ /**
+ * Processes the order
+ *
+ * @param data the order as a {@link Map}
+ * @return the transformed order
+ */
+ public String processOrder(Map<String, Object> data) {
+ return "Processed order id " + data.get("id") + " item " + data.get("item") + " of " + data.get("amount") + " copies of " + data.get("description");
+ }
+}
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-sql-blueprint/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-sql-blueprint/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml b/examples/camel-example-sql-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
new file mode 100644
index 0000000..04b6577
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+ xmlns:camel="http://camel.apache.org/schema/blueprint"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+ ">
+
+ <!-- START SNIPPET: e1 -->
+ <!-- this is the JDBC data source which uses an in-memory only Apache Derby database -->
+ <bean id="dataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
+ <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver"/>
+ <property name="url" value="jdbc:derby:memory:orders;create=true"/>
+ <property name="username" value=""/>
+ <property name="password" value=""/>
+ </bean>
+
+ <!-- bean which creates/destroys the database table for this example -->
+ <bean id="initDatabase" class="org.apache.camel.example.sql.DatabaseBean"
+ init-method="create" destroy-method="destroy">
+ <property name="dataSource" ref="dataSource"/>
+ </bean>
+
+ <!-- configure the Camel SQL component to use the JDBC data source -->
+ <bean id="sql" class="org.apache.camel.component.sql.SqlComponent">
+ <property name="dataSource" ref="dataSource"/>
+ </bean>
+ <!-- END SNIPPET: e1 -->
+
+ <!-- START SNIPPET: e2 -->
+ <!-- order bean is our business logic bean that creates new orders -->
+ <bean id="orderBean" class="org.apache.camel.example.sql.OrderBean"/>
+
+ <!-- here is Camel configured with a number of routes -->
+ <camelContext xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- use Camel property placeholder loaded from the given file -->
+ <propertyPlaceholder id="placeholder" location="classpath:sql.properties"/>
+
+ <!-- route that generate new orders and insert them in the database -->
+ <route id="generateOrder-route">
+ <from uri="timer:foo?period=5000"/>
+ <transform>
+ <method ref="orderBean" method="generateOrder"/>
+ </transform>
+ <to uri="sql:{{sql.insertOrder}}"/>
+ <log message="Inserted new order ${body[id]}"/>
+ </route>
+
+ <!-- route that process the orders by picking up new rows from the database
+ and when done processing then update the row to mark it as processed -->
+ <route id="processOrder-route">
+ <from uri="sql:{{sql.selectOrder}}?onConsume={{sql.markOrder}}"/>
+ <to uri="bean:orderBean?method=processOrder"/>
+ <log message="${body}"/>
+ </route>
+
+ </camelContext>
+</blueprint>
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/features.xml b/examples/camel-example-sql-blueprint/src/main/resources/features.xml
new file mode 100644
index 0000000..8ef41c1
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/resources/features.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<features>
+ <repository>mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features</repository>
+
+ <feature name="camel-example-sql-blueprint" version="${camel.version}">
+ <feature version="${camel.version}">camel</feature>
+ <feature version="${camel.version}">camel-blueprint</feature>
+ <feature version="${camel.version}">camel-sql</feature>
+ <bundle>mvn:org.apache.derby/derby/${derby-version}</bundle>
+ <bundle>mvn:org.apache.commons/commons-pool2/${commons-pool2-version}</bundle>
+ <bundle>wrap:mvn:org.apache.commons/commons-dbcp2/${commons-dbcp2-version}$overwrite=merge&DynamicImport-Package=*</bundle>
+ <bundle>mvn:org.apache.camel.example/camel-example-sql-blueprint/${camel.version}</bundle>
+ </feature>
+
+</features>
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/log4j2.properties b/examples/camel-example-sql-blueprint/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..d9f0508
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.out.type = Console
+appender.out.name = out
+appender.out.layout.type = PatternLayout
+appender.out.layout.pattern = [%30.30t] %-30.30c{1} %-5p %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.out.ref = out
diff --git a/examples/camel-example-sql-blueprint/src/main/resources/sql.properties b/examples/camel-example-sql-blueprint/src/main/resources/sql.properties
new file mode 100644
index 0000000..2390260
--- /dev/null
+++ b/examples/camel-example-sql-blueprint/src/main/resources/sql.properties
@@ -0,0 +1,29 @@
+## ---------------------------------------------------------------------------
+## Licensed to the Apache Software Foundation (ASF) under one or more
+## contributor license agreements. See the NOTICE file distributed with
+## this work for additional information regarding copyright ownership.
+## The ASF licenses this file to You under the Apache License, Version 2.0
+## (the "License"); you may not use this file except in compliance with
+## the License. You may obtain a copy of the License at
+##
+## http://www.apache.org/licenses/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.
+## ---------------------------------------------------------------------------
+
+## START SNIPPET: e1
+## notice we use named parameters in the queries, eg :#name. A named query parameter must start with :#
+## sql that insert new orders
+sql.insertOrder=insert into orders (id, item, amount, description, processed) values (:#id, :#item, :#amount, :#description, false)
+
+## sql that select all unprocessed orders
+sql.selectOrder=select * from orders where processed = false
+
+## sql that update the order as being processed
+sql.markOrder=update orders set processed = true where id = :#id
+
+## END SNIPPET: e1
diff --git a/examples/camel-example-swagger-osgi/README.adoc b/examples/camel-example-swagger-osgi/README.adoc
new file mode 100644
index 0000000..2049d09
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/README.adoc
@@ -0,0 +1,67 @@
+== Camel Swagger OSGi Example
+
+=== Introduction
+
+This is an example that uses the rest-dsl to define a rest services
+which provides three operations
+
+* GET user/{id} - Find user by id
+* PUT user - Updates or create a user
+* GET user/findAll - Find all users
+
+=== Build
+
+You will need to install this example first:
+
+....
+mvn install
+....
+
+=== Run
+
+This example needs to be deployed on Apache Karaf/SerivceMix first:
+
+feature:repo-add camel ${version} feature:install camel feature:install
+camel-jackson feature:install camel-jetty feature:install
+camel-swagger-java
+
+And then install the example
+
+install -s
+mvn:org.apache.camel.example/camel-example-swagger-osgi/${version}
+
+The rest service can be accessed from the following url
+
+....
+curl http://127.0.0.1:8080/camel-example-swagger-osgi/rest/user
+....
+
+http://127.0.0.1:8080/camel-example-swagger-osgi/rest/user
+
+For example to get a user with id 123
+
+....
+curl http://127.0.0.1:8080/camel-example-swagger-osgi/rest/user/123
+....
+
+http://127.0.0.1:8080/camel-example-swagger-osgi/rest/user/123
+
+The rest services provides Swagger API in json or yaml format which can
+be accessed from the following url
+
+....
+curl http://127.0.0.1:8080/camel-example-swagger-osgi/rest/api-docs/myCamel/swagger.json
+curl http://127.0.0.1:8080/camel-example-swagger-osgi/rest/api-docs/myCamel/swagger.yaml
+....
+
+http://127.0.0.1:8080/camel-example-swagger-osgi/rest/api-docs/myCamel/swagger.json
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-swagger-osgi/pom.xml b/examples/camel-example-swagger-osgi/pom.xml
new file mode 100644
index 0000000..8318ff6
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/pom.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-swagger-osgi</artifactId>
+ <name>Camel :: Example :: Swagger :: OSGi</name>
+ <description>An example using REST DSL in XML and Swagger API</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>OSGi</category>
+ <title>Swagger OSGi</title>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+
+ <!-- camel -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jetty</artifactId>
+ </dependency>
+
+ <!-- swagger api -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-swagger-java</artifactId>
+ </dependency>
+
+ <!-- use for json binding -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-jackson</artifactId>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>org.apache.camel.example.rest*</Export-Package>
+ <Import-Package>*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/User.java b/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/User.java
new file mode 100644
index 0000000..d281165
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/User.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.example.rest;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+@ApiModel(description = "Represents an user of the system")
+public class User {
+
+ private int id;
+ private String name;
+
+ public User() {
+ }
+
+ public User(int id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ @ApiModelProperty(value = "The id of the user", required = true)
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ @ApiModelProperty(value = "The name of the user", required = true)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/UserService.java b/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/UserService.java
new file mode 100644
index 0000000..83545ea
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/src/main/java/org/apache/camel/example/rest/UserService.java
@@ -0,0 +1,76 @@
+/*
+ * 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.example.rest;
+
+import java.util.Collection;
+import java.util.Map;
+import java.util.Random;
+import java.util.TreeMap;
+
+/**
+ * A {@link org.apache.camel.example.rest.User} service which we rest enable the routes defined in the XML file.
+ */
+public class UserService {
+
+ // use a tree map so they become sorted
+ private final Map<String, User> users = new TreeMap<>();
+
+ private Random ran = new Random();
+
+ public UserService() {
+ users.put("123", new User(123, "John Doe"));
+ users.put("456", new User(456, "Donald Duck"));
+ users.put("789", new User(789, "Slow Turtle"));
+ }
+
+ /**
+ * Gets a user by the given id
+ *
+ * @param id the id of the user
+ * @return the user, or <tt>null</tt> if no user exists
+ */
+ public User getUser(String id) {
+ if ("789".equals(id)) {
+ // simulate some cpu processing time when returning the slow turtle
+ int delay = 500 + ran.nextInt(1500);
+ try {
+ Thread.sleep(delay);
+ } catch (Exception e) {
+ // ignore
+ }
+ }
+ return users.get(id);
+ }
+
+ /**
+ * List all users
+ *
+ * @return the list of all users
+ */
+ public Collection<User> listUsers() {
+ return users.values();
+ }
+
+ /**
+ * Updates or creates the given user
+ *
+ * @param user the user
+ */
+ public void updateUser(User user) {
+ users.put("" + user.getId(), user);
+ }
+}
diff --git a/examples/camel-example-swagger-osgi/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-swagger-osgi/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-swagger-osgi/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-swagger-osgi/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-swagger-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml b/examples/camel-example-swagger-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml
new file mode 100644
index 0000000..b3b045a
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/src/main/resources/OSGI-INF/blueprint/camel.xml
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- a bean for user services -->
+ <bean id="userService" class="org.apache.camel.example.rest.UserService"/>
+
+ <camelContext id="myCamel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- configure rest to use the camel-servlet component, and use json binding mode -->
+ <!-- and tell to output json in pretty print mode -->
+ <!-- setup context path and port number that Apache Tomcat will deploy this application with,
+ as we use the servlet component, then we need to aid Camel to tell it these details so Camel
+ knows the url to the REST services.
+ Notice: This is optional, but needed if the RestRegistry should enlist accurate information.
+ You can access the RestRegistry from JMX at runtime -->
+ <!-- also enable swagger api, using the apiContextPath
+ and enable CORS so the swagger-ui web console can access the swagger api docs -->
+ <restConfiguration component="jetty" bindingMode="json"
+ contextPath="camel-example-swagger-osgi/rest" port="8080"
+ apiContextPath="api-docs" apiContextListing="true"
+ enableCORS="true">
+
+ <!-- we want json output in pretty mode -->
+ <dataFormatProperty key="prettyPrint" value="true"/>
+
+ <!-- setup swagger api descriptions -->
+ <apiProperty key="base.path" value="rest"/>
+ <apiProperty key="api.version" value="1.2.3"/>
+ <apiProperty key="api.title" value="User Services"/>
+ <apiProperty key="api.description" value="Camel Rest Example with Swagger that provides an User REST service"/>
+ <apiProperty key="api.contact.name" value="The Apache Camel team"/>
+
+ </restConfiguration>
+
+ <!-- defines the rest services using the context-path /user -->
+ <rest path="/user" consumes="application/json" produces="application/json">
+ <description>User rest service</description>
+
+ <!-- this is a rest GET to view an user by the given id -->
+ <get uri="/{id}" outType="org.apache.camel.example.rest.User">
+ <description>Find user by id</description>
+ <param name="id" type="path" description="The id of the user to get" dataType="integer"/>
+ <responseMessage message="The user that was found"/>
+ <responseMessage code="404" message="User not found"/>
+ <route>
+ <to uri="bean:userService?method=getUser(${header.id})"/>
+ <filter>
+ <simple>${body} == null</simple>
+ <setHeader name="Exchange.HTTP_RESPONSE_CODE">
+ <constant>404</constant>
+ </setHeader>
+ </filter>
+ </route>
+ </get>
+
+ <!-- this is a rest PUT to create/update an user -->
+ <put type="org.apache.camel.example.rest.User">
+ <description>Updates or create a user</description>
+ <param name="body" type="body" description="The user to update or create"/>
+ <to uri="bean:userService?method=updateUser"/>
+ </put>
+
+ <!-- this is a rest GET to find all users -->
+ <get uri="/findAll" outType="org.apache.camel.example.rest.User[]">
+ <description>Find all users</description>
+ <responseMessage message="All the users"/>
+ <to uri="bean:userService?method=listUsers"/>
+ </get>
+ </rest>
+
+ <!-- defines the rest services using the context-path /echo -->
+ <rest path="/echo" consumes="application/text" produces="application/text">
+ <description>Echo rest service</description>
+
+ <get uri="/ping">
+ <description>A ping service</description>
+ <route>
+ <transform>
+ <constant>pong</constant>
+ </transform>
+ </route>
+ </get>
+
+ </rest>
+
+ </camelContext>
+
+</blueprint>
\ No newline at end of file
diff --git a/examples/camel-example-swagger-osgi/src/main/resources/log4j2.properties b/examples/camel-example-swagger-osgi/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..9deb51c
--- /dev/null
+++ b/examples/camel-example-swagger-osgi/src/main/resources/log4j2.properties
@@ -0,0 +1,23 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.console.type = Console
+appender.console.name = console
+appender.console.layout.type = PatternLayout
+appender.console.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.console.ref = console
diff --git a/examples/camel-example-transformer-blueprint/README.adoc b/examples/camel-example-transformer-blueprint/README.adoc
new file mode 100644
index 0000000..a33ab58
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/README.adoc
@@ -0,0 +1,58 @@
+== Declarative Transformer example using Blueprint XML
+
+=== Introduction
+
+This example shows how to work with declarative transformation by
+declaring data types.
+
+=== Build
+
+You will need to compile this example first:
+
+....
+mvn compile
+....
+
+=== Run without container
+
+To run the example, type
+
+....
+mvn camel:run
+....
+
+To stop the example hit ctrl+c.
+
+=== Run on karaf container
+
+To run the example on the karaf container
+
+==== Step 1: Start karaf container
+
+....
+karaf / karaf.bat
+....
+
+==== Step 2: Deploy
+
+....
+feature:repo-add mvn:org.apache.camel.example/camel-example-transformer-blueprint/${version}/xml/features
+feature:install camel-example-transformer-blueprint
+....
+
+==== Step 3: Check the output
+
+You will see the output by log:tail or in ${karaf}/data/karaf.log
+
+You can see the routing rules by looking at the Blueprint XML
+configuration lives in `+src/main/resources/OSGI-INF/blueprint+`
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-transformer-blueprint/pom.xml b/examples/camel-example-transformer-blueprint/pom.xml
new file mode 100644
index 0000000..e1f1261
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/pom.xml
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-transformer-blueprint</artifactId>
+ <packaging>jar</packaging>
+ <name>Camel :: Example :: Transformer :: OSGi</name>
+ <description>An example demonstrating declarative transformation along data type declaration using OSGi Blueprint
+ </description>
+
+ <properties>
+ <category>Input/Output Type Contract</category>
+ <title>Transformer OSGi Blueprint</title>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ <!-- Add Camel Karaf BOM -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-karaf-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <dependencies>
+ <!-- START SNIPPET: e1 -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-blueprint-main</artifactId>
+ </dependency>
+
+ <!-- logging -->
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-api</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-core</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.logging.log4j</groupId>
+ <artifactId>log4j-slf4j-impl</artifactId>
+ <version>${log4j2-version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- for testing -->
+ <dependency>
+ <groupId>org.apache.camel.karaf</groupId>
+ <artifactId>camel-test-blueprint</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>xmlunit</groupId>
+ <artifactId>xmlunit</artifactId>
+ <scope>test</scope>
+ <version>${xmlunit-version}</version>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-artifacts</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>target/classes/features.xml</file>
+ <type>xml</type>
+ <classifier>features</classifier>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
+ <Export-Package>${camel.osgi.export.pkg}</Export-Package>
+ <Import-Package>*</Import-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+
+ <!-- Allows the routes to be run via 'mvn camel:run' -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/examples/camel-example-transformer-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml b/examples/camel-example-transformer-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
new file mode 100644
index 0000000..47dbe92
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/src/main/resources/OSGI-INF/blueprint/camel-context.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <camelContext id="TransformerBlueprint" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- START SNIPPET: e1 -->
+ <transformers>
+ <endpointTransformer uri="xslt:transform.xsl" fromType="xml:MyRequest" toType="xml:MyResponse"/>
+ </transformers>
+ <!-- END SNIPPET: e1 -->
+
+ <!-- START SNIPPET: e2 -->
+ <route id="timer-route">
+ <from uri="timer:foo?period=5000"/>
+ <log message="start -->"/>
+ <setBody><constant><MyRequest>foobar</MyRequest></constant></setBody>
+ <log message="--> Sending:[${body}]"/>
+ <to uri="direct:a"/>
+ <log message="--> Received:[${body}]"/>
+ <log message="<-- end"/>
+ </route>
+ <!-- END SNIPPET: e2 -->
+
+ <!-- START SNIPPET: e3 -->
+ <route id="xslt-route">
+ <from uri="direct:a"/>
+ <inputType urn="xml:MyRequest"/>
+ <outputType urn="xml:MyResponse"/>
+ <log message="----> Received:[${body}]"/>
+ </route>
+ <!-- END SNIPPET: e3 -->
+
+ </camelContext>
+
+</blueprint>
diff --git a/examples/camel-example-transformer-blueprint/src/main/resources/features.xml b/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
new file mode 100644
index 0000000..47890d3
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/src/main/resources/features.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<features xmlns="http://karaf.apache.org/xmlns/features/v1.0.0" name="camel-example-transformer-blueprint">
+ <repository>mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features</repository>
+
+ <feature name='camel-example-transformer-blueprint' version='${camel.version}'>
+ <feature version="${camel.version}">camel</feature>
+ <bundle>mvn:org.apache.camel.example/camel-example-transformer-blueprint/${camel.version}</bundle>
+ </feature>
+
+</features>
diff --git a/examples/camel-example-transformer-blueprint/src/main/resources/log4j2.properties b/examples/camel-example-transformer-blueprint/src/main/resources/log4j2.properties
new file mode 100644
index 0000000..5d554da
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/src/main/resources/log4j2.properties
@@ -0,0 +1,28 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+appender.stdout.type = Console
+appender.stdout.name = stdout
+appender.stdout.layout.type = PatternLayout
+appender.stdout.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n
+rootLogger.level = INFO
+rootLogger.appenderRef.stdout.ref = stdout
+
+#logger.transformer.name = org.apache.camel.impl.transformer
+#logger.transformer.level = DEBUG
+#logger.processor.name = org.apache.camel.processor
+#logger.processor.level = DEBUG
diff --git a/examples/camel-example-transformer-blueprint/src/main/resources/transform.xsl b/examples/camel-example-transformer-blueprint/src/main/resources/transform.xsl
new file mode 100644
index 0000000..1612d1d
--- /dev/null
+++ b/examples/camel-example-transformer-blueprint/src/main/resources/transform.xsl
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="Shift_JIS"?>
+<!--
+
+ 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.
+
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+ <xsl:template match="@*|node()">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <xsl:template match="MyRequest">
+ <MyResponse>
+ <xsl:apply-templates/>
+ </MyResponse>
+ </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/examples/camel-example-twitter-websocket-blueprint/README.adoc b/examples/camel-example-twitter-websocket-blueprint/README.adoc
new file mode 100644
index 0000000..2967a83
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/README.adoc
@@ -0,0 +1,68 @@
+== Twitter and Websocket Blueprint Example
+
+=== Introduction
+
+The example is demonstrating how to poll a constant feed of twitter
+searches and publish results in real time using web socket to a web
+page.
+
+This example is already configured using a testing purpose twitter
+account named `cameltweet'. And therefore the example is ready to run
+out of the box.
+
+This account is only for testing purpose, and should not be used in your
+custom applications. For that you need to setup and use your own twitter
+account.
+
+=== Build
+
+You will need to install this example first to your local maven
+repository with: mvn install
+
+=== Run with Karaf
+
+This example requires running in Apache Karaf / ServiceMix
+
+....
+karaf
+....
+
+To install Apache Camel in Karaf you type in the shell (as an example
+here we make use of Camel version 2.18.1):
+
+....
+feature:repo-add camel ${version}
+....
+
+First you need to install the following features in Karaf/ServiceMix
+with:
+
+feature:install camel feature:install camel-twitter feature:install
+camel-websocket
+
+Then you can install the Camel example:
+
+....
+install -s mvn:org.apache.camel.example/camel-example-twitter-websocket-blueprint/${version}
+....
+
+Then open a browser to see live twitter updates in the web page
+
+....
+http://localhost:9090
+....
+
+http://localhost:9090 To stop the example run from Karaf/ServiceMix
+shell: stop
+
+eg if the bundle id is 99 then type: stop 99
+
+=== Help and contributions
+
+If you hit any problem using Camel or have some feedback, then please
+https://camel.apache.org/support.html[let us know].
+
+We also love contributors, so
+https://camel.apache.org/contributing.html[get involved] :-)
+
+The Camel riders!
diff --git a/examples/camel-example-twitter-websocket-blueprint/pom.xml b/examples/camel-example-twitter-websocket-blueprint/pom.xml
new file mode 100644
index 0000000..2f9a080
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>camel-example-twitter-websocket-blueprint</artifactId>
+ <name>Camel :: Example :: Twitter WebSocket :: OSGi</name>
+ <description>An example that pushes new tweets to a web page using web-socket</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <category>Social</category>
+
+ <camel.osgi.import.pkg>
+ *
+ </camel.osgi.import.pkg>
+ <camel.osgi.export.pkg>
+ *
+ </camel.osgi.export.pkg>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <!-- Add Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bom</artifactId>
+ <version>${camel.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <!-- there are no maven dependencies needed as the Camel application has no Java code,
+ and its all defined in the src/main/resources/OSGI-INF/blueprint/camel-twitter.xml file -->
+
+</project>
diff --git a/examples/camel-example-twitter-websocket-blueprint/src/main/resources/META-INF/LICENSE.txt b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/META-INF/LICENSE.txt
new file mode 100644
index 0000000..6b0b127
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/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
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
diff --git a/examples/camel-example-twitter-websocket-blueprint/src/main/resources/META-INF/NOTICE.txt b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/META-INF/NOTICE.txt
new file mode 100644
index 0000000..2e215bf
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/META-INF/NOTICE.txt
@@ -0,0 +1,11 @@
+ =========================================================================
+ == NOTICE file corresponding to the section 4 d of ==
+ == the Apache License, Version 2.0, ==
+ == in this case for the Apache Camel distribution. ==
+ =========================================================================
+
+ This product includes software developed by
+ The Apache Software Foundation (http://www.apache.org/).
+
+ Please read the different LICENSE files present in the licenses directory of
+ this distribution.
diff --git a/examples/camel-example-twitter-websocket-blueprint/src/main/resources/OSGI-INF/blueprint/camel-twitter.xml b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/OSGI-INF/blueprint/camel-twitter.xml
new file mode 100644
index 0000000..ecbaac1
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/OSGI-INF/blueprint/camel-twitter.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
+
+ <!-- CamelContext with the twitter websocket example -->
+ <camelContext id="twitter-camel" xmlns="http://camel.apache.org/schema/blueprint">
+
+ <!-- use properties files for twitter codes -->
+ <propertyPlaceholder id="placeholder" location="classpath:twitter.properties"/>
+
+ <route id="twitter-route">
+ <!-- consume from twitter search to get new tweets about gaga every 5th second -->
+ <from uri="twitter-search://gaga?type=polling&delay=6000
+ &accessToken={{access.token}}&accessTokenSecret={{access.token-secret}}&consumerKey={{consumer.key}}&consumerSecret={{consumer.secret}}"/>
+
+ <!-- log tweet to the log -->
+ <to uri="log:tweet"/>
+
+ <!-- and send tweet to the websocket component so its viewable in the web page -->
+ <to uri="websocket://localhost:9090/camel-tweet?sendToAll=true&staticResources=classpath:webapp"/>
+ </route>
+
+ </camelContext>
+
+</blueprint>
diff --git a/examples/camel-example-twitter-websocket-blueprint/src/main/resources/twitter.properties b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/twitter.properties
new file mode 100644
index 0000000..ee524e5
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/twitter.properties
@@ -0,0 +1,24 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+
+## This uses the Twitter 'cameltweet' account for testing purposes.
+## do NOT use this twitter account in your applications!
+
+consumer.key = NMqaca1bzXsOcZhP2XlwA
+consumer.secret = VxNQiRLwwKVD0K9mmfxlTTbVdgRpriORypnUbHhxeQw
+access.token = 26693234-W0YjxL9cMJrC0VZZ4xdgFMymxIQ10LeL1K8YlbBY
+access.token-secret = BZD51BgzbOdFstWZYsqB5p5dbuuDV12vrOdatzhY4E
diff --git a/examples/camel-example-twitter-websocket-blueprint/src/main/resources/webapp/index.html b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/webapp/index.html
new file mode 100644
index 0000000..ec32671
--- /dev/null
+++ b/examples/camel-example-twitter-websocket-blueprint/src/main/resources/webapp/index.html
@@ -0,0 +1,82 @@
+<!--
+
+ 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.
+
+-->
+<html>
+
+<head>
+ <title>Camel Twitter WebSocket Blueprint Example</title>
+ <script type='text/javascript'>
+
+ if (!window.WebSocket) {
+ alert("WebSocket not supported by this browser");
+ }
+
+ var room = {
+ join: function (name) {
+ this._username = name;
+ var location = "ws://localhost:9090/camel-tweet";
+ this._ws = new WebSocket(location);
+ this._ws.onmessage = this._onmessage;
+ this._ws.onclose = this._onclose;
+ },
+
+ _onmessage: function (m) {
+ if (m.data) {
+ var chat = document.getElementById('chat')
+ var spanText = document.createElement('span');
+ spanText.className = 'text';
+ spanText.innerHTML = m.data;
+ var lineBreak = document.createElement('br');
+ chat.appendChild(spanText);
+ chat.appendChild(lineBreak);
+ chat.scrollTop = chat.scrollHeight - chat.clientHeight;
+ }
+ },
+
+ _onclose: function (m) {
+ this._ws = null;
+ }
+
+ };
+
+ </script>
+ <style type='text/css'>
+ div {
+ border: 0px solid black;
+ }
+
+ div#chat {
+ clear: both;
+ width: 80em;
+ height: 60ex;
+ overflow: auto;
+ background-color: #f0f0f0;
+ padding: 4px;
+ border: 1px solid black;
+ }
+ </style>
+</head>
+
+<body>
+<div id='chat'></div>
+<script type='text/javascript'>
+ room.join("Testing");
+</script>
+</body>
+
+</html>
diff --git a/examples/pom.xml b/examples/pom.xml
new file mode 100644
index 0000000..55b4c9f
--- /dev/null
+++ b/examples/pom.xml
@@ -0,0 +1,595 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ 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.
+
+-->
+<project xmlns="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">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-dependencies</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ </parent>
+
+ <groupId>org.apache.camel.example</groupId>
+ <artifactId>karaf-examples</artifactId>
+ <version>3.5.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>Camel Karaf Examples</name>
+ <description>Examples for Camel Karaf</description>
+ <url>https://camel.apache.org</url>
+
+ <developers>
+ <developer>
+ <name>The Apache Camel Team</name>
+ <email>dev@camel.apache.org</email>
+ <url>https://camel.apache.org</url>
+ <organization>Apache Software Foundation</organization>
+ <organizationUrl>http://apache.org/</organizationUrl>
+ </developer>
+ </developers>
+
+ <mailingLists>
+ <mailingList>
+ <name>Development List</name>
+ <subscribe>dev-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>dev-unsubscribe@camel.apache.org</unsubscribe>
+ <post>dev@camel.apache.org</post>
+ </mailingList>
+ <mailingList>
+ <name>User List</name>
+ <subscribe>users-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>users-unsubscribe@camel.apache.org</unsubscribe>
+ <post>users@camel.apache.org</post>
+ </mailingList>
+ <mailingList>
+ <name>Commits List</name>
+ <subscribe>commits-subscribe@camel.apache.org</subscribe>
+ <unsubscribe>commits-unsubscribe@camel.apache.org</unsubscribe>
+ <post>commits@camel.apache.org</post>
+ </mailingList>
+ </mailingLists>
+
+ <issueManagement>
+ <system>jira</system>
+ <url>https://issues.apache.org/jira/browse/CAMEL</url>
+ </issueManagement>
+
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>${site-repo-url}</url>
+ </site>
+ </distributionManagement>
+
+ <modules>
+ <module>camel-example-artemis-amqp-blueprint</module>
+ <module>camel-example-fhir-osgi</module>
+ <module>camel-example-cxf-blueprint</module>
+ <module>camel-example-olingo4-blueprint</module>
+ <module>camel-example-servlet-rest-blueprint</module>
+ <module>camel-example-servlet-rest-karaf-jaas</module>
+ <module>camel-example-sql-blueprint</module>
+ <module>camel-example-swagger-osgi</module>
+ <module>camel-example-openapi-osgi</module>
+ <module>camel-example-transformer-blueprint</module>
+ <module>camel-example-twitter-websocket-blueprint</module>
+ </modules>
+
+ <properties>
+ <!-- unify the encoding for all the modules -->
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+
+ <site-repo-url>scpexe://people.apache.org/www/camel.apache.org/maven/</site-repo-url>
+ <jdk.version>1.8</jdk.version>
+ <compiler.fork>false</compiler.fork>
+
+ <camel.version>3.5.0-SNAPSHOT</camel.version>
+ <camel.karaf.version>3.5.0-SNAPSHOT</camel.karaf.version>
+
+ <!-- Versions -->
+ <arquillian-version>1.5.0.Final</arquillian-version>
+ <asciidoctorj-version>2.1.0</asciidoctorj-version>
+ <camel-bundle-plugin-version>${camel.version}</camel-bundle-plugin-version>
+ <cdi-api-1.2-version>1.2</cdi-api-1.2-version>
+ <glassfish-jaxb-runtime-version>${jakarta-jaxb-version}</glassfish-jaxb-runtime-version>
+ <groovy-version>3.0.2</groovy-version>
+ <pax-exam-version>4.13.2</pax-exam-version>
+ <pax-url-aether>2.6.2</pax-url-aether>
+ <jaxb-version>2.3.0</jaxb-version>
+ <karaf4-version>4.2.8</karaf4-version>
+ <maven-compiler-plugin-version>3.8.1</maven-compiler-plugin-version>
+ <maven-surefire-plugin-version>3.0.0-M4</maven-surefire-plugin-version>
+ <maven-javadoc-plugin-version>3.0.1</maven-javadoc-plugin-version>
+ <exec-maven-plugin-version>1.6.0</exec-maven-plugin-version>
+ <metrics-cdi-version>1.3.3</metrics-cdi-version>
+ <mycila-license-version>3.0</mycila-license-version>
+ <pax-cdi-version>1.0.0</pax-cdi-version>
+ <spring-security-version>5.3.0.RELEASE</spring-security-version>
+ <surefire.version>${maven-surefire-plugin-version}</surefire.version>
+ <tinybundles-version>2.1.1</tinybundles-version>
+ <tomcat-version>9.0.36</tomcat-version>
+ <woodstox-version>6.0.3</woodstox-version>
+ <xmlunit-version>1.6</xmlunit-version>
+ <derby-version>10.14.2.0</derby-version>
+
+ <!-- for symbolicName in OSGi examples we only want the artifactId, eg camel-example-sql -->
+ <!-- as having org.apache.camel as prefix is not needed and makes the name very long -->
+ <camel.osgi.symbolic.name>${project.artifactId}</camel.osgi.symbolic.name>
+ <skip.starting.camel.context>false</skip.starting.camel.context>
+ <javax.servlet.api.version>4.0.1</javax.servlet.api.version>
+ <camel.osgi.export.pkg/>
+ <camel.osgi.manifest>${project.build.outputDirectory}/META-INF/MANIFEST.MF</camel.osgi.manifest>
+
+ <!-- OSGi bundles properties -->
+ <camel.osgi.import.camel.version>
+ version="[$(version;==;${camel.osgi.version.clean}),$(version;=+;${camel.osgi.version.clean}))"
+ </camel.osgi.import.camel.version>
+ <camel.osgi.import.strict.version>
+ version="[$(version;===;${camel.osgi.version.clean}),$(version;==+;${camel.osgi.version.clean}))"
+ </camel.osgi.import.strict.version>
+ <camel.osgi.import.default.version>[$(version;==;$(@)),$(version;+;$(@)))</camel.osgi.import.default.version>
+ <camel.osgi.import.defaults>
+ </camel.osgi.import.defaults>
+ <camel.osgi.import.before.defaults/>
+ <camel.osgi.import.additional/>
+ <camel.osgi.import.pkg>
+ org.apache.camel.*;${camel.osgi.import.camel.version},
+ ${camel.osgi.import.before.defaults},
+ ${camel.osgi.import.defaults},
+ ${camel.osgi.import.additional},
+ *
+ </camel.osgi.import.pkg>
+ <camel.osgi.activator/>
+ <camel.osgi.failok>false</camel.osgi.failok>
+ <camel.osgi.private.pkg>!*</camel.osgi.private.pkg>
+ <camel.osgi.export.pkg>$${replace;{local-packages};;;\;}</camel.osgi.export.pkg>
+ <camel.osgi.export>${camel.osgi.export.pkg};-noimport:=true;${camel.osgi.version}</camel.osgi.export>
+ <camel.osgi.version>version=${project.version}</camel.osgi.version>
+ <camel.osgi.import>${camel.osgi.import.pkg}</camel.osgi.import>
+ <camel.osgi.dynamic/>
+ <camel.osgi.exclude.dependencies>false</camel.osgi.exclude.dependencies>
+ <camel.osgi.require.capability/>
+ <camel.osgi.provide.capability/>
+ </properties>
+
+ <!-- Comment out the snapshot repositories as we don't need them now -->
+ <repositories>
+ <repository>
+ <id>apache.snapshots</id>
+ <url>https://repository.apache.org/snapshots/</url>
+ <name>Apache Snapshot Repo</name>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>apache.snapshots</id>
+ <url>https://repository.apache.org/snapshots/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+
+ <!-- update readme file -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-package-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>prepare-example</goal>
+ </goals>
+ <phase>process-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- to validate Camel endpoints: mvn camel-report:validate -->
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-report-maven-plugin</artifactId>
+ <version>${camel.version}</version>
+ <configuration>
+ <failOnError>false</failOnError>
+ <includeTest>true</includeTest>
+ <includeXml>true</includeXml>
+ <ignoreLenientProperties>false</ignoreLenientProperties>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <forkCount>1</forkCount>
+ <reuseForks>false</reuseForks>
+ <systemPropertyVariables>
+ <skipStartingCamelContext>${skip.starting.camel.context}</skipStartingCamelContext>
+ </systemPropertyVariables>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <version>${camel-bundle-plugin-version}</version>
+ <extensions>false</extensions>
+ <configuration>
+ <supportIncrementalBuild>true</supportIncrementalBuild>
+ <noWarningProjectTypes>pom</noWarningProjectTypes>
+ <excludeDependencies>${camel.osgi.exclude.dependencies}</excludeDependencies>
+ <instructions>
+ <Bundle-Name>${project.artifactId}</Bundle-Name>
+ <Bundle-SymbolicName>${camel.osgi.symbolic.name}</Bundle-SymbolicName>
+ <Bundle-Activator>${camel.osgi.activator}</Bundle-Activator>
+ <Import-Package>${camel.osgi.import}</Import-Package>
+ <Export-Package>${camel.osgi.export}</Export-Package>
+ <DynamicImport-Package>${camel.osgi.dynamic}</DynamicImport-Package>
+ <Private-Package>${camel.osgi.private.pkg}</Private-Package>
+ <Require-Capability>${camel.osgi.require.capability}</Require-Capability>
+ <Provide-Capability>${camel.osgi.provide.capability}</Provide-Capability>
+ <Implementation-Title>Apache Camel</Implementation-Title>
+ <Implementation-Version>${project.version}</Implementation-Version>
+ <Karaf-Info>Camel;${project.artifactId}=${project.version}</Karaf-Info>
+ <_versionpolicy>${camel.osgi.import.default.version}</_versionpolicy>
+ <_failok>${camel.osgi.failok}</_failok>
+ <_removeheaders>Bnd-LastModified</_removeheaders>
+ </instructions>
+ </configuration>
+ <executions>
+ <execution>
+ <id>versions</id>
+ <phase>validate</phase>
+ <goals>
+ <goal>cleanVersions</goal>
+ </goals>
+ <configuration>
+ <versions>
+ <camel.osgi.version.clean>${project.version}</camel.osgi.version.clean>
+ </versions>
+ </configuration>
+ </execution>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${maven-compiler-plugin-version}</version>
+ <configuration>
+ <source>${jdk.version}</source>
+ <target>${jdk.version}</target>
+ <maxmem>512M</maxmem>
+ <fork>${compiler.fork}</fork>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <configuration>
+ <attach>true</attach>
+ <source>${jdk.version}</source>
+ <quiet>true</quiet>
+ <bottom>Apache Camel</bottom>
+ <detectOfflineLinks>false</detectOfflineLinks>
+ <javadocVersion>1.8.0</javadocVersion>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ <encoding>UTF-8</encoding>
+ </configuration>
+ </plugin>
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-bundle-plugin</artifactId>
+ <versionRange>[2.3.7,)</versionRange>
+ <goals>
+ <goal>cleanVersions</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore/>
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>${maven-javadoc-plugin-version}</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>2.10</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-buildtools</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>false</downloadJavadocs>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.rat</groupId>
+ <artifactId>apache-rat-plugin</artifactId>
+ <configuration>
+ <excludeSubProjects>false</excludeSubProjects>
+ <excludes>
+ <exclude>**/generated.txt</exclude>
+ <exclude>**/*.json</exclude>
+ <exclude>**/README</exclude>
+ <exclude>**/README.txt</exclude>
+ <exclude>**/README.md</exclude>
+ <exclude>**/ReadMe.md</exclude>
+ <exclude>**/resources/**/*.xsd</exclude>
+ <exclude>**/webapp/js/**/*</exclude>
+ <exclude>**/test/resources/**/*</exclude>
+ <exclude>**/test/data*/**/*</exclude>
+ <exclude>.gitignore</exclude>
+ <exclude>.git/**/*</exclude>
+ <exclude>**/*.adoc</exclude>
+ <exclude>**/*.adoc.template</exclude>
+ <exclude>**/*.md</exclude>
+ <exclude>**/*.sh</exclude>
+ <exclude>**/*.bat</exclude>
+ <exclude>**/java9-maven-settings</exclude>
+ <exclude>**/*.pfx</exclude>
+ <!-- tooling json-simple parser -->
+ <exclude>**/src/main/java/org/json/simple/**</exclude>
+ <!-- tooling/camel-manual/src/styles/print.css use a different license -->
+ <exclude>**/src/styles/print.css</exclude>
+ <!-- tooling for component docs -->
+ <exclude>**/component-header.mvel</exclude>
+ <exclude>**/component-options.mvel</exclude>
+ <exclude>**/endpoint-options.mvel</exclude>
+ <exclude>**/dataformat-options.mvel</exclude>
+ <exclude>**/eip-options.mvel</exclude>
+ <exclude>**/language-options.mvel</exclude>
+ <exclude>**/website-components-list.mvel</exclude>
+ <exclude>**/website-languages-list.mvel</exclude>
+ <exclude>**/website-others-list.mvel</exclude>
+ <exclude>**/website-dataformats-list.mvel</exclude>
+ <exclude>**/readme-examples.mvel</exclude>
+ <exclude>**/spring-boot-auto-configure-options.mvel</exclude>
+ <exclude>**/camel-NOTICE.txt</exclude>
+ <exclude>**/spring-boot-starter-NOTICE.txt</exclude>
+ <!-- cxf does not handle comments here -->
+ <exclude>**/src/main/resources/META-INF/cxf/cxf.extension</exclude>
+ <exclude>**/src/main/resources/META-INF/cxf/bus-extensions.txt</exclude>
+ <!-- ignore the api signatures files -->
+ <exclude>**/src/signatures/*.txt</exclude>
+ <!-- camel-salesforce BSD license from salesforce developers -->
+ <exclude>**/CometDReplayExtension.java</exclude>
+ <exclude>**/LICENSE-SALESFORCE.txt</exclude>
+ <!-- camel-as2 -->
+ <exclude>**/mdnDescription.vm</exclude>
+ <!-- camel-jbpm -->
+ <exclude>**/src/main/resources/*.wid</exclude>
+ <!-- camel website and user-manual -->
+ <exclude>**/node/**</exclude>
+ <exclude>**/node_modules/**</exclude>
+ <exclude>**/user-manual/**</exclude>
+ <exclude>**/yarn.lock</exclude>
+ <!-- examples -->
+ <exclude>**/fabric8/*.yaml</exclude>
+ <exclude>**/src/main/data/*.patient</exclude>
+ <exclude>**/src/main/data/*.csv</exclude>
+ <exclude>**/src/main/resources/avro/*.avsc</exclude>
+ <!-- generated files -->
+ <exclude>**/target/**/*</exclude>
+ <exclude>**/eclipse-classes/**/*</exclude>
+ <exclude>**/.*</exclude>
+ <exclude>**/.settings/**/*</exclude>
+ <exclude>**/*.iml</exclude>
+ <exclude>**/.idea/**/*</exclude>
+ <exclude>**/avro/**/*.avpr</exclude>
+ <exclude>**/OSGI-INF/bundle.info</exclude>
+ <exclude>**/test_rsa*</exclude>
+ <exclude>**/data*/**/*.xml</exclude>
+ <exlucde>**/*.log</exlucde>
+ <exclude>**/id_file</exclude>
+ <exclude>**/dependency-reduced-pom.xml</exclude>
+ <exclude>**/Dropbox_API_Terms_and_Conditions.txt</exclude>
+ <exclude>**/MerchandiseRestResource.apxc</exclude>
+ <exclude>**/file-sig-api.txt</exclude>
+ <exclude>**/Tasks__c.java</exclude>
+ <exclude>**/*.proto</exclude>
+ <exclude>
+ **/src/main/resources/META-INF/services/org.kie.server.services.api.KieServerExtension
+ </exclude>
+ <!-- Maven Wrapper -->
+ <exclude>.mvn/**/*</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <!-- see https://issues.apache.org/jira/browse/MRELEASE-812 -->
+ <version>2.4.2</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.scm</groupId>
+ <artifactId>maven-scm-provider-gitexe</artifactId>
+ <version>1.9</version>
+ </dependency>
+ </dependencies>
+ <configuration>
+ <localCheckout>true</localCheckout>
+ <pushChanges>true</pushChanges>
+ <tagNameFormat>@{project.artifactId}-@{project.version}</tagNameFormat>
+ <useReleaseProfile>false</useReleaseProfile>
+ <preparationGoals>clean install</preparationGoals>
+ <goals>deploy</goals>
+ <!-- The profile we want to use when doing the release -->
+ <arguments>-Prelease,apache-release,enable-schemagen,apt,sourcecheck,hibernate</arguments>
+ <autoVersionSubmodules>true</autoVersionSubmodules>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-remote-resources-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>process-resource-bundles</id>
+ <phase>disabled</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>flatten-maven-plugin</artifactId>
+ <version>1.1.0</version>
+ <executions>
+ <execution>
+ <id>default-cli</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>flatten</goal>
+ </goals>
+ <configuration>
+ <updatePomFile>true</updatePomFile>
+ <pomElements>
+ <build>keep</build>
+ <dependencyManagement>keep</dependencyManagement>
+ <description>keep</description>
+ <name>keep</name>
+ <parent>expand</parent>
+ <pluginManagement>keep</pluginManagement>
+ <profiles>remove</profiles>
+ <properties>keep</properties>
+ </pomElements>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <configuration>
+ <skipInstallation>${invoker.skip}</skipInstallation>
+ <skipInvocation>${invoker.skip}</skipInvocation>
+ <mavenOpts>-Xmx64m -XshowSettings</mavenOpts>
+ <showVersion>true</showVersion>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>${exec-maven-plugin-version}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>container-test</id>
+ <properties>
+ <skip.starting.camel.context>true</skip.starting.camel.context>
+ </properties>
+ </profile>
+ <!--
+ This profile allows you to add a repository to the repo list so that
+ you can test the examples out against a staged version of the camel distribution
+ -->
+ <profile>
+ <id>add-remote-repo</id>
+ <activation>
+ <property>
+ <name>remoteRepo</name>
+ </property>
+ </activation>
+
+ <repositories>
+ <repository>
+ <id>dynamic.repo</id>
+ <name>Repository Dynamically Added Via the Command Line</name>
+ <url>$remoteRepo</url>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>dynamic.repo</id>
+ <name>Repository Dynamically Added Via the Command Line</name>
+ <url>$remoteRepo</url>
+ </pluginRepository>
+ </pluginRepositories>
+
+ </profile>
+ </profiles>
+
+</project>
diff --git a/mvnw b/mvnw
new file mode 100755
index 0000000..41c0f0c
--- /dev/null
+++ b/mvnw
@@ -0,0 +1,310 @@
+#!/bin/sh
+# ----------------------------------------------------------------------------
+# 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.
+# ----------------------------------------------------------------------------
+
+# ----------------------------------------------------------------------------
+# Maven Start Up Batch script
+#
+# Required ENV vars:
+# ------------------
+# JAVA_HOME - location of a JDK home dir
+#
+# Optional ENV vars
+# -----------------
+# M2_HOME - location of maven2's installed home dir
+# MAVEN_OPTS - parameters passed to the Java VM when running Maven
+# e.g. to debug Maven itself, use
+# set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+# MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+# ----------------------------------------------------------------------------
+
+if [ -z "$MAVEN_SKIP_RC" ] ; then
+
+ if [ -f /etc/mavenrc ] ; then
+ . /etc/mavenrc
+ fi
+
+ if [ -f "$HOME/.mavenrc" ] ; then
+ . "$HOME/.mavenrc"
+ fi
+
+fi
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false;
+darwin=false;
+mingw=false
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+ MINGW*) mingw=true;;
+ Darwin*) darwin=true
+ # Use /usr/libexec/java_home if available, otherwise fall back to /Library/Java/Home
+ # See https://developer.apple.com/library/mac/qa/qa1170/_index.html
+ if [ -z "$JAVA_HOME" ]; then
+ if [ -x "/usr/libexec/java_home" ]; then
+ export JAVA_HOME="`/usr/libexec/java_home`"
+ else
+ export JAVA_HOME="/Library/Java/Home"
+ fi
+ fi
+ ;;
+esac
+
+if [ -z "$JAVA_HOME" ] ; then
+ if [ -r /etc/gentoo-release ] ; then
+ JAVA_HOME=`java-config --jre-home`
+ fi
+fi
+
+if [ -z "$M2_HOME" ] ; then
+ ## resolve links - $0 may be a link to maven's home
+ PRG="$0"
+
+ # need this for relative symlinks
+ while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
+ done
+
+ saveddir=`pwd`
+
+ M2_HOME=`dirname "$PRG"`/..
+
+ # make it fully qualified
+ M2_HOME=`cd "$M2_HOME" && pwd`
+
+ cd "$saveddir"
+ # echo Using m2 at $M2_HOME
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --unix "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
+fi
+
+# For Mingw, ensure paths are in UNIX format before anything is touched
+if $mingw ; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME="`(cd "$M2_HOME"; pwd)`"
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME="`(cd "$JAVA_HOME"; pwd)`"
+fi
+
+if [ -z "$JAVA_HOME" ]; then
+ javaExecutable="`which javac`"
+ if [ -n "$javaExecutable" ] && ! [ "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ]; then
+ # readlink(1) is not available as standard on Solaris 10.
+ readLink=`which readlink`
+ if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
+ if $darwin ; then
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
+ else
+ javaExecutable="`readlink -f \"$javaExecutable\"`"
+ fi
+ javaHome="`dirname \"$javaExecutable\"`"
+ javaHome=`expr "$javaHome" : '\(.*\)/bin'`
+ JAVA_HOME="$javaHome"
+ export JAVA_HOME
+ fi
+ fi
+fi
+
+if [ -z "$JAVACMD" ] ; then
+ if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
+ else
+ JAVACMD="$JAVA_HOME/bin/java"
+ fi
+ else
+ JAVACMD="`which java`"
+ fi
+fi
+
+if [ ! -x "$JAVACMD" ] ; then
+ echo "Error: JAVA_HOME is not defined correctly." >&2
+ echo " We cannot execute $JAVACMD" >&2
+ exit 1
+fi
+
+if [ -z "$JAVA_HOME" ] ; then
+ echo "Warning: JAVA_HOME environment variable is not set."
+fi
+
+CLASSWORLDS_LAUNCHER=org.codehaus.plexus.classworlds.launcher.Launcher
+
+# traverses directory structure from process work directory to filesystem root
+# first directory with .mvn subdirectory is considered project base directory
+find_maven_basedir() {
+
+ if [ -z "$1" ]
+ then
+ echo "Path not specified to find_maven_basedir"
+ return 1
+ fi
+
+ basedir="$1"
+ wdir="$1"
+ while [ "$wdir" != '/' ] ; do
+ if [ -d "$wdir"/.mvn ] ; then
+ basedir=$wdir
+ break
+ fi
+ # workaround for JBEAP-8937 (on Solaris 10/Sparc)
+ if [ -d "${wdir}" ]; then
+ wdir=`cd "$wdir/.."; pwd`
+ fi
+ # end of workaround
+ done
+ echo "${basedir}"
+}
+
+# concatenates all lines of a file
+concat_lines() {
+ if [ -f "$1" ]; then
+ echo "$(tr -s '\n' ' ' < "$1")"
+ fi
+}
+
+BASE_DIR=`find_maven_basedir "$(pwd)"`
+if [ -z "$BASE_DIR" ]; then
+ exit 1;
+fi
+
+##########################################################################################
+# Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+# This allows using the maven wrapper in projects that prohibit checking in binary data.
+##########################################################################################
+if [ -r "$BASE_DIR/.mvn/wrapper/maven-wrapper.jar" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found .mvn/wrapper/maven-wrapper.jar"
+ fi
+else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
+ fi
+ if [ -n "$MVNW_REPOURL" ]; then
+ jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ else
+ jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ fi
+ while IFS="=" read key value; do
+ case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
+ esac
+ done < "$BASE_DIR/.mvn/wrapper/maven-wrapper.properties"
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Downloading from: $jarUrl"
+ fi
+ wrapperJarPath="$BASE_DIR/.mvn/wrapper/maven-wrapper.jar"
+ if $cygwin; then
+ wrapperJarPath=`cygpath --path --windows "$wrapperJarPath"`
+ fi
+
+ if command -v wget > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found wget ... using wget"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ wget "$jarUrl" -O "$wrapperJarPath"
+ else
+ wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
+ fi
+ elif command -v curl > /dev/null; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Found curl ... using curl"
+ fi
+ if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
+ curl -o "$wrapperJarPath" "$jarUrl" -f
+ else
+ curl --user $MVNW_USERNAME:$MVNW_PASSWORD -o "$wrapperJarPath" "$jarUrl" -f
+ fi
+
+ else
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo "Falling back to using Java to download"
+ fi
+ javaClass="$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.java"
+ # For Cygwin, switch paths to Windows format before running javac
+ if $cygwin; then
+ javaClass=`cygpath --path --windows "$javaClass"`
+ fi
+ if [ -e "$javaClass" ]; then
+ if [ ! -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Compiling MavenWrapperDownloader.java ..."
+ fi
+ # Compiling the Java class
+ ("$JAVA_HOME/bin/javac" "$javaClass")
+ fi
+ if [ -e "$BASE_DIR/.mvn/wrapper/MavenWrapperDownloader.class" ]; then
+ # Running the downloader
+ if [ "$MVNW_VERBOSE" = true ]; then
+ echo " - Running MavenWrapperDownloader.java ..."
+ fi
+ ("$JAVA_HOME/bin/java" -cp .mvn/wrapper MavenWrapperDownloader "$MAVEN_PROJECTBASEDIR")
+ fi
+ fi
+ fi
+fi
+##########################################################################################
+# End of extension
+##########################################################################################
+
+export MAVEN_PROJECTBASEDIR=${MAVEN_BASEDIR:-"$BASE_DIR"}
+if [ "$MVNW_VERBOSE" = true ]; then
+ echo $MAVEN_PROJECTBASEDIR
+fi
+MAVEN_OPTS="$(concat_lines "$MAVEN_PROJECTBASEDIR/.mvn/jvm.config") $MAVEN_OPTS"
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ [ -n "$M2_HOME" ] &&
+ M2_HOME=`cygpath --path --windows "$M2_HOME"`
+ [ -n "$JAVA_HOME" ] &&
+ JAVA_HOME=`cygpath --path --windows "$JAVA_HOME"`
+ [ -n "$CLASSPATH" ] &&
+ CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
+ [ -n "$MAVEN_PROJECTBASEDIR" ] &&
+ MAVEN_PROJECTBASEDIR=`cygpath --path --windows "$MAVEN_PROJECTBASEDIR"`
+fi
+
+# Provide a "standardized" way to retrieve the CLI args that will
+# work with both Windows and non-Windows executions.
+MAVEN_CMD_LINE_ARGS="$MAVEN_CONFIG $@"
+export MAVEN_CMD_LINE_ARGS
+
+WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+exec "$JAVACMD" \
+ $MAVEN_OPTS \
+ -classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
+ "-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
+ ${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
diff --git a/mvnw.cmd b/mvnw.cmd
new file mode 100644
index 0000000..8611571
--- /dev/null
+++ b/mvnw.cmd
@@ -0,0 +1,182 @@
+@REM ----------------------------------------------------------------------------
+@REM Licensed to the Apache Software Foundation (ASF) under one
+@REM or more contributor license agreements. See the NOTICE file
+@REM distributed with this work for additional information
+@REM regarding copyright ownership. The ASF licenses this file
+@REM to you under the Apache License, Version 2.0 (the
+@REM "License"); you may not use this file except in compliance
+@REM with the License. You may obtain a copy of the License at
+@REM
+@REM http://www.apache.org/licenses/LICENSE-2.0
+@REM
+@REM Unless required by applicable law or agreed to in writing,
+@REM software distributed under the License is distributed on an
+@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+@REM KIND, either express or implied. See the License for the
+@REM specific language governing permissions and limitations
+@REM under the License.
+@REM ----------------------------------------------------------------------------
+
+@REM ----------------------------------------------------------------------------
+@REM Maven Start Up Batch script
+@REM
+@REM Required ENV vars:
+@REM JAVA_HOME - location of a JDK home dir
+@REM
+@REM Optional ENV vars
+@REM M2_HOME - location of maven2's installed home dir
+@REM MAVEN_BATCH_ECHO - set to 'on' to enable the echoing of the batch commands
+@REM MAVEN_BATCH_PAUSE - set to 'on' to wait for a keystroke before ending
+@REM MAVEN_OPTS - parameters passed to the Java VM when running Maven
+@REM e.g. to debug Maven itself, use
+@REM set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000
+@REM MAVEN_SKIP_RC - flag to disable loading of mavenrc files
+@REM ----------------------------------------------------------------------------
+
+@REM Begin all REM lines with '@' in case MAVEN_BATCH_ECHO is 'on'
+@echo off
+@REM set title of command window
+title %0
+@REM enable echoing by setting MAVEN_BATCH_ECHO to 'on'
+@if "%MAVEN_BATCH_ECHO%" == "on" echo %MAVEN_BATCH_ECHO%
+
+@REM set %HOME% to equivalent of $HOME
+if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
+
+@REM Execute a user defined script before this one
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
+@REM check for pre script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
+if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
+:skipRcPre
+
+@setlocal
+
+set ERROR_CODE=0
+
+@REM To isolate internal variables from possible post scripts, we use another setlocal
+@setlocal
+
+@REM ==== START VALIDATION ====
+if not "%JAVA_HOME%" == "" goto OkJHome
+
+echo.
+echo Error: JAVA_HOME not found in your environment. >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+:OkJHome
+if exist "%JAVA_HOME%\bin\java.exe" goto init
+
+echo.
+echo Error: JAVA_HOME is set to an invalid directory. >&2
+echo JAVA_HOME = "%JAVA_HOME%" >&2
+echo Please set the JAVA_HOME variable in your environment to match the >&2
+echo location of your Java installation. >&2
+echo.
+goto error
+
+@REM ==== END VALIDATION ====
+
+:init
+
+@REM Find the project base dir, i.e. the directory that contains the folder ".mvn".
+@REM Fallback to current working directory if not found.
+
+set MAVEN_PROJECTBASEDIR=%MAVEN_BASEDIR%
+IF NOT "%MAVEN_PROJECTBASEDIR%"=="" goto endDetectBaseDir
+
+set EXEC_DIR=%CD%
+set WDIR=%EXEC_DIR%
+:findBaseDir
+IF EXIST "%WDIR%"\.mvn goto baseDirFound
+cd ..
+IF "%WDIR%"=="%CD%" goto baseDirNotFound
+set WDIR=%CD%
+goto findBaseDir
+
+:baseDirFound
+set MAVEN_PROJECTBASEDIR=%WDIR%
+cd "%EXEC_DIR%"
+goto endDetectBaseDir
+
+:baseDirNotFound
+set MAVEN_PROJECTBASEDIR=%EXEC_DIR%
+cd "%EXEC_DIR%"
+
+:endDetectBaseDir
+
+IF NOT EXIST "%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config" goto endReadAdditionalConfig
+
+@setlocal EnableExtensions EnableDelayedExpansion
+for /F "usebackq delims=" %%a in ("%MAVEN_PROJECTBASEDIR%\.mvn\jvm.config") do set JVM_CONFIG_MAVEN_PROPS=!JVM_CONFIG_MAVEN_PROPS! %%a
+@endlocal & set JVM_CONFIG_MAVEN_PROPS=%JVM_CONFIG_MAVEN_PROPS%
+
+:endReadAdditionalConfig
+
+SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
+set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
+set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain
+
+set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+
+FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
+ IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
+)
+
+@REM Extension to allow automatically downloading the maven-wrapper.jar from Maven-central
+@REM This allows using the maven wrapper in projects that prohibit checking in binary data.
+if exist %WRAPPER_JAR% (
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Found %WRAPPER_JAR%
+ )
+) else (
+ if not "%MVNW_REPOURL%" == "" (
+ SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
+ )
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Couldn't find %WRAPPER_JAR%, downloading it ...
+ echo Downloading from: %DOWNLOAD_URL%
+ )
+
+ powershell -Command "&{"^
+ "$webclient = new-object System.Net.WebClient;"^
+ "if (-not ([string]::IsNullOrEmpty('%MVNW_USERNAME%') -and [string]::IsNullOrEmpty('%MVNW_PASSWORD%'))) {"^
+ "$webclient.Credentials = new-object System.Net.NetworkCredential('%MVNW_USERNAME%', '%MVNW_PASSWORD%');"^
+ "}"^
+ "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $webclient.DownloadFile('%DOWNLOAD_URL%', '%WRAPPER_JAR%')"^
+ "}"
+ if "%MVNW_VERBOSE%" == "true" (
+ echo Finished downloading %WRAPPER_JAR%
+ )
+)
+@REM End of extension
+
+@REM Provide a "standardized" way to retrieve the CLI args that will
+@REM work with both Windows and non-Windows executions.
+set MAVEN_CMD_LINE_ARGS=%*
+
+%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
+if ERRORLEVEL 1 goto error
+goto end
+
+:error
+set ERROR_CODE=1
+
+:end
+@endlocal & set ERROR_CODE=%ERROR_CODE%
+
+if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
+@REM check for post script, once with legacy .bat ending and once with .cmd ending
+if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
+if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
+:skipRcPost
+
+@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
+if "%MAVEN_BATCH_PAUSE%" == "on" pause
+
+if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
+
+exit /B %ERROR_CODE%