http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/8158d464/extensions/mod_management.html ---------------------------------------------------------------------- diff --git a/extensions/mod_management.html b/extensions/mod_management.html deleted file mode 100644 index 5a271d5..0000000 --- a/extensions/mod_management.html +++ /dev/null @@ -1,274 +0,0 @@ -<!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: JMX Management Access</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: JMX Management Access</h1> - </div> - - <p><em>2016-11-28</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="ExtModel">Tamaya Management (JMX Support) (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>The Tamaya management module provides support for registering a JMX management bean for accessing configuration.</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 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-management</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_the_managedconfigmbean_bean">The ManagedConfigMBean bean</h3> -<div class="paragraph"> -<p>The management model defines the MBean of type ManagedConfigMBean as follows:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ManagedConfigMBean { - String getJsonConfigurationInfo(); - String getXmlConfigurationInfo(); - Map<String, String> getConfiguration(); - Map<String, String> getSection(String area, boolean recursive); - Set<String> getSections(); - Set<String> getTransitiveSections(); - boolean isSectionExisting(String area); - default boolean isSectionEmpty(String area); -}</code></pre> -</div> -</div> -<div class="ulist"> -<ul> -<li> -<p>getJsonConfigurationInfo,getXmlConfigurationInfo return a JSON or XML representation of the -current configuration.</p> -</li> -<li> -<p>getConfiguration access the current configuration properties.</p> -</li> -<li> -<p>getSection allows to extract all entries below a certain subkey. With <em>recursive</em> the query -will not only return direct children, but also recursively walk down all subsection of the -given section key.</p> -</li> -<li> -<p>getSections returns all current known section names.</p> -</li> -<li> -<p>getTransitiveSections return all sections, but also adds all transitive subsection as single -entries to the set as well.</p> -</li> -<li> -<p>isSectionExisting and isSectionEmpty allow for quering if entries are present under the given -section keys.</p> -</li> -</ul> -</div> -</div> -<div class="sect2"> -<h3 id="_registering_the_managedconfigmbean">Registering the ManagedConfigMBean</h3> -<div class="paragraph"> -<p>For registering the current ManagedConfigMBean instance to the current MBean platform server, the -following static methods are available:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class ConfigManagementSupport{ - - private JMXSupport(){} - - public static ObjectName registerMBean(); - public static ObjectName registerMBean(String context); - public static ObjectName unregisterMBean(); - public static ObjectName unregisterMBean(String context); -}</code></pre> -</div> -</div> -<div class="ulist"> -<ul> -<li> -<p>registerMBean creates a new ManagedConfigMBean instance using the ServiceContextManager -and registers it. Optionally an additional <em>context</em> parameter can be passed, which allows -to register the management bean for different classloaders, e.g. for different -ears.</p> -</li> -<li> -<p>unregisterMBean does the oppsite than registering obviously.</p> -</li> -</ul> -</div> -<div class="admonitionblock note"> -<table> -<tr> -<td class="icon"> -<div class="title">Note</div> -</td> -<td class="content"> -The instance of ManagedConfigMBean to be created and registered is evaluated by use og the - ServiceContextManager. So you can replace the bean implementation by registering your - overriding implementation using the current ServiceContext (by default using - java.util.ServiceLoader and @Priority annotation. -</td> -</tr> -</table> -</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-12-12</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/8158d464/extensions/mod_metamodel-staged.html ---------------------------------------------------------------------- diff --git a/extensions/mod_metamodel-staged.html b/extensions/mod_metamodel-staged.html deleted file mode 100644 index ee7aea5..0000000 --- a/extensions/mod_metamodel-staged.html +++ /dev/null @@ -1,229 +0,0 @@ -<!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: Staged PropertySources</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: Staged PropertySources</h1> - </div> - - <p><em>2016-11-28</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Remote">Tamaya Metamodel: Staged PropertySources (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>The Tamaya Staged PropertySources extension provides a base class and default implementation for loading -multistaged configuration easily from a common configuration location.</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 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.metamodels</groupId> - <artifactId>tamaya-metamodel.staged</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -<div class="paragraph"> -<p>The component will not register any components. The component basically provides the following options:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>Use it as default configuration extension. Hereby you should define your stages in use by setting the -env.STAGE system property with the stages to be loaded in order of precedence (most significant last), -e.g. sys-env,DEFAULTS,TEST,DEVELOPMENT. _Additionally_ you must register -+org.apache.tamaya.staged.StagedConfigPropertiesProvider as in</p> -</li> -</ul> -</div> -<div class="listingblock"> -<div class="content"> -<pre>META-INF -|_service - |_org.apache.tamaya.spi.PropertySourceProvider</pre> -</div> -</div> -<div class="paragraph"> -<p>Tamaya will then load .properties files from System.getenv(), -classpath:DEFAULTS.properties, classpath:TEST.properties and -classpath:DEVELOPMENT.properties</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>For more advanced requirements, such as alternate locations, patterns or formats, you can also extend one of the -provided classes (org.apache.tamaya.staged.StagedConfigPropertiesProvider,</p> -<div class="ulist"> -<ul> -<li> -<p>BaseStagedPropertySourceProvider). Extending provides features such as:</p> -</li> -<li> -<p>Defining a prefix for all entries provided/loaded.</p> -</li> -<li> -<p>Using alternate locations or formats.</p> -</li> -<li> -<p>Defining the ordinals used.</p> -</li> -</ul> -</div> -</li> -</ul> -</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-12-12</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/8158d464/extensions/mod_model.html ---------------------------------------------------------------------- diff --git a/extensions/mod_model.html b/extensions/mod_model.html deleted file mode 100644 index 4161651..0000000 --- a/extensions/mod_model.html +++ /dev/null @@ -1,769 +0,0 @@ -<!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: Model Documentation and Validation</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: Model Documentation and Validation</h1> - </div> - - <p><em>2016-11-28</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="ExtModel">Tamaya Model Documentation and Validation (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>The Tamaya model module provides support for documenting configuration and validating configuration read and processed -against this model. Documentation and config models can be provided in different ways:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>as separate meta-model documents</p> -</li> -<li> -<p>by providers that check classes/packages for configuration annotations (planned)</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 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-model</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_describing_the_configuration_meta_model">Describing the Configuration Meta-Model</h3> -<div class="paragraph"> -<p>Basically configuration is modelled using key, value-pairs. Looking at a keys -a.b.c.param1 and a.b.c.param2 the following concepts can be used to defined/describe -configuration:</p> -</div> -<div class="olist arabic"> -<ol class="arabic"> -<li> -<p>the <em>configuration section:</em> In our case this equals to a.b.c, which itself also includes the -transitive entries a.b and a.</p> -</li> -<li> -<p>the <em>configuration parameter:</em> Basically parameters are adressed using their fully qualified names, -which equals to the containing section name and the relative parameter name, separated by the dor separator. -In the above example a.b.c.param1 and a.b.c.param2 are the fully qualified parameter names.</p> -</li> -</ol> -</div> -<div class="paragraph"> -<p>Now with only these 2 concepts a simple configuration meta-model can be defined as</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>a meta-model’s name, used just for grouping different meta-models and entries to better separate -descriptions, e.g. in a management console or generated configuration documentation site.</p> -</li> -<li> -<p>a set of sections.</p> -</li> -<li> -<p>a set of parameters.</p> -</li> -<li> -<p>Both, sections (.model.target=Section) as well as parameter models (.model.target=Parameter)</p> -<div class="ulist"> -<ul> -<li> -<p>can be modelled by a meta-data entry, by default _my.config.key.model.</p> -</li> -<li> -<p>may be required, or optional (.model.required=true|false)</p> -</li> -<li> -<p>may have an optional description</p> -</li> -</ul> -</div> -</li> -<li> -<p>Parameters additionally have</p> -<div class="ulist"> -<ul> -<li> -<p>a <em>type</em> (.model.type=Classname), described by the fully qualified class name, into which any configured (String) -value must be convertable into. If no type is configured java.ui.lang.String is assumed as default.</p> -</li> -<li> -<p>an optional regular expression that can be used to validate the String values returned from a -configuration (.model.expression=regexpression).</p> -</li> -</ul> -</div> -</li> -</ul> -</div> -<div class="paragraph"> -<p>Given these concepts a configuration can be fully described. Entries that are not contained in one of the given -sections (or its children), or parameters not described or marked as valid (e.g. for dynamic configModels of -a section), are called <em>undefined</em>. Undefined parameters should be grouped with its parent section. Each section, as -well as all parent sections, including transitive) of any parametet read, should similarly marked as undefined, if and -only if</p> -</div> -<div class="olist arabic"> -<ol class="arabic"> -<li> -<p>the section itself is (directly) <em>undefined</em></p> -</li> -<li> -<p>the section is not a <em>super section</em> of a defined section.</p> -</li> -</ol> -</div> -<div class="paragraph"> -<p>As en example the section definition of a.b.c also implicitly includes the sections a.b and a to be defined -sections, despite the fact that section properties, such as description and custom configModels are not inherited to -its parent, or child section.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_defining_meta_configuration_model">Defining Meta-Configuration Model</h3> -<div class="paragraph"> -<p>The configuration meta-model is defined by simple configuration meta-data entries. The section for all model -configuration by default is called model, which results in entries such as _my.config.key.model.target=Section. -Within this section fully qualified configuration keys defines -which part of the configuration is targeted by certain entries.</p> -</div> -<div class="sect3"> -<h4 id="_defining_sections">Defining Sections</h4> -<div class="paragraph"> -<p>First we start to define some configuration sections, the example below starts with the most important -variants supported:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing"># Metamodel information -_model.provider=ConfigModel Extension - -# org.mycompany.root (optional section) -_org.mycompany.root.model.target=Section -_org.mycompany.root.model.description=Root section defining my company configuration. - -# org.mycompany.security (required section) -_org.mycompany.security.model.target=Section -_org.mycompany.security.model.required=true -_org.mycompany.security.model.description=Security related settings.\ - refer for further details to XXX. - -# minmal section -_minimal.model.target=Section - -# custom validated section -_validated.model.target=Section -_validated.model.validator=org.apache.tamaya.model.TestValidator</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Above org.mycompany.root transitively defines 3 sections:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>org</p> -</li> -<li> -<p>org.mycompany</p> -</li> -<li> -<p>org.mycompany.root</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>All sections are optional. Additionally the model above also defines a required section org.mycompany.security. -Required sections are checked so the section is not empty. It is not checked for any specific parameter hereby, -only the existance of any child parameter is validated.</p> -</div> -<div class="paragraph"> -<p>The <em>class</em> attribute has to be defined for any section definition, because if not set a model entry is, by default, -defined to be a parameter configModel entry. Given above the entry for the section minimal shows such a minimal -entry.</p> -</div> -<div class="paragraph"> -<p>validated defines a section, which is validated through a customizable validator. Hereby an ordered list of validators -can be provided, separated by commas.</p> -</div> -</div> -<div class="sect3"> -<h4 id="_defining_parameters">Defining Parameters</h4> -<div class="paragraph"> -<p>Similarly parameters also can be defined:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing"># org.mycompany.root.name (required parameter) -_org.mycompany.root.name.model.target=Parameter -_org.mycompany.root.name.model.required=true -_org.mycompany.root.name.model.description=The company's name, also used in the application's main header. - -# org.mycompany.security (required parameters) -_org.mycompany.security.uid.model.required=true -_org.mycompany.security.uid.model.description=The user id. -_org.mycompany.security.realm.model.required=true -_org.mycompany.security.realm.model.validator=org.apache.tamaya.model.RealmValidator -_org.mycompany.security.realm.model.description=The security realm required. -_org.mycompany.security.tokenid.model.description=The token id, if the token service is used (optional). - -# A minmal parameter -_minimalClass.model.target=Class</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Similarly as when defining section also parameter entries define transitively its containing sections. E.g. -the entry above for org.mycompany.security.realm also defines the following sections (as optional).</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>org</p> -</li> -<li> -<p>org.mycompany</p> -</li> -<li> -<p>org.mycompany.security</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>Additional entries for section, e.g. configModels to be done, can be added as described in the previous section, -but are optional.</p> -</div> -<div class="paragraph"> -<p>Since the parameter is the default type for model entries, a minmal parameter model entry only only needs it’s -parameter type to be defined. In the example above we define a parameter minimalClass of type Class. -Types hereby are fully qualified class names, whereas as 'java.ui.lang' for built-in language types can be -ommitted.</p> -</div> -</div> -<div class="sect3"> -<h4 id="_model_locations">Model Locations</h4> -<div class="paragraph"> -<p>By default the configuration model can be defined at the following locations:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>classpath*:META-INF/configmodel.properties, separate to the current Configuration. This functionality is enabled -by default, but can be disabled by adding org.apache.tamaya.model.default.enabled=false to your current -Configuration.</p> -</li> -<li> -<p>implicitly as part of the current +Configuration. THis can be disabled by setting -the org.apache.tamaya.model.integrated.enabled configuration poarameter to false.</p> -</li> -<li> -<p>customized by configuring the org.apache.tamaya.model.resources in the current Configuration. This -parameter allows to define the locations from where the model extension is trying to read the -model configuration. If the <em>resources extension</em> is available in your system it is used to -evaluate the locations. If not the default Classloader.getResources command is issued. Also it -is required that the <em>formats extension</em> is available, since this is used to effectively read the -data. This extension also allows you to use alternate representation formats such as ini, xml, yml, json.</p> -</li> -</ul> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_tracking_configuration_access">Tracking Configuration Access</h3> -<div class="paragraph"> -<p>The model module also allows tracking which code accesses configuration properties or configuration parameters. -It checks the stacktrace to evaluate the calling code location, hereby any unwanted packages can be implicitly -ommitted from the stacktrace. Also the maximal length of the stacktrace retained can be constraint in length. -The usages are recorded as Usage instances. Hereby for each parameter accessed a corresponding Usage -instance is created. It can be accessed by calling Usage ConfigUsageStats.getUsage(String key). Usage -statistics for calling Configuration.getProperties() can be obtained calling Usage getUsageAllProps();.</p> -</div> -<div class="paragraph"> -<p>Usage tracking is disabled by default. It can be enabled by calling ConfigUsageStats.enableUsageTracking(true);. -ConfigUsageStats.isUsageTrackingEnabled() returns the current tracking status.</p> -</div> -<div class="paragraph"> -<p>The Usage class itself provides access to further fainer grained usage data (AccessDetail) containing:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>the access point (fqn.ClassName#method(line: xxx)).</p> -</li> -<li> -<p>the number of accesses</p> -</li> -<li> -<p>the first an last access</p> -</li> -<li> -<p>the values read</p> -</li> -<li> -<p>the access stacktrace (filtered by ignored packages).</p> -</li> -</ul> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class Usage { - [...] - public String getKey(); - public void clearMetrics(); - public int getReferenceCount(); - public int getUsageCount(); - public Collection<AccessDetail> getAccessDetails(Class type); - public Collection<AccessDetail> getAccessDetails(Package pack); - public Collection<AccessDetail> getAccessDetails(String lookupExpression); - public Collection<AccessDetail> getAccessDetails(); - public void trackUsage(String value); - public void trackUsage(String value, int maxTraceLength); - - - public static final class AccessDetail { - [...] - public void clearStats(); - public long trackAccess(String value); - public long getAccessCount(); - public String getAccessPoint(); - public long getFirstAccessTS(); - public long getLastAccessTS(); - public String[] getStackTrace(); - public Map<Long, String> getTrackedValues(); - } - -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>With ConfigUsageStats.clearUsageStats() the collected statistics can be reset at any time. Summarizing the main -singleton for configuration statistics is defined as follows:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class ConfigUsageStats{ - public static Set<String> getIgnoredUsagePackages(); - public static void addIgnoredUsagePackages(String... packageName); - public static void enableUsageTracking(boolean enabled); - public static Usage getUsage(String key); - public static Collection<Usage> getUsages(); - public static void clearUsageStats(); - public static Usage getUsageAllProperties(); - public static boolean isUsageTrackingEnabled(); - public static String getUsageInfo(); -}</code></pre> -</div> -</div> -<div class="sect3"> -<h4 id="_customizing_the_stacktrage_for_usage_reporting">Customizing the Stacktrage for Usage Reporting</h4> -<div class="paragraph"> -<p>The stacktrace tracked by the system can be customized in several ways:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>ConfigUsageStats.addIgnoredPackageNames(String...) allows to add additional ignored package names.</p> -</li> -<li> -<p>With Usage.setMaxTraceLength(int) the maximal size of the stacktraces logged can be set. Setting a -negative value will disable stacktrace logging completelely.</p> -</li> -</ul> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_accessing_usage_statistics">Accessing Usage Statistics</h3> -<div class="paragraph"> -<p>Bascially usage statistics are available in two forms:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>The Usage/AccessDetail object tree can be accessed programmatically from the ConfigUsageStats -singleton.</p> -</li> -<li> -<p>With ConfigUsageStats.getUsageInfo() also a textual representation of the usage statistics -can be obtained, as illustrated below (a snipped from the current test output):</p> -</li> -</ul> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">Apache Tamaya Configuration Usage Metrics -========================================= -DATE: Sat Apr 30 21:51:09 CEST 2016 - -220 <<all>>: - - 220 <unknown/filtered/internal> , first=Sat Apr 30 21:51:09 CEST 2016, last=Sat Apr 30 21:51:09 CEST 2016 -3 java.version: - - 2 test.model.TestConfigAccessor#readProperty(line:43), first=Sat Apr 30 21:51:09 CEST 2016, last=Sat Apr 30 21:51:09 CEST 2016 - - 1 <unknown/filtered/internal> , first=Sat Apr 30 21:51:09 CEST 2016, last=Sat Apr 30 21:51:09 CEST 2016</code></pre> -</div> -</div> -<div class="sect3"> -<h4 id="_programmatic_api">Programmatic API</h4> -<div class="paragraph"> -<p>Basically the configModel module provides a simple API to access the defined ConfigModel instances and -validating the current Configuration against the models as follows:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class ConfigModelManager { - - private ConfigModelManager() {} - - public static Collection<ConfigModel> getModels(); - public static Collection<ConfigModel> findModels(ModelType type, String namePattern); - public static <T extends ConfigModel> T getModel(String name, Class<T> modelType); - public static Collection<ConfigModel> findModels(String namePattern); - - public static Collection<ValidationResult> validate(); - public static Collection<ValidationResult> validate(boolean showUndefined); - public static Collection<ValidationResult> validate(Configuration config); - public static Collection<ValidationResult> validate(Configuration config, boolean showUndefined); - - public static void registerMBean(); - public static void registerMBean(String context); - -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>This singleton allows to validate the current or any Configuration instance. All the ConfigModels read also are -available from the getModels method. This models can be used to provide documentation, e.g. as part of a CLI interface -or shown on a documentation web server.</p> -</div> -<div class="paragraph"> -<p>A ConfigModel hereby is defined as one single part of configuration, typically corresponding to a specific concern -of your system. As an example you can define different models for different modules or products plugged together. -With resolution mechanism in place you can also define a shared module that is targeted by multiple modules as a -single configuration source (e.g. for configuring the machine’s IP address and subnet settings only once.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ConfigModel { - - ModelTarget getType(); - String getName(); - String getProvider(); - boolean isRequired(); - String getDescription(); - Collection<ValidationResult> validate(Configuration config); -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Hereby ModelTarget defines more details on the kind of model:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public enum ModelTarget { - /** - * A configuration section. - */ - Section, - /** - * A configuration paramter. - */ - Parameter, - /** - * ConfigModel that is a container of other validations. - */ - Group -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>A ValidationResult models one validation executed by a ConfigModel on a certain Configuration instance:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class ValidationResult { - - public static ValidationResult ofValid(ConfigModel configModel); - public static ValidationResult ofMissing(ConfigModel configModel); - public static ValidationResult ofMissing(ConfigModel configModel, String message); - public static ValidationResult ofError(ConfigModel configModel, String error); - public static ValidationResult ofWarning(ConfigModel configModel, String warning); - public static ValidationResult ofDeprecated(ConfigModel configModel, String alternateUsage); - public static ValidationResult ofDeprecated(ConfigModel configModel); - public static ValidationResult ofUndefined(final String key); - public static ValidationResult of(ConfigModel configModel, ValidationState result, String message); - - public ConfigModel getConfigModel(); - public ValidationState getResult(); - public String getMessage(), -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>The result of a complete validation on a concrete Configuration instance finally is mapped as a -Collection<ValidationResult>, refer to the methods on ConfigModelManager.</p> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_auto_documentation_of_classes_with_configuration_injection">Auto-Documentation of Classes with Configuration Injection</h3> -<div class="paragraph"> -<p>A special feature of this module is that it observes ConfigEvent published through Tamaya’as event channel -(tamaya-events module). If no metaconfiguration model is found the model manager by default automatically creates -models for all injected instances on the fly. In the case of CDI integration this happens typically during deployment -time, since CDI initializes during deployment time. Other runtime platforms, such as OSGI, may have rather different -behaviour. Nevertheless this means that after your system has been started you should have access to a complete -set of ConfigModel instances that automatically document all the classes in your system that consume configuration -(through injection).</p> -</div> -</div> -</div> -</div> -<div class="sect1"> -<h2 id="_model_spi">Model SPI</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_registering_configuration_models">Registering Configuration Models</h3> -<div class="paragraph"> -<p>The model extension also provides an SPI where customized functionality can be added. The main abstraction hereby is -the ModelProviderSpi interface, which allows any kind of additional config models to be added to the system:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ModelProviderSpi { - - Collection<ConfigModel> getConfigModels(); - -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>New instances implementing this interface must be registered into the current ServiceContext, by default the -ServiceLoader is used.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_the_configusagestatsspi">The ConfigUsageStatsSpi</h3> -<div class="paragraph"> -<p>The methods for managing and tracking of configuration changes are similarly delegated to an -implementation of the org.apache.tamaya.model.spi.ConfigUsageStatsSpi SPI. -By implementing this SPI and registerting it with the ServiceContext the usage tracking -logic can be adapted or replaced.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_other_utility_classes">Other Utility Classes</h3> -<div class="paragraph"> -<p>The module also provides further utility classes that may be useful for implementing models or testing:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>AbstractModel provides a base class that can be extended, when implementing ConfigModel.</p> -</li> -<li> -<p>AreaConfigModel provides a ConfigModel implementation (with a corresponding Builder) to model the -requirement of certain configuration sections being present, or opionally present, in the model.</p> -</li> -<li> -<p>ParameterModel provides an implementation base class for validating parameters on existence and compliance -with a regular expression.</p> -</li> -<li> -<p>ConfigDocumentationMBean is the MBean registered that models similar functionality as ConfigModelManager.</p> -</li> -<li> -<p>ConfigModelGroup provides a ConfigModel that groups several child models.</p> -</li> -<li> -<p>ConfigModelReader allows to read ConfigModels from properties files as described at the beginning of this -document.</p> -</li> -</ul> -</div> -</div> -<div class="sect2"> -<h3 id="_switches_to_enable_disable_functionality">Switches to enable/disable functionality</h3> -<div class="paragraph"> -<p>The model module provides different switches that can be used to activate or deactivate features:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>tamaya.model.integrated.enabled allows to deactivate reading inline metaconfiguration delivered with -the normal Tamaya Configuration. By default inline entries (_.abcd.model.*) are evaluated.</p> -</li> -<li> -<p>tamaya.model.default.enabled allows to deactivate reading metamodel information from -classpath:META-INF/configmodel.properties. By default it is active.</p> -</li> -<li> -<p>tamaya.model.resources allows to define additional resources (loaded through the resources extension), -that can be used to read metamodel information in any format using Tamaya’s format module.</p> -</li> -<li> -<p>the system property tamaya.model.autoModelEvents allows to activate/deactivate the automatic -documentation of classes configured and published by Tamaya ConfiguredType event instances (e.g. published by -Tamaya’s injection modules).</p> -</li> -</ul> -</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-12-12</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/8158d464/extensions/mod_mutable_config.html ---------------------------------------------------------------------- diff --git a/extensions/mod_mutable_config.html b/extensions/mod_mutable_config.html deleted file mode 100644 index cd38bbd..0000000 --- a/extensions/mod_mutable_config.html +++ /dev/null @@ -1,482 +0,0 @@ -<!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: Mutable Configuration</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: Mutable Configuration</h1> - </div> - - <p><em>2016-11-28</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Core">Tamaya Mutable Configuration (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>Tamaya Configuration by default is read-only, which covers must of the use cases. But there are many legit scenarios -where configuration should be written back to some backend systems or the local file system. This module adds this -functionality.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_compatibility">Compatibility</h3> -<div class="paragraph"> -<p>The module is based on Java 7, so it can be used with Java 7 and beyond.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_installation">Installation</h3> -<div class="paragraph"> -<p>To benefit from configuration mutability 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-mutable-config</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_core_architecture">Core Architecture</h3> -<div class="sect3"> -<h4 id="_accessing_mutableconfiguration">Accessing MutableConfiguration</h4> -<div class="paragraph"> -<p>The core of the module is the MutableConfigurationProvider singleton, which provides access to MutableConfiguration -instance, which extends Configuration. This interface adds additional methods to add/update or remove property values. -Hereby changes applied are managed in a transaction like context, called ConfigChangeContext. Each context defines -a UUID that identifes a change. -Backends for writing changes applied are of type MutablePropertySource, similarly extending the PropertySource -SPI with methods for writing changes back. Registrations and ordering policies are like with ordinary property sources, -with one important difference. Mutable property source can be targeted by write operations.</p> -</div> -<div class="paragraph"> -<p>The example below shows how a MutableConfiguration can be obtained the simplest way:</p> -</div> -<div class="listingblock"> -<div class="title">Accessing and changing configuration</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">MutableConfiguration config = MutableConfigurationProvider - .createMutableConfiguration(); -config.put("newKey", "newValue") - .put("anotherKey", "updatedValue") - .remove("valueNotValid") - .store();</code></pre> -</div> -</div> -<div class="paragraph"> -<p>In the above scenario we use the overall system’s configuration as the backend to be used. -We can also pass any Configuration to render it into a mutable instance, e.g.</p> -</div> -<div class="listingblock"> -<div class="title">Explicitly passing the backing configuration</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">Configuration config = ...; -MutableConfiguration config = MutableConfigurationProvider - .createMutableConfiguration(config);</code></pre> -</div> -</div> -<div class="admonitionblock note"> -<table> -<tr> -<td class="icon"> -<div class="title">Note</div> -</td> -<td class="content"> -If a configuration does not contain any MutablePropertySource instances, - a MutableConfiguration built from it will not be able to accept any changes. -</td> -</tr> -</table> -</div> -<div class="paragraph"> -<p>Following you see the options how to create a MutableConfiguration using the -MutableConfigurationProvider singleton:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class MutableConfigurationProvider { - - private MutableConfigurationProvider(){} - - public static MutableConfiguration createMutableConfiguration(); - public static MutableConfiguration createMutableConfiguration( - ChangePropagationPolicy changePropgationPolicy); - public static MutableConfiguration createMutableConfiguration(Configuration configuration); - public static MutableConfiguration createMutableConfiguration( - Configuration configuration, - ChangePropagationPolicy changePropgationPolicy); - - [...] -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Hereby MutableConfiguration is defined as follows:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface MutableConfiguration extends Configuration { - - void store(); - - ConfigChangeRequest getConfigChangeRequest(); - ChangePropagationPolicy getChangePropagationPolicy(); - - MutableConfiguration put(String key, String value); - MutableConfiguration putAll(Map<String, String> properties); - MutableConfiguration remove(Collection<String> keys); - MutableConfiguration remove(String... keys); - -}</code></pre> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_targeting_the_right_mutablepropertysources">Targeting the right MutablePropertySources</h4> -<div class="paragraph"> -<p>A Configuration may have multiple MutablePropertySource instances present. These are members of Tamaya’s oredered list of -PropertySources to evaluate the configuration. Nevertheless writing back changes requires additional aspects to -be considered: -* Should changes being written back to all mutable property sources? Or should a key that could be added or removed - on a more significant instance not be written/removed on less significant property source instances? -* Should a change be applied only to a specific mutable property source, regardless its position in the - processing chain?</p> -</div> -<div class="paragraph"> -<p>Therefore a ChangePropagationPolicy can be set on a MutableConfiguration instance, which allows to control -this aspect:</p> -</div> -<div class="listingblock"> -<div class="title">Explicitly passing the backing configuration</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ChangePropagationPolicy { - /** - * Method being called when a multiple key/value pairs are added or updated. - * @param propertySources the property sources, including readable property sources of the current configuration, - * never null. - * @param configChange the configuration change, not null. - */ - void applyChange(ConfigChangeRequest configChange, Collection<PropertySource> propertySources); -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>By default, changes are applied to all registered MutablePropertySources similarly.</p> -</div> -<div class="paragraph"> -<p>Also the MutableConfigurationProvider provides access to the most commonly used change propagation policies:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public final class MutableConfigurationProvider { - - [...] - - public static ChangePropagationPolicy getApplyAllChangePolicy(); - public static ChangePropagationPolicy getApplyMostSignificantOnlyChangePolicy(); - public static ChangePropagationPolicy getApplySelectiveChangePolicy(String... propertySourceNames); - public static ChangePropagationPolicy getApplyNonePolicy(); -}</code></pre> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_some_aspects_to_consider">Some Aspects to consider</h4> -<div class="paragraph"> -<p>Due to Tamaya’s design the effective effect of your changes to the overall configuration, cannot -be sometimes a bit tricky to be predicted, since it depends on several aspects:</p> -</div> -<div class="olist arabic"> -<ol class="arabic"> -<li> -<p>is the corresponding configuration resource configured as part of the current system’s configuration?</p> -</li> -<li> -<p>what is the PropertySource's priority within the configuration context? Is it overriding or overridden -by other sources?</p> -</li> -<li> -<p>is the change directly visible to the configuration system? E.g. injected values are normally not updated, -whereas injecting a DynamicValue<T> instance allows to detect and react single value changes. Also the -PropertySources implementation must be able to detect any configuration changes and adapt its values returned -accordingly. Finally values also can be marked as immutable or being cached.</p> -</li> -<li> -<p>Is configuration cached, or written/collected directly on access?</p> -</li> -<li> -<p>can the changes applied be committed at all?</p> -</li> -</ol> -</div> -<div class="paragraph"> -<p>So it is part of your application configuration design to clearly define, which property sources may be read-only, which -may be mutable, how overriding should work and to which backends finally any changes should be written back. Nevertheless -changing or adding value is very easy:</p> -</div> -<div class="listingblock"> -<div class="title">Changing a configuration</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">MutableConfiguration config = MutableConfigurationProvider.createMutableConfiguration(); -config.put("newKey", "newValue"); -config.remove("mycluster.myapp.myKey"); -config.store();</code></pre> -</div> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_configuration_changes">Configuration Changes</h3> -<div class="paragraph"> -<p>This module does not handle detection of changes to the overall system’s Configuration. This can be done in -several ways, e.g. by:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>using the <em>tamaya-events</em> extension, which can be used to observe the system’s configuration and -publishing events when things have been changed.</p> -</li> -<li> -<p>The SPI implementing the MutableConfigurationBackendSpi may inform/update any affected PropertySource, -PropertySourceProvider instances about the changes applied.</p> -</li> -</ul> -</div> -</div> -<div class="sect2"> -<h3 id="_supported_backends">Supported Backends</h3> -<div class="paragraph"> -<p>Multiple backends are supported. E.g. the <em>etcd</em> integration module of Tamaya also registers -corresponding SPI implementations/backends. By default this module comes with -the following MutablePropertySource implementations:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>MutablePropertySource resources, targeting local .properties files, using the java.util.Properties -format.</p> -</li> -<li> -<p>MutableXmlPropertySource resources, targeting local .xml property files, using the java.util.Properties -XML format.</p> -</li> -</ul> -</div> -<div class="sect3"> -<h4 id="_refreshable_property_sources">Refreshable Property Sources</h4> -<div class="paragraph"> -<p>Somehow similar to configuration changes applied explicitly is the case, where values of underlying -configuration backends change and must be reflected in the new configuration tree. Examples are:</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>Configuration files being edited, added or removed.</p> -</li> -<li> -<p>Changes on remote servers like etcd, consul</p> -</li> -<li> -<p>etc.</p> -</li> -</ul> -</div> -<div class="paragraph"> -<p>For having a common API for refreshable items a Refreshable interface is defined:</p> -</div> -<div class="listingblock"> -<div class="title">Refreshable interface</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">/** - * Interface to be implemented by items that can be refreshed. By default - * these are property sources, but more types may be supported at a later - * point in time. - */ -public interface Refreshable { - - /** - * Refreshes the item by reloading its internal state. - */ - void refresh(); - -}</code></pre> -</div> -</div> -</div> -<div class="sect3"> -<h4 id="_refreshable_property_sources_2">Refreshable Property Sources</h4> - -</div> -</div> -<div class="sect2"> -<h3 id="_spis">SPIs</h3> -<div class="paragraph"> -<p>The module defines MutableConfigurationProviderSpi, that is used as a delegate by the MutableConfigurationProvider -singleton accessor:</p> -</div> -<div class="listingblock"> -<div class="title">SPI: MutableConfigurationProviderSpi</div> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface MutableConfigurationProviderSpi { - /** - * Creates a new {@link MutableConfiguration} with {@code autoCommit = false} as default. - * - * @param configuration the configuration, not null. - * @param propagationPolicy policy that defines how changes are published to the property - * sources. - * @return a new mutable configuration instance. - */ - MutableConfiguration createMutableConfiguration(Configuration configuration, - ChangePropagationPolicy propagationPolicy); -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Implementations are registered with the current ServiceContext (using by default the - java.util.ServiceLoader service).</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-12-12</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/8158d464/extensions/mod_optional.html ---------------------------------------------------------------------- diff --git a/extensions/mod_optional.html b/extensions/mod_optional.html deleted file mode 100644 index 2767835..0000000 --- a/extensions/mod_optional.html +++ /dev/null @@ -1,202 +0,0 @@ -<!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: Optional Tamaya Configuration</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: Optional Tamaya Configuration</h1> - </div> - - <p><em>2016-11-28</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Optional">Tamaya Optional Configuration (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>The Tamaya optional module provides contains three types only. It is for projects that want to benefit from Tamaya -configuration optionally only. E.g. doing an OSS project you can declare to support configuration with Tamaya as -an optional extension. This module can be added as a hard dependency to your code, hereby adding only three artofacts. -It automatically checks the availability of Tamaya on the classpath and only if available tries to access it for -configuration evaluation. Additionally an EvaluationPolicy lets you define the precedence of configured values -(yours, or Tamaya ones if present).</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 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-optional</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_reading_configuration_using_the_tamaya_optional_module">Reading configuration using the Tamaya Optional Module</h3> -<div class="paragraph"> -<p>The optional module allows reading configuration with a small subset of functionality only. For extended of full -featured config please consider using the Apache Tamaya as a full configuration backend.</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">BigDecimal interestRate = - OptionalConfiguration.of( - EvaluationPolicy.TAMAYA_OVERRIDES_OTHER, - (k) -> MyConfigMechanism.get(k) // String get(String key); - ) - .get("com.mycomp.ratecalculator.rate", BigDecimal.class)) - .orElse(BigDecimal.of(0.05d));</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-12-12</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>
