You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2015/11/10 15:40:55 UTC
[2/6] incubator-tamaya git commit: TAMAYA-130: Added docs for camel
integration. Added also missing experimental modules/modules in work to
overall content.
TAMAYA-130: Added docs for camel integration.
Added also missing experimental modules/modules in work to overall content.
Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/2d7957f5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/2d7957f5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/2d7957f5
Branch: refs/heads/master
Commit: 2d7957f51a78d3d4bfc5de207d7b694d2b0cc115
Parents: e0ddf68
Author: anatole <an...@apache.org>
Authored: Tue Nov 10 15:08:25 2015 +0100
Committer: anatole <an...@apache.org>
Committed: Tue Nov 10 15:08:25 2015 +0100
----------------------------------------------------------------------
src/site/asciidoc/extensions/index.adoc | 48 +++++--
src/site/asciidoc/extensions/mod_camel.adoc | 161 +++++++++++++++++++++++
2 files changed, 201 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2d7957f5/src/site/asciidoc/extensions/index.adoc
----------------------------------------------------------------------
diff --git a/src/site/asciidoc/extensions/index.adoc b/src/site/asciidoc/extensions/index.adoc
index c77d906..4498a9c 100644
--- a/src/site/asciidoc/extensions/index.adoc
+++ b/src/site/asciidoc/extensions/index.adoc
@@ -45,16 +45,16 @@ Mature extensions have a stable API and SPI, similar to the API and Implementati
|=======
-== Draft Extensions
+== Extensions
Extensions in _draft state_ are tested well and normally should have rather stable APIs. Nevertheless API changes may
still occurr, but we try to prevent such changes if possible.
-NOTE All extensions, despite the _tamaya-builder_ module, currently run on Java 7 as well as on Java 8.
+NOTE All extensions currently run on Java 7 as well as on Java 8.
[width="100%",frame="1",options="header",grid="all"]
|=======
-|_Artifact_ |_Description_ |_Links_
+|_Artifact_ |_Description_ |_Links_
|+org.apache.tamaya.ext:tamaya-builder+ |Provides a fluent-style builder for configurations | link:mod_builder.html[Documentation]
|+org.apache.tamaya.ext:tamaya-resources+ |Provides ant-style resource path resolution |link:mod_resources.html[Documentation]
|+org.apache.tamaya.ext:tamaya-resolver+ |Provides placeholder and dynamic resolution functionality for configuration values. |link:mod_resolver.html[Documentation]
@@ -68,11 +68,23 @@ NOTE All extensions, despite the _tamaya-builder_ module, currently run on Java
|+org.apache.tamaya.ext:tamaya-remote+ |Provides remote configuration support. |link:mod_remote.html[Documentation]
|+org.apache.tamaya.ext:tamaya-server+ |Lets a Tamaya configuration instance provide scoped configuration as a http service. |link:mod_server.html[Documentation]
|+org.apache.tamaya.ext:tamaya-optional+ |Lets a Tamaya configuration to be used as an optional project extension only. |link:mod_optional.html[Documentation]
-|+org.apache.tamaya.ext:tamaya-classloader-support+ |Manages Tamaya configuration and services considering classloading hierarchies. |link:mod_classloader_support.html[Documentation]
-|+org.apache.tamaya.ext:tamaya-cdi+ |Tamaya integration modules for CDI. |link:mod_cdi.html[Documentation]
+|+org.apache.tamaya.ext:tamaya-classloader-support+ |Manages Tamaya configuration and services considering classloading hierarchies. |link:mod_classloader_support.html[Documentation]
|+org.apache.tamaya.ext:tamaya-spi-support+ |Tamaya support module for SPI implementation. |link:mod_spi-support.html[Documentation]
|=======
+== Integrations
+
+These extensions integrate/bridge Tamayas functionality with other frameworks turning their configuration capabilities
+from a sledgehammer to a scalpell:
+
+[width="100%",frame="1",options="header",grid="all"]
+|=======
+|_Artifact_ |_Description_ |_Links_
+|+org.apache.tamaya.ext:tamaya-cdi+ | Java EE/standalone compliant CDI integration | link:mod_cdi.html[Documentation]
+|+org.apache.tamaya.ext:tamaya-camel+ | Integration for Apache Camel. | link:mod_camel.html[Documentation]
+|+org.apache.tamaya.ext:tamaya-spring+ | Integration for Spring / Spring Boot. | link:mod_spring.html[Documentation]
+|=======
+
== Extensions in Experimental Stage
@@ -81,8 +93,28 @@ very carefully and especially give us feedback, so we can improve them before pr
[width="100%",frame="1",options="header",grid="all"]
|=======
-|_Artifact_ |_Description_ |_Links_
-|+org.apache.tamaya.ext:tamaya-jodatime+ |Provides support for JodaTime. | link:mod_jodatime.html[Documentation]
-|+org.apache.tamaya.ext:tamaya-cdi+ |Java EE compliant CDI extension for Tamaya. |link:mod_cdi.html[Documentation]
+|_Artifact_ |_Description_ |_Links_
+|+org.apache.tamaya.ext:tamaya-jodatime+ |Provides support for JodaTime. | link:mod_jodatime.html[Documentation]
|+org.apache.tamaya.ext:tamaya-staged+ |Simple configuration extension to add staged config. |link:mod_metamodel-staged.html[Documentation]
+|+org.apache.tamaya.ext:tamaya-collections+ |Collections support. | -
+|+org.apache.tamaya.ext:tamaya-ui+ |JSF based UI for Managing Configuration. | -
+|=======
+
+
+== Integrations in Experimental Stage
+
+Integrations in _experimental mode_ may still be under discussions. API changes may still happen, so use them
+very carefully and especially give us feedback, so we can improve them before progressing to _draft_ state.
+
+[width="100%",frame="1",options="header",grid="all"]
+|=======
+|_Artifact_ |_Description_ |_Links_
+|+org.apache.tamaya.ext:tamaya-osgi-felix+ |Provides support for Apache Felix PersistenceManager SPI. | -
+|+org.apache.tamaya.ext:tamaya-osgi-general+ |Provides support for implementing the OSGI ConfigAdmin service. | -
+|+org.apache.tamaya.ext:tamaya-osgi-injection+ |Provides support for configuration injection into services. | -
+|+org.apache.tamaya.ext:tamaya-store+ |SPI for writing configuration. | -
+|+org.apache.tamaya.ext:tamaya-store-file+ |Store SPI implementation using file storage. | -
+|+org.apache.tamaya.ext:tamaya-store-hazelcast+ |Store SPI implementation using a Hazelcast Datagrid. | -
+|+org.apache.tamaya.ext:tamaya-store-ignite+ |Store SPI implementation using Apache Ignite. | -
+|+org.apache.tamaya.ext:tamaya-commons+ |Integration with Apache Commons Configuration. | -
|=======
http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2d7957f5/src/site/asciidoc/extensions/mod_camel.adoc
----------------------------------------------------------------------
diff --git a/src/site/asciidoc/extensions/mod_camel.adoc b/src/site/asciidoc/extensions/mod_camel.adoc
new file mode 100644
index 0000000..2042abf
--- /dev/null
+++ b/src/site/asciidoc/extensions/mod_camel.adoc
@@ -0,0 +1,161 @@
+= Apache Tamaya -- Extension: Integration with Apache Camel
+
+:name: Tamaya
+:rootpackage: org.apache.tamaya.integration.camel
+:title: Apache Tamaya Extension: Integration with Apache Camel
+:revdate: December 2015
+:authorinitials: ATR
+:author: Anatole Tresch
+:email: <an...@apache.org>
+:source-highlighter: coderay
+:website: http://tamaya.incubator.apache.org/
+:toc:
+:toc-placement: manual
+:encoding: UTF-8
+:numbered:
+// 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.
+'''
+
+<<<
+
+toc::[]
+
+<<<
+:numbered!:
+<<<
+[[Optional]]
+== Integration with Apache Camel (Extension Module)
+=== Overview
+
+The Tamaya Camel integration module provides different artifacts which allows integration of Apachae Tamaya
+configuration with Apache Camel.
+
+
+=== Compatibility
+
+The module is based on Java 7, so it will not run on Java 7 and beyond.
+
+
+=== Installation
+
+To benefit from configuration builder support you only must add the corresponding dependency to your module:
+
+[source, xml]
+-----------------------------------------------
+<dependency>
+ <groupId>org.apache.tamaya.ext</groupId>
+ <artifactId>tamaya-camel</artifactId>
+ <version>{tamayaVersion}</version>
+</dependency>
+-----------------------------------------------
+
+
+=== The Extensions Provided
+
+Camel integration comes basically with three artifacts:
+
+* A Camel +ResolverFunction+ implementation adding explicit property resolution
+ (+org.apache.tamaya.integration.camel.TamayaPropertyResolver+).
+* A Camel +PropertiesComponent+ implementation, which allows implicitly preconfigures the resolvers from above and
+ additionally allows using Tamaya configuration as Camel _overrides_
+ (+org.apache.tamaya.integration.camel.TamayaPropertiesComponent+).
+
+
+=== Configuring using Camel Java DSL
+
+Camel integration using Java DSL is basically simple:
+
+[source, java]
+-----------------------------------------------
+import org.apache.tamaya.integration.camel.TamayaPropertiesComponent;
+
+camelContext.addComponent("properties", new TamayaPropertiesComponent());
+-----------------------------------------------
+
+Given so you can then use +cfg+ or +tamaya+ as prefix for resolving entries with Tamaya as follows:
+
+[source, java]
+-----------------------------------------------
+RouteBuilder builder = new RouteBuilder() {
+ public void configure() {
+ from("direct:hello1").transform().simple("{{cfg:message}}");
+ }
+};
+camelContext.addRoutes(builder);
+builder = new RouteBuilder() {
+ public void configure() {
+ from("direct:hello2").transform().simple("{{tamaya:message}}");
+ }
+};
+camelContext.addRoutes(builder);
+-----------------------------------------------
+
+
+Optionally you can also configure +TamayaPropertiesComponent+ that all currently known Tamaya properties are used
+as Camel overrides, meaning they are evaluated prior to all other available resolver functions in the Camel
++PropertiesComponent+:
+
+[source, java]
+-----------------------------------------------
+TamayaPropertiesComponent props = new TamayaPropertiesComponent();
+props.setTamayaOverrides(true);
+-----------------------------------------------
+
+
+=== Configuring using Camel XML DSL
+
+Camel integration using XML DSL is basically very similar. You just have to add the +properties+ component as bean
+as well. All other configuration parameters (e.g. file URIs are similar supported). In the example code below we
+again use Tamaya as the main configuration solutions only using Camel's default behaviour as a fallback:
+
+[source, xml]
+-----------------------------------------------
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
+ ">
+
+ <routeContext id="myCoolRoutes" xmlns="http://camel.apache.org/schema/spring">
+ <route id="r1">
+ <from uri="direct:hello1"/>
+ <transform>
+ <simple>{{message}}</simple>
+ </transform>
+ </route>
+ <route id="r2">
+ <from uri="direct:hello2"/>
+ <transform>
+ <simple>{{cfg:message}}</simple>
+ </transform>
+ </route>
+ <route id="r3">
+ <from uri="direct:hello3"/>
+ <transform>
+ <simple>{{tamaya:message}}</simple>
+ </transform>
+ </route>
+ </routeContext>
+
+ <bean id="properties" class="org.apache.tamaya.integration.camel.TamayaPropertiesComponent">
+ <property name="tamayaOverrides" value="true"/>
+ </bean>
+
+</beans>
+-----------------------------------------------
\ No newline at end of file