http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/extensions/mod_server.html ---------------------------------------------------------------------- diff --git a/extensions/mod_server.html b/extensions/mod_server.html new file mode 100644 index 0000000..30c58f1 --- /dev/null +++ b/extensions/mod_server.html @@ -0,0 +1,559 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="utf-8"/> + <title>Apache Tamaya&#8201;&#8212;&#8201;Extension: Configuration Server</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="description" content=""/> + <meta name="author" content=""/> + <meta name="keywords" content=""/> + <meta name="generator" content="'JBake '+'${version}"/> + + <!-- Le styles --> + <link href="../css/bootstrap.min.css" rel="stylesheet"/> + <link href="../css/asciidoctor.css" rel="stylesheet"/> + <link href="../css/base.css" rel="stylesheet"/> + <link href="../css/prettify.css" rel="stylesheet"/> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="../js/html5shiv.min.js"></script> + <![endif]--> + + <!-- Fav and touch icons from ASF --> + <link rel="shortcut icon" href="../favicon.ico"/> + <link rel="apple-touch-icon" sizes="57x57" href="../favicons/apple-touch-icon-57x57.png"/> + <link rel="apple-touch-icon" sizes="60x60" href="../favicons/apple-touch-icon-60x60.png"/> + <link rel="apple-touch-icon" sizes="72x72" href="../favicons/apple-touch-icon-72x72.png"/> + <link rel="apple-touch-icon" sizes="76x76" href="../favicons/apple-touch-icon-76x76.png"/> + <link rel="apple-touch-icon" sizes="114x114" href="../favicons/apple-touch-icon-114x114.png"/> + <link rel="apple-touch-icon" sizes="120x120" href="../favicons/apple-touch-icon-120x120.png"/> + <link rel="apple-touch-icon" sizes="144x144" href="../favicons/apple-touch-icon-144x144.png"/> + <link rel="apple-touch-icon" sizes="152x152" href="../favicons/apple-touch-icon-152x152.png"/> + <link rel="apple-touch-icon" sizes="180x180" href="../favicons/apple-touch-icon-180x180.png"/> + <link rel="icon" type="image/png" href="../favicons/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="../favicons/favicon-194x194.png" sizes="194x194"/> + <link rel="icon" type="image/png" href="../favicons/favicon-96x96.png" sizes="96x96"/> + <link rel="icon" type="image/png" href="../favicons/android-chrome-192x192.png" sizes="192x192"/> + <link rel="icon" type="image/png" href="../favicons/favicon-16x16.png" sizes="16x16"/> + <link rel="manifest" href="../favicons/manifest.json"/> + <link rel="shortcut icon" href="../favicons/favicon.ico"/> + <meta name="msapplication-TileColor" content="#603cba"/> + <meta name="msapplication-TileImage" content="../favicons/mstile-144x144.png"/> + <meta name="msapplication-config" content="../favicons/browserconfig.xml"/> + <meta name="theme-color" content="#303284"/> + </head> + <body onload="prettyPrint()"> + <div id="wrap"> + <div> + + <!-- Fixed navbar --> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../">Apache Tamaya (incubating)</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li><a href="../index.html">Home</a></li> + <li><a href="../quickstart.html">Quickstart</a></li> + <li><a href="../index.html">Documentation</a></li> + <li><a href="..//apidocs/index.html">API</a></li> + <li><a href="../index.html">Development</a></li> + <li><a href="../index.html">Releases</a></li> + <li><a href="../about.html">About</a></li> + <li><a href="../sitemap.xml">Sitemap</a></li> + <li><a href="../feed.xml">Subscribe</a></li> +<!-- + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Action</a></li> + <li><a href="#">Another action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"></li> + <li class="dropdown-header">Nav header</li> + <li><a href="#">Separated link</a></li> + <li><a href="#">One more separated link</a></li> + </ul> + </li> +--> + </ul> + </div><!--/.nav-collapse --> + </div> + </div> + + </div> + <div class="container"> + + <div class="page-header"> + <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Configuration Server</h1> + </div> + + <p><em>2016-10-31</em></p> + + <p><div id="preamble"> +<div class="sectionbody"> +<!-- toc disabled --> +</div> +</div> +<div class="sect1"> +<h2 id="Remote">Tamaya Configuration Server (Extension Module)</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_overview">Overview</h3> +<div class="paragraph"> +<p>The Tamaya server module provides support for providing scoped configuration using a http server serving JSON formatted +configuration properties.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_compatibility">Compatibility</h3> +<div class="paragraph"> +<p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_installation">Installation</h3> +<div class="paragraph"> +<p>To benefit from configuration server support you only must add the corresponding dependency to your module:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <groupId>org.apache.tamaya.ext</groupId> + <artifactId>tamaya-server</artifactId> + <version>{tamayaVersion}</version> +</dependency></code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_providing_configuration_using_the_tamaya_built_in_configuration_server">Providing configuration using the Tamaya Built-in Configuration Server</h3> +<div class="paragraph"> +<p>THe most simple way for providing onfiguration ist to start the internal server:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Server server = org.apache.tamaya.server.ConfigServer.createServer(); +server.start(port);</code></pre> +</div> +</div> +<div class="paragraph"> +<p>This will start a simple server instance that serves the following URL patterns:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>GET /config provides access to the full configuration tree.</p> +</li> +<li> +<p>GET /config/filtered/${path} let you filter the configuration returned using regular expression (comma separated). +E.g. /config/filtered/java,sun will return all configuration entries starting with <em>java</em> and <em>sun</em>.</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>Additionally the server module has the following options implemented, which can be passed as additional, optional +parameters:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>format allows to define the target format. By default the ACCEPT header of the http request is checked, but this +setting can be explicitly controlled by passing tis parameter explicitly. The value is the expected MIME type to be +returned. By default the service supports the following types (refer to the SPI section later in this document for +options to adapt this):</p> +<div class="ulist"> +<ul> +<li> +<p>text/html</p> +</li> +<li> +<p>text/plain</p> +</li> +<li> +<p>application/xml</p> +</li> +<li> +<p>text/json</p> +</li> +</ul> +</div> +</li> +<li> +<p>scope,scopeId allows to use a server-side preconfigured filter/combination policy to be applied for +evaluating the entries to be returned. Hereby the scopeId paramter allows to address a certain scope. +As an example think of a scope ?scope=CLIENT&scopeId=client1 to be passed as request parameters. This +tells the server module to lookup a configured scope named 'CLIENT' and access a ConfigOperator for the +given scopeId 'client1'. The returned operator then can filter and combine any kind of entries to the +required client configuration (for client1). Refer to the scopes section for more details.</p> +</li> +</ul> +</div> +</div> +<div class="sect2"> +<h3 id="_using_the_configuration_servlets">Using the Configuration Servlets</h3> +<div class="paragraph"> +<p>Additionally to the fully built-in solution, it is also possible to integrate the Tamaya server module with a standard +Java EE servlet container. Tamaya provides 2 servlet implementations:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>the servlet org.apache.tamaya.server.FilteredConfigServlet can be used to register access to configurations +that also support filtering of the keys. The URL looks like</p> +</li> +</ul> +</div> +<div class="listingblock"> +<div class="content"> +<pre>http(s)://HOST/SERVLET_CONTEXT/PATHS?params + +where + HOST = host name incl port, e.g. 127.0.0.2:234 + SERVLET_CONTEXT = the base context and servlet context, e.g. /client/config/filtered + PATHS = A comma separated number of key paths to be filtered for being returned, e.g. + java,sun,client + params = the optional parameters (scope, scopeId and format)</pre> +</div> +</div> +<div class="ulist"> +<ul> +<li> +<p>the servlet org.apache.tamaya.server.FullConfigServlet can be used to register access to configurations +that alwyas returns all items known. The URL looks like</p> +</li> +</ul> +</div> +<div class="listingblock"> +<div class="content"> +<pre>http(s)://HOST/SERVLET_CONTEXT?params + +where + HOST = host name incl port, e.g. 127.0.0.2:234 + SERVLET_CONTEXT = the base context and servlet context, e.g. /client/config/filtered + params = the optional parameters (scope, scopeId and format)</pre> +</div> +</div> +<div class="sect3"> +<h4 id="_formatting_used_by_default">Formatting used by Default</h4> +<div class="paragraph"> +<p>The server module formats the configuration returned by default in thw following variants:</p> +</div> +<div class="listingblock"> +<div class="title">Formatting for text/json</div> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-json" data-lang="json">{ + "java.vendor.url": "http://java.oracle.com/", + "java.vendor.url.bug": "http://bugreport.sun.com/bugreport/", + "java.vm.info": "mixed mode", + "java.vm.name": "Java HotSpot(TM) 64-Bit Server VM", + "java.vm.specification.name": "Java Virtual Machine Specification", + "java.vm.specification.vendor": "Oracle Corporation", + "java.vm.specification.version": "1.8", + "java.vm.vendor": "Oracle Corporation", + "java.vm.version": "25.45-b02", + "sun.arch.data.model": "64", + "sun.boot.class.path": "C:\apps\jdk18\jre\lib\resources.jar;C:\apps\jdk18\jre\lib\rt.jar;C:\apps\jdk18\jre\lib\sunrsasign.jar;C:\apps\jdk18\jre\lib\jsse.jar;C:\apps\jdk18\jre\lib\jce.jar;C:\apps\jdk18\jre\lib\charsets.jar;C:\apps\jdk18\jre\lib\jfr.jar;C:\apps\jdk18\jre\classes", + "sun.boot.library.path": "C:\apps\jdk18\jre\bin", + "sun.cpu.endian": "little", + "sun.cpu.isalist": "amd64", + "sun.desktop": "windows", + "sun.io.unicode.encoding": "UnicodeLittle", + "sun.java.command": "com.intellij.rt.execution.application.AppMain org.apache.tamaya.examples.remote.server.Start", + "sun.java.launcher": "SUN_STANDARD", + "sun.jnu.encoding": "Cp1252", + "sun.management.compiler": "HotSpot 64-Bit Tiered Compilers", + "sun.os.patch.level": "", + "{meta}class": "org.apache.tamaya.functions.FilteredConfiguration", + "{meta}info.filter": "java.v,sun", + "{meta}info.format": "application/json", + "{meta}info.timestamp": "1441463200571", + "{meta}timestamp": "1441463200571", + "{meta}type": "Configuration" +}</code></pre> +</div> +</div> +<div class="listingblock"> +<div class="title">Formatting for application/xml</div> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><configuration> + <entry key="java.vendor.url">http://java.oracle.com/</entry> + <entry key="java.vendor.url.bug">http://bugreport.sun.com/bugreport/</entry> + <entry key="java.vm.info">mixed mode</entry> + <entry key="java.vm.name">Java HotSpot(TM) 64-Bit Server VM</entry> + <entry key="java.vm.specification.name">Java Virtual Machine Specification</entry> + <entry key="java.vm.specification.vendor">Oracle Corporation</entry> + <entry key="java.vm.specification.version">1.8</entry> + <entry key="java.vm.vendor">Oracle Corporation</entry> + <entry key="java.vm.version">25.45-b02</entry> + <entry key="sun.arch.data.model">64</entry> + <entry key="sun.boot.class.path">C:\apps\jdk18\jre\lib\resources.jar;C:\apps\jdk18\jre\lib\rt.jar;C:\apps\jdk18\jre\lib\sunrsasign.jar;C:\apps\jdk18\jre\lib\jsse.jar;C:\apps\jdk18\jre\lib\jce.jar;C:\apps\jdk18\jre\lib\charsets.jar;C:\apps\jdk18\jre\lib\jfr.jar;C:\apps\jdk18\jre\classes</entry> + <entry key="sun.boot.library.path">C:\apps\jdk18\jre\bin</entry> + <entry key="sun.cpu.endian">little</entry> + <entry key="sun.cpu.isalist">amd64</entry> + <entry key="sun.desktop">windows</entry> + <entry key="sun.io.unicode.encoding">UnicodeLittle</entry> + <entry key="sun.java.command">com.intellij.rt.execution.application.AppMain org.apache.tamaya.examples.remote.server.Start</entry> + <entry key="sun.java.launcher">SUN_STANDARD</entry> + <entry key="sun.jnu.encoding">Cp1252</entry> + <entry key="sun.management.compiler">HotSpot 64-Bit Tiered Compilers</entry> + <entry key="sun.os.patch.level"></entry> + <entry key="{meta}class">org.apache.tamaya.functions.FilteredConfiguration</entry> + <entry key="{meta}info.filter">java.v,sun</entry> + <entry key="{meta}info.format">application/xml</entry> + <entry key="{meta}info.timestamp">1441463383687</entry> + <entry key="{meta}timestamp">1441463383687</entry> + <entry key="{meta}type">Configuration</entry> +</configuration></code></pre> +</div> +</div> +<div class="listingblock"> +<div class="title">Formatting for text/plain</div> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-text" data-lang="text">Configuration: + java.vendor.url: http://java.oracle.com/, + java.vendor.url.bug: http://bugreport.sun.com/bugreport/, + java.vm.info: mixed mode, + java.vm.name: Java HotSpot(TM) 64-Bit Server VM, + java.vm.specification.name: Java Virtual Machine Specification, + java.vm.specification.vendor: Oracle Corporation, + java.vm.specification.version: 1.8, + java.vm.vendor: Oracle Corporation, + java.vm.version: 25.45-b02, + sun.arch.data.model: 64, + sun.boot.class.path: C:\apps\jdk18\jre\lib\resources.jar;C:\apps\jdk18\jre\lib\rt.jar;C:\apps\jdk18\jre\lib\sunrsasign.jar;C:\apps\jdk18\jre\lib\jsse.jar;C:\apps\jdk18\jre\lib\jce.jar;C:\apps\jdk18\jre\lib\charsets.jar;C:\apps\jdk18\jre\lib\jfr.jar;C:\apps\jdk18\jre\classes, + sun.boot.library.path: C:\apps\jdk18\jre\bin, + sun.cpu.endian: little, + sun.cpu.isalist: amd64, + sun.desktop: windows, + sun.io.unicode.encoding: UnicodeLittle, + sun.java.command: com.intellij.rt.execution.application.AppMain org.apache.tamaya.examples.remote.server.Start, + sun.java.launcher: SUN_STANDARD, + sun.jnu.encoding: Cp1252, + sun.management.compiler: HotSpot 64-Bit Tiered Compilers, + sun.os.patch.level: , + {meta}class: org.apache.tamaya.functions.FilteredConfiguration, + {meta}info.filter: java.v,sun, + {meta}info.format: text/plain, + {meta}info.timestamp: 1441463082020, + {meta}timestamp: 1441463082021, + {meta}type: Configuration</code></pre> +</div> +</div> +<div class="listingblock"> +<div class="title">Formatting for application/html</div> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-html" data-lang="html"><html> +<head><title>System Configuration</title></head> +<body> +<h1>Sysem Configuration</h1> +<p>This view shows the system configuration of devbox-win at Sat Sep 05 16:30:59 CEST 2015.</p><pre> +Configuration: + java.vendor.url: http://java.oracle.com/, + java.vendor.url.bug: http://bugreport.sun.com/bugreport/, + java.vm.info: mixed mode, + java.vm.name: Java HotSpot(TM) 64-Bit Server VM, + java.vm.specification.name: Java Virtual Machine Specification, + java.vm.specification.vendor: Oracle Corporation, + java.vm.specification.version: 1.8, + java.vm.vendor: Oracle Corporation, + java.vm.version: 25.45-b02, + sun.arch.data.model: 64, + sun.boot.class.path: C:\apps\jdk18\jre\lib\resources.jar;C:\apps\jdk18\jre\lib\rt.jar;C:\apps\jdk18\jre\lib\sunrsasign.jar;C:\apps\jdk18\jre\lib\jsse.jar;C:\apps\jdk18\jre\lib\jce.jar;C:\apps\jdk18\jre\lib\charsets.jar;C:\apps\jdk18\jre\lib\jfr.jar;C:\apps\jdk18\jre\classes, + sun.boot.library.path: C:\apps\jdk18\jre\bin, + sun.cpu.endian: little, + sun.cpu.isalist: amd64, + sun.desktop: windows, + sun.io.unicode.encoding: UnicodeLittle, + sun.java.command: com.intellij.rt.execution.application.AppMain org.apache.tamaya.examples.remote.server.Start, + sun.java.launcher: SUN_STANDARD, + sun.jnu.encoding: Cp1252, + sun.management.compiler: HotSpot 64-Bit Tiered Compilers, + sun.os.patch.level: , + {meta}class: org.apache.tamaya.functions.FilteredConfiguration, + {meta}info.filter: java.v,sun, + {meta}info.format: text/html, + {meta}info.timestamp: 1441463459653, + {meta}timestamp: 1441463459654, + {meta}type: Configuration + +</pre> +</body> +</html></code></pre> +</div> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_spi">SPI</h3> +<div class="sect3"> +<h4 id="_scopes">Scopes</h4> +<div class="paragraph"> +<p>As mentioned earlier in this document scopes can be used to define the exact configuration tree to be returned, e.g. +as a result of combining multiple sub trees. Following an example of the code to be written to return a configuration +that combines common client default entries with client specific entries:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public class ClientScopeProvider implements ScopeProvider{ + + /** + * Access the unique scope name. + * @return the unique scope name. + */ + public String getScopeType(){ + return "CLIENT"; + } + + @Override + public ConfigOperator getScope(String scopeId) { + return c -> + ConfigurationFunctions.combine("Scoped Config CLIENT="+scopeId, + c.with(ConfigurationFunctions.sectionRecursive(true, "client.default")), + c.with(ConfigurationFunctions.sectionRecursive(true, "client." + scopeId)) + ); + } +}</code></pre> +</div> +</div> +<div class="paragraph"> +<p>This class can be registered using the ServiceContext in place. By default the ServiceLoader is used, so you will +have to add the following to META-INF/services/org.apache.tamaya.server.spi.ScopeProvider:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">my.full.packagename.ClientScopeProvider</code></pre> +</div> +</div> +</div> +<div class="sect3"> +<h4 id="_adapting_the_way_configuration_is_derived">Adapting the Way Configuration is Derived</h4> +<div class="paragraph"> +<p>Finally the effective readong and configuration handling logic can also be replaced or improved. This can be +done by registering your own implementation of the interface ConfigProviderService:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ConfigProviderService { + String getConfigurationWithPath(String path, String format, String scope, String scopeId, HttpServletRequest request); + String getConfiguration(String format, String scope, String scopeId, HttpServletRequest request); + void updateConfiguration(String payload, HttpServletRequest request); + void deleteConfiguration(String paths, HttpServletRequest request); +}</code></pre> +</div> +</div> +<div class="paragraph"> +<p>By default the ServiceContextManager uses the java.util.ServiceLoader for component loading, so to replace the +default server code you must register a higher @Priority implementation.</p> +</div> +</div> +<div class="sect3"> +<h4 id="_replacing_the_built_in_server">Replacing the Built-In Server</h4> +<div class="paragraph"> +<p>We have seen earlier that starting a configuration server is pretty easy:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Server server = org.apache.tamaya.server.ConfigServer.createServer(); +server.start(port);</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Nevertheless one may want to replace the used implementation of Server. This can be done easily by simply +registering an overriding implementation if the corresponding interface:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface Server { + void start(int port); + boolean isStarted(); + void stop(); + void destroy(); +}</code></pre> +</div> +</div> +</div> +<div class="sect3"> +<h4 id="_the_scopemanager_singleton">The ScopeManager Singleton</h4> +<div class="paragraph"> +<p>Finally whe implementing your own server, you might also benefit from the ScopeManager singleton. Basically this +class loads all registered ScopeProvider and manages the configured scope instances:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class ScopeManager { + ... + + private ScopeManager(){} + + /** + * Get the scope given its name. + * @param scopeId the scope name + * @return the scope matching + * @throws ConfigException, if nos such scope is defined. + */ + public static ConfigOperator getScope(String scopeId, String target); + + /** + * Get the defined scope names. + * @return the defined scope names, never null. + */ + public static Set<String> getScopes(); + +}</code></pre> +</div> +</div> +</div> +</div> +</div> +</div></p> + + <hr /> + </div> + </div> + <div> + <div id="push"></div> + + <div id="footer"> + <div class="container"> + <p class="muted credit">© 2014-2016 Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> + | Baked with <a href="http://jbake.org">JBake <span>v2.5.0</span></a> + at <span>2016-10-31</span> + </p> + <p> + <b>Disclaimer</b> + Apache Tamaya (incubating) is an effort undergoing + incubation at + The Apache Software Foundation (ASF), sponsored by + the name of Apache Incubator. Incubation is required of + all newly accepted projects until a further review indicates + that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other + successful ASF projects. While incubation status is not + necessarily a reflection of the completeness or stability of + the code, it does indicate that the project has yet to + be fully endorsed by the ASF.<br /> + <a href="http://incubator.apache.org/guides/website.html" style="border:0px;" target="_target"><img class="incubator-logo" src="../logos/egg-logo2.png"/></a> + </p> + </div> + </div> + + <!-- Le javascript + ================================================== --> + <!-- Placed at the end of the document so the pages load faster --> + <script src="../js/jquery-1.11.1.min.js"></script> + <script src="../js/bootstrap.min.js"></script> + <script src="../js/prettify.js"></script> + + </div> + </body> +</html>
http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/extensions/mod_spi-support.html ---------------------------------------------------------------------- diff --git a/extensions/mod_spi-support.html b/extensions/mod_spi-support.html new file mode 100644 index 0000000..e6a7c4d --- /dev/null +++ b/extensions/mod_spi-support.html @@ -0,0 +1,221 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="utf-8"/> + <title>Apache Tamaya&#8201;&#8212;&#8201;Extension: Classloader Isolation Support</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="description" content=""/> + <meta name="author" content=""/> + <meta name="keywords" content=""/> + <meta name="generator" content="'JBake '+'${version}"/> + + <!-- Le styles --> + <link href="../css/bootstrap.min.css" rel="stylesheet"/> + <link href="../css/asciidoctor.css" rel="stylesheet"/> + <link href="../css/base.css" rel="stylesheet"/> + <link href="../css/prettify.css" rel="stylesheet"/> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="../js/html5shiv.min.js"></script> + <![endif]--> + + <!-- Fav and touch icons from ASF --> + <link rel="shortcut icon" href="../favicon.ico"/> + <link rel="apple-touch-icon" sizes="57x57" href="../favicons/apple-touch-icon-57x57.png"/> + <link rel="apple-touch-icon" sizes="60x60" href="../favicons/apple-touch-icon-60x60.png"/> + <link rel="apple-touch-icon" sizes="72x72" href="../favicons/apple-touch-icon-72x72.png"/> + <link rel="apple-touch-icon" sizes="76x76" href="../favicons/apple-touch-icon-76x76.png"/> + <link rel="apple-touch-icon" sizes="114x114" href="../favicons/apple-touch-icon-114x114.png"/> + <link rel="apple-touch-icon" sizes="120x120" href="../favicons/apple-touch-icon-120x120.png"/> + <link rel="apple-touch-icon" sizes="144x144" href="../favicons/apple-touch-icon-144x144.png"/> + <link rel="apple-touch-icon" sizes="152x152" href="../favicons/apple-touch-icon-152x152.png"/> + <link rel="apple-touch-icon" sizes="180x180" href="../favicons/apple-touch-icon-180x180.png"/> + <link rel="icon" type="image/png" href="../favicons/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="../favicons/favicon-194x194.png" sizes="194x194"/> + <link rel="icon" type="image/png" href="../favicons/favicon-96x96.png" sizes="96x96"/> + <link rel="icon" type="image/png" href="../favicons/android-chrome-192x192.png" sizes="192x192"/> + <link rel="icon" type="image/png" href="../favicons/favicon-16x16.png" sizes="16x16"/> + <link rel="manifest" href="../favicons/manifest.json"/> + <link rel="shortcut icon" href="../favicons/favicon.ico"/> + <meta name="msapplication-TileColor" content="#603cba"/> + <meta name="msapplication-TileImage" content="../favicons/mstile-144x144.png"/> + <meta name="msapplication-config" content="../favicons/browserconfig.xml"/> + <meta name="theme-color" content="#303284"/> + </head> + <body onload="prettyPrint()"> + <div id="wrap"> + <div> + + <!-- Fixed navbar --> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../">Apache Tamaya (incubating)</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li><a href="../index.html">Home</a></li> + <li><a href="../quickstart.html">Quickstart</a></li> + <li><a href="../index.html">Documentation</a></li> + <li><a href="..//apidocs/index.html">API</a></li> + <li><a href="../index.html">Development</a></li> + <li><a href="../index.html">Releases</a></li> + <li><a href="../about.html">About</a></li> + <li><a href="../sitemap.xml">Sitemap</a></li> + <li><a href="../feed.xml">Subscribe</a></li> +<!-- + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Action</a></li> + <li><a href="#">Another action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"></li> + <li class="dropdown-header">Nav header</li> + <li><a href="#">Separated link</a></li> + <li><a href="#">One more separated link</a></li> + </ul> + </li> +--> + </ul> + </div><!--/.nav-collapse --> + </div> + </div> + + </div> + <div class="container"> + + <div class="page-header"> + <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Classloader Isolation Support</h1> + </div> + + <p><em>2016-10-31</em></p> + + <p><div id="preamble"> +<div class="sectionbody"> +<!-- toc disabled --> +</div> +</div> +<div class="sect1"> +<h2 id="SPISupport">Tamaya SPI Support (Extension Module)</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_overview">Overview</h3> +<div class="paragraph"> +<p>The Tamaya SPI support module provides a few helpful base classes that can be used to implement some of the often +used SPI parts in Tamaya:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>BasePropertySource provides an abstract base class for implementation of your own PropertySources.</p> +</li> +<li> +<p>DefaultConfiguration provides you with a simple implementation of the Configuration interface based on a +ConfigurationContext provided. This is also very useful for mocking configuration during test execution, but +not only constraint to that use case.</p> +</li> +<li> +<p>DefaultConfigurationContext provides you with a working implementation of the ConfigurationContext.</p> +</li> +<li> +<p>EnumConverter is a converter implementation that can automatically select the currect enumeration values based +on a configured entry.</p> +</li> +<li> +<p>MapPropertySource implements a static property source based on java.util.Map.</p> +</li> +<li> +<p>PriorityServiceComparator compares arbitrary services based on their @Priority annotations (also handling the +case, where no such annotation is present).</p> +</li> +<li> +<p>PropertiesResourcePropertySource is an implementation of a PropertySource based on a Properties instance, + lodable from any URL. ++ PropertyConverterManager is a service class very useful, when implementing instances of ConfigurationContext. + It manages registered instances of PropertyConverter and provides easy to use type conversion logic. ++ PropertyFiltering provides another helpful class that manages PropertyFilter instances and provides an + easy to use high level API. ++ PropertySourceComparator provides an implementation that compares PropertySources based on their getOrdinal() + values and their class names.</p> +</li> +</ul> +</div> +</div> +<div class="sect2"> +<h3 id="_compatibility">Compatibility</h3> +<div class="paragraph"> +<p>The module is based on Java 7, so it will not run on Java 7 and beyond.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_installation">Installation</h3> +<div class="paragraph"> +<p>To benefit from Tamaya CDI integration you only must add the corresponding dependency to your module:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <groupId>org.apache.tamaya.ext</groupId> + <artifactId>tamaya-spisupport</artifactId> + <version>{tamayaVersion}</version> +</dependency></code></pre> +</div> +</div> +<div class="paragraph"> +<p>The component will not register any components but only providing portable base classes for some common SPI +implementation tasks. It only depends on the API, so it should be safely reusable also with other implementations +of the Tamaya API similarly.</p> +</div> +</div> +</div> +</div></p> + + <hr /> + </div> + </div> + <div> + <div id="push"></div> + + <div id="footer"> + <div class="container"> + <p class="muted credit">© 2014-2016 Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> + | Baked with <a href="http://jbake.org">JBake <span>v2.5.0</span></a> + at <span>2016-10-31</span> + </p> + <p> + <b>Disclaimer</b> + Apache Tamaya (incubating) is an effort undergoing + incubation at + The Apache Software Foundation (ASF), sponsored by + the name of Apache Incubator. Incubation is required of + all newly accepted projects until a further review indicates + that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other + successful ASF projects. While incubation status is not + necessarily a reflection of the completeness or stability of + the code, it does indicate that the project has yet to + be fully endorsed by the ASF.<br /> + <a href="http://incubator.apache.org/guides/website.html" style="border:0px;" target="_target"><img class="incubator-logo" src="../logos/egg-logo2.png"/></a> + </p> + </div> + </div> + + <!-- Le javascript + ================================================== --> + <!-- Placed at the end of the document so the pages load faster --> + <script src="../js/jquery-1.11.1.min.js"></script> + <script src="../js/bootstrap.min.js"></script> + <script src="../js/prettify.js"></script> + + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/extensions/mod_spring.html ---------------------------------------------------------------------- diff --git a/extensions/mod_spring.html b/extensions/mod_spring.html new file mode 100644 index 0000000..b157e6d --- /dev/null +++ b/extensions/mod_spring.html @@ -0,0 +1,308 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="utf-8"/> + <title>Apache Tamaya&#8201;&#8212;&#8201;Extension: Spring Integration</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="description" content=""/> + <meta name="author" content=""/> + <meta name="keywords" content=""/> + <meta name="generator" content="'JBake '+'${version}"/> + + <!-- Le styles --> + <link href="../css/bootstrap.min.css" rel="stylesheet"/> + <link href="../css/asciidoctor.css" rel="stylesheet"/> + <link href="../css/base.css" rel="stylesheet"/> + <link href="../css/prettify.css" rel="stylesheet"/> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="../js/html5shiv.min.js"></script> + <![endif]--> + + <!-- Fav and touch icons from ASF --> + <link rel="shortcut icon" href="../favicon.ico"/> + <link rel="apple-touch-icon" sizes="57x57" href="../favicons/apple-touch-icon-57x57.png"/> + <link rel="apple-touch-icon" sizes="60x60" href="../favicons/apple-touch-icon-60x60.png"/> + <link rel="apple-touch-icon" sizes="72x72" href="../favicons/apple-touch-icon-72x72.png"/> + <link rel="apple-touch-icon" sizes="76x76" href="../favicons/apple-touch-icon-76x76.png"/> + <link rel="apple-touch-icon" sizes="114x114" href="../favicons/apple-touch-icon-114x114.png"/> + <link rel="apple-touch-icon" sizes="120x120" href="../favicons/apple-touch-icon-120x120.png"/> + <link rel="apple-touch-icon" sizes="144x144" href="../favicons/apple-touch-icon-144x144.png"/> + <link rel="apple-touch-icon" sizes="152x152" href="../favicons/apple-touch-icon-152x152.png"/> + <link rel="apple-touch-icon" sizes="180x180" href="../favicons/apple-touch-icon-180x180.png"/> + <link rel="icon" type="image/png" href="../favicons/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="../favicons/favicon-194x194.png" sizes="194x194"/> + <link rel="icon" type="image/png" href="../favicons/favicon-96x96.png" sizes="96x96"/> + <link rel="icon" type="image/png" href="../favicons/android-chrome-192x192.png" sizes="192x192"/> + <link rel="icon" type="image/png" href="../favicons/favicon-16x16.png" sizes="16x16"/> + <link rel="manifest" href="../favicons/manifest.json"/> + <link rel="shortcut icon" href="../favicons/favicon.ico"/> + <meta name="msapplication-TileColor" content="#603cba"/> + <meta name="msapplication-TileImage" content="../favicons/mstile-144x144.png"/> + <meta name="msapplication-config" content="../favicons/browserconfig.xml"/> + <meta name="theme-color" content="#303284"/> + </head> + <body onload="prettyPrint()"> + <div id="wrap"> + <div> + + <!-- Fixed navbar --> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../">Apache Tamaya (incubating)</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li><a href="../index.html">Home</a></li> + <li><a href="../quickstart.html">Quickstart</a></li> + <li><a href="../index.html">Documentation</a></li> + <li><a href="..//apidocs/index.html">API</a></li> + <li><a href="../index.html">Development</a></li> + <li><a href="../index.html">Releases</a></li> + <li><a href="../about.html">About</a></li> + <li><a href="../sitemap.xml">Sitemap</a></li> + <li><a href="../feed.xml">Subscribe</a></li> +<!-- + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Action</a></li> + <li><a href="#">Another action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"></li> + <li class="dropdown-header">Nav header</li> + <li><a href="#">Separated link</a></li> + <li><a href="#">One more separated link</a></li> + </ul> + </li> +--> + </ul> + </div><!--/.nav-collapse --> + </div> + </div> + + </div> + <div class="container"> + + <div class="page-header"> + <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Spring Integration</h1> + </div> + + <p><em>2016-10-31</em></p> + + <p><div id="preamble"> +<div class="sectionbody"> +<!-- toc disabled --> +</div> +</div> +<div class="sect1"> +<h2 id="Remote">Tamaya Spring Integration (Extension Module)</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_overview">Overview</h3> +<div class="paragraph"> +<p>Apache Tamaya currently provides two implementations also full integration for Spring:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>A Spring @Configuration implementation that also provides a Tamaya based version of +org.springframework.context.support.PropertySourcesPlaceholderConfigurer.</p> +</li> +<li> +<p>org.apache.tamaya.integration.spring.TamayaEnvironment is the Tamaya based implementation of the Spring +Environment interface.</p> +</li> +<li> +<p>TamayaSpringPropertySource implements an additional Spring PropertySource.</p> +</li> +<li> +<p>Finally org.apache.tamaya.integration.spring.SpringConfigInjectionPostProcessor implements a Bean PostProcessor, +which adds all the full fledged Tamaya configuration capabilities to Spring.</p> +</li> +</ul> +</div> +</div> +<div class="sect2"> +<h3 id="_compatibility">Compatibility</h3> +<div class="paragraph"> +<p>Both modules are based on Java 7, so they will not run on Java 7 and beyond. The extension shown here works similarly +with Spring Framework as well as Spring Boot.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_installation">Installation</h3> +<div class="paragraph"> +<p>To benefit from Tamaya Spring integration you only must one of the following dependencies to your module:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <groupId>org.apache.tamaya.ext</groupId> + <artifactId>tamaya-spring</artifactId> + <version>{tamayaVersion}</version> +</dependency></code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_registering_tamaya_spring_configuration">Registering Tamaya Spring Configuration</h3> +<div class="paragraph"> +<p>Basically to activate the Tamaya Spring support the most simple thing is to a enable the Tamaya package for being +scanned for Spring components, e.g.</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> + + <context:annotation-config /> + <context:component-scan base-package="org.apache.tamaya.integration.spring"/> + + ... + +</beans></code></pre> +</div> +</div> +<div class="admonitionblock note"> +<table> +<tr> +<td class="icon"> +<div class="title">Note</div> +</td> +<td class="content"> +Of course you can also use the newer @ComponentScan annotation as described by the Spring documentation. +</td> +</tr> +</table> +</div> +<div class="paragraph"> +<p>Similarly if you dont want to use component scanning you can configure things using plain old XML. Simply add the +following lines somewhere into one of your application context configuration files.</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><bean id="tamayaInjectionProcessor" name="tamayaInjectionProcessor" class="org.apache.tamaya.integration.spring.SpringConfigInjectionPostProcessor"/> +<bean id="tamayaConfigProvider" name="tamayaConfigProvider" class="org.apache.tamaya.integration.spring.TamayaSpringConfig"/></code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_configuring_your_context">Configuring your Context</h3> +<div class="paragraph"> +<p>Done so enables you to use Tamaya as a backend for property resolution, e.g. propertyValue as illustrated below +is resolved from the current Tamaya configuration.</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><bean id="configuredBean" name="configuredBean" class="org.apache.tamaya.integration.spring.ConfiguredSpringBean"> + <property name="message" value="${propertyValue}"/> +</bean></code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_configuring_your_beans">Configuring your Beans</h3> +<div class="paragraph"> +<p>Similarly you can inject any kind of configuration as supported by Tamaya into your Spring managed beans:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">** + * Created by Anatole on 25.09.2015. + */ +@ConfigDefaultSections +public class ConfiguredSpringBean { + + private String message; + + @Autowired + private Environment env; + + @Config("java.version") + private String javaVersion; + + @Config + @ConfigDefault("23") + private int testNumber; + + public String getJavaVersion(){ + return javaVersion; + } + + public int getTestNumber(){ + return testNumber; + } + + public Environment getEnv(){ + return env; + } + + public void setMessage(String message){ + this.message = message; + } + + public String getMessage() { + return message; + } +}</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Summarizing you get all the nice features of Tamaya out of the box running with your Spring code.</p> +</div> +</div> +</div> +</div></p> + + <hr /> + </div> + </div> + <div> + <div id="push"></div> + + <div id="footer"> + <div class="container"> + <p class="muted credit">© 2014-2016 Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> + | Baked with <a href="http://jbake.org">JBake <span>v2.5.0</span></a> + at <span>2016-10-31</span> + </p> + <p> + <b>Disclaimer</b> + Apache Tamaya (incubating) is an effort undergoing + incubation at + The Apache Software Foundation (ASF), sponsored by + the name of Apache Incubator. Incubation is required of + all newly accepted projects until a further review indicates + that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other + successful ASF projects. While incubation status is not + necessarily a reflection of the completeness or stability of + the code, it does indicate that the project has yet to + be fully endorsed by the ASF.<br /> + <a href="http://incubator.apache.org/guides/website.html" style="border:0px;" target="_target"><img class="incubator-logo" src="../logos/egg-logo2.png"/></a> + </p> + </div> + </div> + + <!-- Le javascript + ================================================== --> + <!-- Placed at the end of the document so the pages load faster --> + <script src="../js/jquery-1.11.1.min.js"></script> + <script src="../js/bootstrap.min.js"></script> + <script src="../js/prettify.js"></script> + + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/extensions/mod_yaml.html ---------------------------------------------------------------------- diff --git a/extensions/mod_yaml.html b/extensions/mod_yaml.html new file mode 100644 index 0000000..2b9e63d --- /dev/null +++ b/extensions/mod_yaml.html @@ -0,0 +1,262 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="utf-8"/> + <title>Apache Tamaya&#8201;&#8212;&#8201;Extension: Builder</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="description" content=""/> + <meta name="author" content=""/> + <meta name="keywords" content=""/> + <meta name="generator" content="'JBake '+'${version}"/> + + <!-- Le styles --> + <link href="../css/bootstrap.min.css" rel="stylesheet"/> + <link href="../css/asciidoctor.css" rel="stylesheet"/> + <link href="../css/base.css" rel="stylesheet"/> + <link href="../css/prettify.css" rel="stylesheet"/> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="../js/html5shiv.min.js"></script> + <![endif]--> + + <!-- Fav and touch icons from ASF --> + <link rel="shortcut icon" href="../favicon.ico"/> + <link rel="apple-touch-icon" sizes="57x57" href="../favicons/apple-touch-icon-57x57.png"/> + <link rel="apple-touch-icon" sizes="60x60" href="../favicons/apple-touch-icon-60x60.png"/> + <link rel="apple-touch-icon" sizes="72x72" href="../favicons/apple-touch-icon-72x72.png"/> + <link rel="apple-touch-icon" sizes="76x76" href="../favicons/apple-touch-icon-76x76.png"/> + <link rel="apple-touch-icon" sizes="114x114" href="../favicons/apple-touch-icon-114x114.png"/> + <link rel="apple-touch-icon" sizes="120x120" href="../favicons/apple-touch-icon-120x120.png"/> + <link rel="apple-touch-icon" sizes="144x144" href="../favicons/apple-touch-icon-144x144.png"/> + <link rel="apple-touch-icon" sizes="152x152" href="../favicons/apple-touch-icon-152x152.png"/> + <link rel="apple-touch-icon" sizes="180x180" href="../favicons/apple-touch-icon-180x180.png"/> + <link rel="icon" type="image/png" href="../favicons/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="../favicons/favicon-194x194.png" sizes="194x194"/> + <link rel="icon" type="image/png" href="../favicons/favicon-96x96.png" sizes="96x96"/> + <link rel="icon" type="image/png" href="../favicons/android-chrome-192x192.png" sizes="192x192"/> + <link rel="icon" type="image/png" href="../favicons/favicon-16x16.png" sizes="16x16"/> + <link rel="manifest" href="../favicons/manifest.json"/> + <link rel="shortcut icon" href="../favicons/favicon.ico"/> + <meta name="msapplication-TileColor" content="#603cba"/> + <meta name="msapplication-TileImage" content="../favicons/mstile-144x144.png"/> + <meta name="msapplication-config" content="../favicons/browserconfig.xml"/> + <meta name="theme-color" content="#303284"/> + </head> + <body onload="prettyPrint()"> + <div id="wrap"> + <div> + + <!-- Fixed navbar --> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="../">Apache Tamaya (incubating)</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li><a href="../index.html">Home</a></li> + <li><a href="../quickstart.html">Quickstart</a></li> + <li><a href="../index.html">Documentation</a></li> + <li><a href="..//apidocs/index.html">API</a></li> + <li><a href="../index.html">Development</a></li> + <li><a href="../index.html">Releases</a></li> + <li><a href="../about.html">About</a></li> + <li><a href="../sitemap.xml">Sitemap</a></li> + <li><a href="../feed.xml">Subscribe</a></li> +<!-- + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Action</a></li> + <li><a href="#">Another action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"></li> + <li class="dropdown-header">Nav header</li> + <li><a href="#">Separated link</a></li> + <li><a href="#">One more separated link</a></li> + </ul> + </li> +--> + </ul> + </div><!--/.nav-collapse --> + </div> + </div> + + </div> + <div class="container"> + + <div class="page-header"> + <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Builder</h1> + </div> + + <p><em>2016-10-31</em></p> + + <p><div id="preamble"> +<div class="sectionbody"> +<!-- toc disabled --> +</div> +</div> +<div class="sect1"> +<h2 id="BuilderCore">Tamaya YAML (Extension Module)</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_overview">Overview</h3> +<div class="paragraph"> +<p>The Tamaya YAML module provides support for reading configuration using the YAML format (yaml.org). YAML hereby +use intendation for expressing hierarchy, which makes yaml configuration files very easily readable and compact.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_compatibility">Compatibility</h3> +<div class="paragraph"> +<p>The YAML module is based on Java 7, so it will not run on Java 7 and beyond.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_installation">Installation</h3> +<div class="paragraph"> +<p>To benefit from configuration builder support you only must add the corresponding dependency to your module:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-xml" data-lang="xml"><dependency> + <groupId>org.apache.tamaya.ext</groupId> + <artifactId>tamaya-yaml</artifactId> + <version>{tamayaVersion}</version> +</dependency></code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_reading_configuration_in_yaml">Reading configuration in YAML</h3> +<div class="paragraph"> +<p>For reading YAML based onfiguration most easily a YAMLFormat can be provided:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-java" data-lang="java">ConfigurationData dataRead = ConfigurationFormats.readConfig( + getClassLoader().getResource("myFileConfig.yaml"), new YAMLFormat()));</code></pre> +</div> +</div> +</div> +<div class="sect2"> +<h3 id="_examples">Examples</h3> +<div class="paragraph"> +<p>The YAML module adds instances of ConfigurationFormat so YAML configuration can be read and mapped to the +according property values. E.g. the following file is a simple and correct YAML configuration:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-yaml" data-lang="yaml">invoice: 34843 +date : 2001-01-23 +bill-to: &id001 + given : Chris + family : Dumars + address: + lines: | + 458 Walkman Dr. + Suite #292 + city : Royal Oak + state : MI + postal : 48046 +ship-to: *id001 +product: + - sku : BL394D + quantity : 4 + description : Basketball + price : 450.00 + - sku : BL4438H + quantity : 1 + description : Super Hoop + price : 2392.00 +tax : 251.42 +total: 4443.52 +comments: + Late afternoon is best. + Backup contact is Nancy + Billsmer @ 338-4338.</code></pre> +</div> +</div> +<div class="paragraph"> +<p>Hereby the above file, by default is mapped as follows into Map<String,String> typed properties:</p> +</div> +<div class="listingblock"> +<div class="content"> +<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">invoice -> 34843 +date -> Tue Jan 23 01:00:00 CET 2001 +bill-to.family -> Dumars +bill-to.given -> Chris +bill-to.address.state -> MI +bill-to.address.postal -> 48046 +bill-to.address.city -> Royal Oak +bill-to.address.lines -> 458 Walkman Dr. +Suite #292 + +ship-to.given -> Chris +ship-to.address.state -> MI +ship-to.family -> Dumars +ship-to.address.postal -> 48046 +ship-to.address.city -> Royal Oak +ship-to.address.lines -> 458 Walkman Dr. +Suite #292 + +product -> {sku=BL394D, quantity=4, description=Basketball, price=450.0},{sku=BL4438H, quantity=1, description=Super Hoop, price=2392.0} +_product.collection-type -> List + +tax -> 251.42 +total -> 4443.52 +comments -> Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.</code></pre> +</div> +</div> +</div> +</div> +</div></p> + + <hr /> + </div> + </div> + <div> + <div id="push"></div> + + <div id="footer"> + <div class="container"> + <p class="muted credit">© 2014-2016 Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> + | Baked with <a href="http://jbake.org">JBake <span>v2.5.0</span></a> + at <span>2016-10-31</span> + </p> + <p> + <b>Disclaimer</b> + Apache Tamaya (incubating) is an effort undergoing + incubation at + The Apache Software Foundation (ASF), sponsored by + the name of Apache Incubator. Incubation is required of + all newly accepted projects until a further review indicates + that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other + successful ASF projects. While incubation status is not + necessarily a reflection of the completeness or stability of + the code, it does indicate that the project has yet to + be fully endorsed by the ASF.<br /> + <a href="http://incubator.apache.org/guides/website.html" style="border:0px;" target="_target"><img class="incubator-logo" src="../logos/egg-logo2.png"/></a> + </p> + </div> + </div> + + <!-- Le javascript + ================================================== --> + <!-- Placed at the end of the document so the pages load faster --> + <script src="../js/jquery-1.11.1.min.js"></script> + <script src="../js/bootstrap.min.js"></script> + <script src="../js/prettify.js"></script> + + </div> + </body> +</html> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/feed.xml ---------------------------------------------------------------------- diff --git a/feed.xml b/feed.xml index 09a7c59..14ebfd8 100644 --- a/feed.xml +++ b/feed.xml @@ -2,16 +2,16 @@ <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> <channel> <title>Apache Incubator Tamaya</title> - <link>https://tamaya.incubator.apache.org/</link>link</link> - <atom:link href="https://tamaya.incubator.apache.org//feed.xml" rel="self" type="application/rss+xml" /> + <link>https://tamaya.incubator.apache.org</link>link</link> + <atom:link href="https://tamaya.incubator.apache.org/feed.xml" rel="self" type="application/rss+xml" /> <description>JBake Bootstrap Template</description> <language>en-gb</language> - <pubDate>Mo, 24 Okt 2016 22:17:31 +0200</pubDate> - <lastBuildDate>Mo, 24 Okt 2016 22:17:31 +0200</lastBuildDate> + <pubDate>Mo, 31 Okt 2016 22:35:01 +0100</pubDate> + <lastBuildDate>Mo, 31 Okt 2016 22:35:01 +0100</lastBuildDate> <item> <title>Fourth Post</title> - <link>https://tamaya.incubator.apache.org//blog/2013/fourth-post.html</link>link</link> + <link>https://tamaya.incubator.apache.org/blog/2013/fourth-post.html</link>link</link> <pubDate>Do, 17 Okt 2013 00:00:00 +0200</pubDate> <guid isPermaLink="false">blog/2013/fourth-post.html</guid> <description>&lt;div class=&quot;paragraph&quot;&gt; @@ -38,7 +38,7 @@ libero, ut vehicula lectus nunc ut lorem. Aliquam erat volutpat.&lt;/p&g &lt;/div&gt;</description> </item><item> <title>Third Post</title> - <link>https://tamaya.incubator.apache.org//blog/2013/third-post.html</link>link</link> + <link>https://tamaya.incubator.apache.org/blog/2013/third-post.html</link>link</link> <pubDate>Do, 26 Sep 2013 00:00:00 +0200</pubDate> <guid isPermaLink="false">blog/2013/third-post.html</guid> <description>&lt;div class=&quot;paragraph&quot;&gt; @@ -65,7 +65,7 @@ libero, ut vehicula lectus nunc ut lorem. Aliquam erat volutpat.&lt;/p&g &lt;/div&gt;</description> </item><item> <title>Second Post</title> - <link>https://tamaya.incubator.apache.org//blog/2013/second-post.html</link>link</link> + <link>https://tamaya.incubator.apache.org/blog/2013/second-post.html</link>link</link> <pubDate>So, 25 Aug 2013 00:00:00 +0200</pubDate> <guid isPermaLink="false">blog/2013/second-post.html</guid> <description>&lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vel diam purus. Curabitur ut nisi lacus.&lt;/p&gt; @@ -76,7 +76,7 @@ libero, ut vehicula lectus nunc ut lorem. Aliquam erat volutpat.&lt;/p&g &lt;p&gt;Nam id nisl quam. Donec a lorem sit amet libero pretium vulputate vel ut purus. Suspendisse leo arcu,&lt;br/&gt;mattis et imperdiet luctus, pulvinar vitae mi. Quisque fermentum sollicitudin feugiat. Mauris nec leo&lt;br/&gt;ligula. Vestibulum tristique odio ut risus ultricies a hendrerit quam iaculis. Duis tempor elit sit amet&lt;br/&gt;ligula vehicula et iaculis sem placerat. Fusce dictum, metus at volutpat lacinia, elit massa auctor risus,&lt;br/&gt;id auctor arcu enim eu augue. Donec ultrices turpis in mi imperdiet ac venenatis sapien sodales. In&lt;br/&gt;consequat imperdiet nunc quis bibendum. Nulla semper, erat quis ornare tristique, lectus massa posuere&lt;br/&gt;libero, ut vehicula lectus nunc ut lorem. Aliquam erat volutpat.&lt;/p&gt;</description> </item><item> <title>First Post</title> - <link>https://tamaya.incubator.apache.org//blog/2013/first-post.html</link>link</link> + <link>https://tamaya.incubator.apache.org/blog/2013/first-post.html</link>link</link> <pubDate>Mi, 24 Jul 2013 00:00:00 +0200</pubDate> <guid isPermaLink="false">blog/2013/first-post.html</guid> <description> http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/fa747cb8/highleveldesign.html ---------------------------------------------------------------------- diff --git a/highleveldesign.html b/highleveldesign.html new file mode 100644 index 0000000..2e67d8d --- /dev/null +++ b/highleveldesign.html @@ -0,0 +1,417 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <meta charset="utf-8"/> + <title>Tamaya Incubator</title> + <meta name="viewport" content="width=device-width, initial-scale=1.0"/> + <meta name="description" content=""/> + <meta name="author" content=""/> + <meta name="keywords" content=""/> + <meta name="generator" content="'JBake '+'${version}"/> + + <!-- Le styles --> + <link href="css/bootstrap.min.css" rel="stylesheet"/> + <link href="css/asciidoctor.css" rel="stylesheet"/> + <link href="css/base.css" rel="stylesheet"/> + <link href="css/prettify.css" rel="stylesheet"/> + + <!-- HTML5 shim, for IE6-8 support of HTML5 elements --> + <!--[if lt IE 9]> + <script src="js/html5shiv.min.js"></script> + <![endif]--> + + <!-- Fav and touch icons from ASF --> + <link rel="shortcut icon" href="favicon.ico"/> + <link rel="apple-touch-icon" sizes="57x57" href="favicons/apple-touch-icon-57x57.png"/> + <link rel="apple-touch-icon" sizes="60x60" href="favicons/apple-touch-icon-60x60.png"/> + <link rel="apple-touch-icon" sizes="72x72" href="favicons/apple-touch-icon-72x72.png"/> + <link rel="apple-touch-icon" sizes="76x76" href="favicons/apple-touch-icon-76x76.png"/> + <link rel="apple-touch-icon" sizes="114x114" href="favicons/apple-touch-icon-114x114.png"/> + <link rel="apple-touch-icon" sizes="120x120" href="favicons/apple-touch-icon-120x120.png"/> + <link rel="apple-touch-icon" sizes="144x144" href="favicons/apple-touch-icon-144x144.png"/> + <link rel="apple-touch-icon" sizes="152x152" href="favicons/apple-touch-icon-152x152.png"/> + <link rel="apple-touch-icon" sizes="180x180" href="favicons/apple-touch-icon-180x180.png"/> + <link rel="icon" type="image/png" href="favicons/favicon-32x32.png" sizes="32x32"/> + <link rel="icon" type="image/png" href="favicons/favicon-194x194.png" sizes="194x194"/> + <link rel="icon" type="image/png" href="favicons/favicon-96x96.png" sizes="96x96"/> + <link rel="icon" type="image/png" href="favicons/android-chrome-192x192.png" sizes="192x192"/> + <link rel="icon" type="image/png" href="favicons/favicon-16x16.png" sizes="16x16"/> + <link rel="manifest" href="favicons/manifest.json"/> + <link rel="shortcut icon" href="favicons/favicon.ico"/> + <meta name="msapplication-TileColor" content="#603cba"/> + <meta name="msapplication-TileImage" content="favicons/mstile-144x144.png"/> + <meta name="msapplication-config" content="favicons/browserconfig.xml"/> + <meta name="theme-color" content="#303284"/> + </head> + <body onload="prettyPrint()"> + <div id="wrap"> + <div> + + <!-- Fixed navbar --> + <div class="navbar navbar-default navbar-fixed-top" role="navigation"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + <a class="navbar-brand" href="">Apache Tamaya (incubating)</a> + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li><a href="index.html">Home</a></li> + <li><a href="quickstart.html">Quickstart</a></li> + <li><a href="index.html">Documentation</a></li> + <li><a href="/apidocs/index.html">API</a></li> + <li><a href="index.html">Development</a></li> + <li><a href="index.html">Releases</a></li> + <li><a href="about.html">About</a></li> + <li><a href="sitemap.xml">Sitemap</a></li> + <li><a href="feed.xml">Subscribe</a></li> +<!-- + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="#">Action</a></li> + <li><a href="#">Another action</a></li> + <li><a href="#">Something else here</a></li> + <li class="divider"></li> + <li class="dropdown-header">Nav header</li> + <li><a href="#">Separated link</a></li> + <li><a href="#">One more separated link</a></li> + </ul> + </li> +--> + </ul> + </div><!--/.nav-collapse --> + </div> + </div> + + </div> + <div class="container"> + + <div class="page-header"> + <h1></h1> + </div> + + <p><em>2016-10-31</em></p> + + <p><div class="sect1"> +<h2 id="_the_tamaya_high_level_design">The Tamaya High Level Design</h2> +<div class="sectionbody"> +<div class="paragraph"> +<p>Though Tamaya is a very powerful and flexible solution there are basically only a few simple core concepts required +that build the base of all the other mechanisms:</p> +</div> +<div class="paragraph"> +<p>The <strong>API</strong> (package org.apache.tamaya) provides</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>A simple but complete SE <strong>API</strong> for accessing key/value based <em>Configuration</em>:</p> +<div class="ulist"> +<ul> +<li> +<p>Configuration hereby models configuration, the main interface of Tamaya, providing key/value pairs as raw +(String-based) key/value pairs, allowing also access to typed values.</p> +</li> +<li> +<p>ConfigurationProvider provides the static entry point for accessing configuration.</p> +</li> +</ul> +</div> +</li> +</ul> +</div> +<div class="paragraph"> +<p>The <strong>SPI</strong> (package org.apache.tamaya.spi) provides: + <strong> A simple minimalistic model for configuration data, called <em>PropertySource</em>. + </strong> Several extension points for adding additional configuration property sources or adapting the internal workings + of the overall system. + ** A ServiceContext / ServiceContextManager that controls the loading of the components in Tamaya. This allows to + adapt the behaviour depending on the runtime environment in use, e.g. a Java standalone application, an OSGI + container or a Java EE application server.</p> +</div> +<div class="paragraph"> +<p>Tamaya <strong>Modules</strong> finally allow to add additional functionality to customize your configuration solution with the +functionality you want. E.g. modules are providing features such as</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>Configuration <em>injection</em></p> +</li> +<li> +<p><em>Dynamic placeholders</em> and resolution mechanism for configuration values</p> +</li> +<li> +<p>Abstractions for reusable <em>configuration formats</em></p> +</li> +<li> +<p>Dynamic configuration updates and change events</p> +</li> +<li> +<p>Support for OSGI/Java EE Classloading</p> +</li> +<li> +<p>A configuration server/client</p> +</li> +<li> +<p>and more…​</p> +</li> +</ul> +</div> +</div> +</div> +<div class="sect1"> +<h2 id="_how_tamaya_organizes_configuration">How Tamaya organizes Configuration</h2> +<div class="sectionbody"> +<div class="sect2"> +<h3 id="_overview">Overview</h3> +<div class="paragraph"> +<p>All the mentioned artifacts are used to organize configuration in a higly flexible and extendable way. Hereby the +PropertySource is the key artifact. In general Tamaya organizes Configuration as follows:</p> +</div> +<div class="imageblock"> +<div class="content"> +<img src="../images/CoreDesign.png" alt="CoreDesign"> +</div> +</div> +<div class="paragraph"> +<p>Key abstraction hereby is the ConfigurationContext, which basically</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>an ordered chain of PropertySource instances. This chain is used to evaluate raw configuration values.</p> +</li> +<li> +<p>a set of PropertyFilter instances that filter the raw values evaluated from the property source chain.</p> +</li> +<li> +<p>a set of PropertyConverter that convert String values into typed values when needed.</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>In most standalone use cases only one ConfigurationContext will be active at a time. But in more complex scenarios, +such as Java EE also multiple contexts could be active that are active depending on the current runtime context +(e.g. attached to the corresponding classloader(s)). These aspects are basically handled by the +ConfigurationProvider and its corresponding SPIs.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_loading_the_current_em_configurationcontext_em">Loading the current <em>ConfigurationContext</em></h3> +<div class="paragraph"> +<p>The ConfigurationContext is the core of Tamaya. It manages all configuration sources and additional components +required to evaluate a concrete configuration value:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>Tamaya loads all available PropertySource instances. Hereby PropertySource instances can be</p> +<div class="ulist"> +<ul> +<li> +<p>Directly registered (using the mechanism defined by the current ServiceContext implementation, by default +the Java ServiceLoader.</p> +</li> +<li> +<p>Provided by a registered instance of PropertySourceProvider.</p> +</li> +</ul> +</div> +</li> +<li> +<p>All loaded property sources are <em>ordered based on each ordinal</em>, returned from PropertySource.getOrdinal() as +an ordered chain of PropertySources, building up the ordered chain of PropertySource instances used for raw +configuration value evaluation.</p> +</li> +<li> +<p>Tamaya loads all available PropertyFilter instances. Hereby PropertyFilter instances can be registered +by default using the Java ServiceLoader API. The PropertyFilter instances loaded are ordered based on the +@Priority annotations found on each filter. If no priority annotation is present, 0 is assumed.</p> +</li> +<li> +<p>Tamaya loads all available PropertyConverter instances. Hereby PropertyConverter instances can be registered +by default using the Java ServiceLoader API. The PropertyConverter instances loaded are ordered based on the +@Priority annotations found on each filter. If no priority annotation is present, 0 is assumed. It is +possible to register multiple converters for the same target type.</p> +</li> +</ul> +</div> +</div> +<div class="sect2"> +<h3 id="_evaluating_raw_property_values">Evaluating raw property values</h3> +<div class="paragraph"> +<p>When evaluating a concrete configuration value for a given key, Tamaya iterates through this chain of registered +PropertySources. Hereby the final value, by default, is determined by the last non-null value returned from a +PropertySource.</p> +</div> +<div class="paragraph"> +<p>Since the ladder may not always be appropriate, e.g. when values should be combined instead of overridden, a +instance of PropertyValueCombinationPolicy can be registered, which allows to add more detailed behaviour how values +are combined.</p> +</div> +<div class="paragraph"> +<p>Access to the complete configuration Map is performing the same resolution and combination algorithm, but for all +key/value pairs available.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_filtering_the_raw_properties">Filtering the raw properties:</h3> +<div class="paragraph"> +<p>Each raw configuration value evaluated is filtered by the ordered filter chain, as long as there are any changes +applied by any of the filters called. This ensures that also transitive replacements by filters are possible. +If, after a configurable number of evaluation loops still values are changes during each loop, the filtering +process is aborted, since a non-resolvable circular filter issue is assumed.</p> +</div> +<div class="paragraph"> +<p>The output is the final configuration value as type String.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_applying_type_conversion">Applying type conversion:</h3> +<div class="paragraph"> +<p>Finally, if the required target type, does not match Java.ui.lang.String, all registered PropertyConverter +instances targeting the corresponding target type are asked to convert the given (String-based) configuration +entry to the required (non String) target type.</p> +</div> +<div class="paragraph"> +<p>Hereby the first <em>non-null</em> value returned by a PropertyConverter is used as the final typed configuration value and +returned to the caller.</p> +</div> +</div> +<div class="sect2"> +<h3 id="_advanced_features">Advanced Features</h3> +<div class="paragraph"> +<p>Basically the bahaviour of Tamaya can be customized using the following mechanisms. Basically configuration can be +provided using the following mechanism:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>Registering additional (default) PropertySource instances. Depending on their <em>ordinal value</em> they +will override or extend existing configuration.</p> +</li> +<li> +<p>Registering additional (default) PropertySourceProvider instances.that can provide multiple PropertySource +instances.</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>Additionally Tamaya provides hooks for further adapting the internal workings:</p> +</div> +<div class="ulist"> +<ul> +<li> +<p>Adapting the way how multiple entries with the same key are combined (PropertyValueCombinationPolicy). This +may be useful, if overriding is not the way how entries of the same key should be combined. An example, where +such an alternate scenario is useful are list entries, that combine all entries encountered to a collecting +list entry.</p> +</li> +<li> +<p>Adding additional support for new target types configurable by registering additional PropertyConverter +instances. This can be used for adding support for new types as well as for adding support for additional +formats.</p> +</li> +<li> +<p>Complex extensions may adapt the complete ConfigurationContext, using the ConfigurationContextBuilder and +reapply the changed instance using ConfigurationProvider.setConfigurationContext(ConfigurationContext). +This is one example how to react on dynamic changes detected on configuration files read.</p> +</li> +<li> +<p>Registering additional PropertyFilter instances, that filter the configuration values extracted.</p> +</li> +<li> +<p>Registering an alternate ServiceContext to support alternate runtime containers, e.g. a CDI container.</p> +</li> +<li> +<p>A combination of all above.</p> +</li> +</ul> +</div> +<div class="paragraph"> +<p>Additionally instances of ConfigOperator, ConfigQuery can be provided that provide additional functionality +that should not be globally visible. It is recommended to provide them from a singleton accessor, hereby hiding +the effective implementation classes.</p> +</div> +</div> +</div> +</div> +<div class="sect1"> +<h2 id="_component_loading">Component Loading</h2> +<div class="sectionbody"> +<div class="paragraph"> +<p>As mentioned the component loading of Tamaya can be adapted. By default the JDK ServiceLoader API is used to determine +a ServiceContext implementation that should control +Tamaya’s overall component loading. If not found, a default implementation is registered, which relies on the +Java hava.util.ServiceLoader mechanism. This behaviour can be changed by implementing your own version +of the ServiceContext interface, annotating it with a @Priority annotation and registering it using the +java.util.ServiceLoader mechanism.</p> +</div> +</div> +</div> +<div class="sect1"> +<h2 id="_compatibility">Compatibility</h2> +<div class="sectionbody"> +<div class="paragraph"> +<p>The Tamaya API is compatible with Java 7 and beyond.</p> +</div> +</div> +</div> +<div class="sect1"> +<h2 id="_further_documentation">Further Documentation</h2> +<div class="sectionbody"> +<div class="paragraph"> +<p>Being here we recommend to have a look at the more detailed documentation of Tamaya’s <a href="API.html">API and SPI</a>, +and of its current available <a href="extensions.html">modules</a>.</p> +</div> +</div> +</div></p> + + <hr /> + </div> + </div> + <div> + <div id="push"></div> + + <div id="footer"> + <div class="container"> + <p class="muted credit">© 2014-2016 Apache Software Foundation | Mixed with <a href="http://getbootstrap.com/">Bootstrap v3.1.1</a> + | Baked with <a href="http://jbake.org">JBake <span>v2.5.0</span></a> + at <span>2016-10-31</span> + </p> + <p> + <b>Disclaimer</b> + Apache Tamaya (incubating) is an effort undergoing + incubation at + The Apache Software Foundation (ASF), sponsored by + the name of Apache Incubator. Incubation is required of + all newly accepted projects until a further review indicates + that the infrastructure, communications, and decision making + process have stabilized in a manner consistent with other + successful ASF projects. While incubation status is not + necessarily a reflection of the completeness or stability of + the code, it does indicate that the project has yet to + be fully endorsed by the ASF.<br /> + <a href="http://incubator.apache.org/guides/website.html" style="border:0px;" target="_target"><img class="incubator-logo" src="logos/egg-logo2.png"/></a> + </p> + </div> + </div> + + <!-- Le javascript + ================================================== --> + <!-- Placed at the end of the document so the pages load faster --> + <script src="js/jquery-1.11.1.min.js"></script> + <script src="js/bootstrap.min.js"></script> + <script src="js/prettify.js"></script> + + </div> + </body> +</html>
