http://git-wip-us.apache.org/repos/asf/incubator-tamaya-site/blob/8158d464/documentation/extensions/mod_resources.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_resources.html b/documentation/extensions/mod_resources.html deleted file mode 100644 index 26530ca..0000000 --- a/documentation/extensions/mod_resources.html +++ /dev/null @@ -1,341 +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: Resources</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="../../index.html">Apache Tamaya (incubating)</a> - </div> - <div class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li><a href="../../start.html">Tamaya in 5 minutes</a></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../documentation/usecases.html">Use Cases and Requirements</a></li> - <li><a href="../../documentation/quickstart.html">Quickstart</a></li> - <li><a href="../../documentation/api.html">API</a></li> - <li><a href="../../documentation/core.html">Core</a></li> - <li><a href="../../documentation/extensions.html">Extension Guide</a></li> - <li class="divider"></li> - <li><a href="../../apidocs/index.html">Javadoc null (external)</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../development/source.html">Sources</a></li> - <li><a href="../../development/community.html">Community</a></li> - <li><a href="../../development/team.html">Project Team</a></li> - <li><a target="_blank" href="https://builds.apache.org/view/S-Z/view/Tamaya/">CI / ASF Jenkins</a></li> - <li><a target="_blank" href="https://issues.apache.org/jira/browse/TAMAYA">Issues / ASF Jira</a></li> - <li><a href="../../devguide.html">Development Guide</a></li> - <li><a href="../../release-guide.html">Release Guide</a></li> - <li class="divider"></li> - <li><a href="../../development/possible-contributions.html">Possible Contributions</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../download.html">Download</a></li> - <li><a href="../../history.html">Release History</a></li> - </ul> - </li> -<!-- Example: - <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> ---> - <li><a href="../../sitemap.xml">Sitemap</a></li> - <li><a href="../../feed.xml">Subscribe</a></li> - </ul> - </div><!--/.nav-collapse --> - </div> - </div> - - </div> - <div class="container"> - - <div class="page-header"> - <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Resources</h1> - </div> - - <p><em>2017-01-10</em></p> - - <p><div class="sect1"> -<h2 id="Core">Tamaya Resources (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>Tamaya Resources is an extension module. Refer to the -<a href="../extensions.html">extensions documentation</a> for further details -about modules.</p> -</div> -<div class="paragraph"> -<p>Tamaya Resources defines some additional tools to locate resources in your classpath or file system based on descriptive -ant-styled resource patterns. To use this module add the following dependency:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing"><dependency> - <grooupId>org.apache.tamaya.ext</groupId> - <artifactId>tamaya-resources</artifactId> - <version>0.3-incubating-SNAPSHOT</version> -</dependency></code></pre> -</div> -</div> -<div class="paragraph"> -<p>The module’s main entry point is the singleton class org.apache.tamaya.resource.ConfigResources. This class -provides access to a ResourceResolver instance:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">ResourceResolver resolver = ConfigResources.getResourceResolver();</code></pre> -</div> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public interface ResourceResolver { - Collection<URL> getResources(Collection<String> expressions) {...} - Collection<URL> getResources(String... expressions) {...} - Collection<URL> getResources(ClassLoader classLoader, String... expressions){...} - Collection<URL> getResources(ClassLoader classLoader, Collection<String> expressions); -}</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Hereby the methods allow to resolve expressions to a collection of URLs. In case the expression is also targeting the -current classpath the target ClassLoader to be used can be passed additionally.</p> -</div> -<div class="paragraph"> -<p>The default implementation provides resource resolution mechanism similar to the functionality offered by Spring. -So by default resources can be looked up</p> -</div> -<div class="ulist"> -<ul> -<li> -<p>from files</p> -</li> -<li> -<p>from the classpath</p> -</li> -<li> -<p>optionally ant-styled expressions can be used.</p> -</li> -</ul> -</div> -</div> -<div class="sect2"> -<h3 id="_valid_expression_examples">Valid Expression Examples</h3> -<div class="paragraph"> -<p>There are numerous ways how a resource pattern can be defined. Following the most important variants -are listed:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-listing" data-lang="listing">// explicitly searching the file system -file:myroot/aa?a/*.file -file:myroot/b*/b?/*.file -file:myroot/**/*.file - -// explicitly searching the classpath -classpath:myroot/**/*.file -classpath:javax/annotation/*.class -classpath:javax/**/sql/*.class -classpath:javax/annotation/**/R*.class -classpath:javax/annotation/R?so*.class -classpath:META-INF/maven/org.apache.geronimo.specs/**/* - -// search both classpath and files -javax/annotation/*.class -javax/**/sql/*.class -javax/annotation/**/R*.class -javax/annotation/R?so*.class -META-INF/maven/org.apache.geronimo.specs/**/* -myroot/**/*.file -myroot/aa?a/*.file -myroot/b*/b?/*.file</code></pre> -</div> -</div> -<div class="paragraph"> -<p>Summarizing the resources module provides useful functionality that helps to locate resources on the file system and -in the classpath. This can be used to implement PropertySourceProvider implementations that are based on -corresponding resource path patterns instead of concrete files.</p> -</div> -</div> -<div class="sect2"> -<h3 id="_overall_usage_example">Overall Usage Example</h3> -<div class="paragraph"> -<p>Given the functionality we can easily implement a PropertySourceProvider that reads all files from a classpath -location, hereby traversing down all folders:</p> -</div> -<div class="listingblock"> -<div class="content"> -<pre class="prettyprint highlight"><code class="language-java" data-lang="java">public class PathBasedPropertySourceProvider implements PropertySourceProvider { - - @Override - public Collection<PropertySource> getPropertySources() { - List<PropertySource> propertySources = new ArrayList<>(); - Collection<URL> resources = Resources.getResourceResolver().getResources("META-INF/cfg/**/*.properties"); - for(URL url:resources){ - Properties props = new Properties(); - try(InputStream is = url.openStream()){ - props.load(is); - propertySources.add(new PropertiesBasedPropertySource(url.toString(), props)); - } - catch(Exception e){ - e.printStackTrace(); - } - } - - return propertySources; - } - - private final static class PropertiesBasedPropertySource implements PropertySource { - private String name; - private Map<String,String> properties = new HashMap<>(); - - public PropertiesBasedPropertySource(String name, Properties props) { - this.name = name; - props.forEach((k,v) -> this.properties.put(k.toString(), v.toString())); - } - - @Override - public String getName() { - return name; - } - - @Override - public String get(String key) { - return properties.get(key); - } - - @Override - public Map<String, String> getProperties() { - return properties; - } - } -}</code></pre> -</div> -</div> -</div> -<div class="sect2"> -<h3 id="_spi">SPI</h3> -<div class="paragraph"> -<p>The ResourceResolver that is returned by the ConfigResources singleton is determined by the -current ServiceContext, by default you can replace the default implementation by registering an -alternate implementation with an overriding @Priority annotation added using the ServiceLoader.</p> -</div> -<div class="paragraph"> -<p>Additionally a BaseResourceResolver class can be used to reduce the amount of code to be written -on your own.</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>2017-01-10</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/documentation/extensions/mod_server.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_server.html b/documentation/extensions/mod_server.html deleted file mode 100644 index ae44458..0000000 --- a/documentation/extensions/mod_server.html +++ /dev/null @@ -1,586 +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: 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="../../index.html">Apache Tamaya (incubating)</a> - </div> - <div class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li><a href="../../start.html">Tamaya in 5 minutes</a></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../documentation/usecases.html">Use Cases and Requirements</a></li> - <li><a href="../../documentation/quickstart.html">Quickstart</a></li> - <li><a href="../../documentation/api.html">API</a></li> - <li><a href="../../documentation/core.html">Core</a></li> - <li><a href="../../documentation/extensions.html">Extension Guide</a></li> - <li class="divider"></li> - <li><a href="../../apidocs/index.html">Javadoc null (external)</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../development/source.html">Sources</a></li> - <li><a href="../../development/community.html">Community</a></li> - <li><a href="../../development/team.html">Project Team</a></li> - <li><a target="_blank" href="https://builds.apache.org/view/S-Z/view/Tamaya/">CI / ASF Jenkins</a></li> - <li><a target="_blank" href="https://issues.apache.org/jira/browse/TAMAYA">Issues / ASF Jira</a></li> - <li><a href="../../devguide.html">Development Guide</a></li> - <li><a href="../../release-guide.html">Release Guide</a></li> - <li class="divider"></li> - <li><a href="../../development/possible-contributions.html">Possible Contributions</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../download.html">Download</a></li> - <li><a href="../../history.html">Release History</a></li> - </ul> - </li> -<!-- Example: - <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> ---> - <li><a href="../../sitemap.xml">Sitemap</a></li> - <li><a href="../../feed.xml">Subscribe</a></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>2017-01-09</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>{tamaya_version}</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>2017-01-10</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/documentation/extensions/mod_spi-support.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_spi-support.html b/documentation/extensions/mod_spi-support.html deleted file mode 100644 index 017e0f1..0000000 --- a/documentation/extensions/mod_spi-support.html +++ /dev/null @@ -1,248 +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: 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="../../index.html">Apache Tamaya (incubating)</a> - </div> - <div class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li><a href="../../start.html">Tamaya in 5 minutes</a></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../documentation/usecases.html">Use Cases and Requirements</a></li> - <li><a href="../../documentation/quickstart.html">Quickstart</a></li> - <li><a href="../../documentation/api.html">API</a></li> - <li><a href="../../documentation/core.html">Core</a></li> - <li><a href="../../documentation/extensions.html">Extension Guide</a></li> - <li class="divider"></li> - <li><a href="../../apidocs/index.html">Javadoc null (external)</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../development/source.html">Sources</a></li> - <li><a href="../../development/community.html">Community</a></li> - <li><a href="../../development/team.html">Project Team</a></li> - <li><a target="_blank" href="https://builds.apache.org/view/S-Z/view/Tamaya/">CI / ASF Jenkins</a></li> - <li><a target="_blank" href="https://issues.apache.org/jira/browse/TAMAYA">Issues / ASF Jira</a></li> - <li><a href="../../devguide.html">Development Guide</a></li> - <li><a href="../../release-guide.html">Release Guide</a></li> - <li class="divider"></li> - <li><a href="../../development/possible-contributions.html">Possible Contributions</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../download.html">Download</a></li> - <li><a href="../../history.html">Release History</a></li> - </ul> - </li> -<!-- Example: - <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> ---> - <li><a href="../../sitemap.xml">Sitemap</a></li> - <li><a href="../../feed.xml">Subscribe</a></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>2017-01-09</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 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>{tamaya_version}</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>2017-01-10</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/documentation/extensions/mod_spring.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_spring.html b/documentation/extensions/mod_spring.html deleted file mode 100644 index c6af8ae..0000000 --- a/documentation/extensions/mod_spring.html +++ /dev/null @@ -1,335 +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: 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="../../index.html">Apache Tamaya (incubating)</a> - </div> - <div class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li><a href="../../start.html">Tamaya in 5 minutes</a></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../documentation/usecases.html">Use Cases and Requirements</a></li> - <li><a href="../../documentation/quickstart.html">Quickstart</a></li> - <li><a href="../../documentation/api.html">API</a></li> - <li><a href="../../documentation/core.html">Core</a></li> - <li><a href="../../documentation/extensions.html">Extension Guide</a></li> - <li class="divider"></li> - <li><a href="../../apidocs/index.html">Javadoc null (external)</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../development/source.html">Sources</a></li> - <li><a href="../../development/community.html">Community</a></li> - <li><a href="../../development/team.html">Project Team</a></li> - <li><a target="_blank" href="https://builds.apache.org/view/S-Z/view/Tamaya/">CI / ASF Jenkins</a></li> - <li><a target="_blank" href="https://issues.apache.org/jira/browse/TAMAYA">Issues / ASF Jira</a></li> - <li><a href="../../devguide.html">Development Guide</a></li> - <li><a href="../../release-guide.html">Release Guide</a></li> - <li class="divider"></li> - <li><a href="../../development/possible-contributions.html">Possible Contributions</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../download.html">Download</a></li> - <li><a href="../../history.html">Release History</a></li> - </ul> - </li> -<!-- Example: - <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> ---> - <li><a href="../../sitemap.xml">Sitemap</a></li> - <li><a href="../../feed.xml">Subscribe</a></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>2017-01-09</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 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>{tamaya_version}</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>2017-01-10</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/documentation/extensions/mod_usagetracker.html ---------------------------------------------------------------------- diff --git a/documentation/extensions/mod_usagetracker.html b/documentation/extensions/mod_usagetracker.html deleted file mode 100644 index 8bdd786..0000000 --- a/documentation/extensions/mod_usagetracker.html +++ /dev/null @@ -1,368 +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: Usage Tracking</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="../../index.html">Apache Tamaya (incubating)</a> - </div> - <div class="navbar-collapse collapse"> - <ul class="nav navbar-nav"> - <li><a href="../../start.html">Tamaya in 5 minutes</a></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Documentation <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../documentation/usecases.html">Use Cases and Requirements</a></li> - <li><a href="../../documentation/quickstart.html">Quickstart</a></li> - <li><a href="../../documentation/api.html">API</a></li> - <li><a href="../../documentation/core.html">Core</a></li> - <li><a href="../../documentation/extensions.html">Extension Guide</a></li> - <li class="divider"></li> - <li><a href="../../apidocs/index.html">Javadoc null (external)</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Development <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../development/source.html">Sources</a></li> - <li><a href="../../development/community.html">Community</a></li> - <li><a href="../../development/team.html">Project Team</a></li> - <li><a target="_blank" href="https://builds.apache.org/view/S-Z/view/Tamaya/">CI / ASF Jenkins</a></li> - <li><a target="_blank" href="https://issues.apache.org/jira/browse/TAMAYA">Issues / ASF Jira</a></li> - <li><a href="../../devguide.html">Development Guide</a></li> - <li><a href="../../release-guide.html">Release Guide</a></li> - <li class="divider"></li> - <li><a href="../../development/possible-contributions.html">Possible Contributions</a></li> - </ul> - </li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">Releases <b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="../../download.html">Download</a></li> - <li><a href="../../history.html">Release History</a></li> - </ul> - </li> -<!-- Example: - <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> ---> - <li><a href="../../sitemap.xml">Sitemap</a></li> - <li><a href="../../feed.xml">Subscribe</a></li> - </ul> - </div><!--/.nav-collapse --> - </div> - </div> - - </div> - <div class="container"> - - <div class="page-header"> - <h1>Apache Tamaya&#8201;&#8212;&#8201;Extension: Usage Tracking</h1> - </div> - - <p><em>2017-01-09</em></p> - - <p><div id="preamble"> -<div class="sectionbody"> -<!-- toc disabled --> -</div> -</div> -<div class="sect1"> -<h2 id="Core">Tamaya Usage Tracking (Extension Module)</h2> -<div class="sectionbody"> -<div class="sect2"> -<h3 id="_overview">Overview</h3> -<div class="paragraph"> -<p>Tamaya Usage Tracking allows to record and count the configuration access and consumer locations in your local -VM.</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-usagetracker</artifactId> - <version>{tamaya_version}</version> -</dependency></code></pre> -</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> -<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="_usagetracker_module_spi">UsageTracker Module SPI</h2> -<div class="sectionbody"> -<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> -</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>2017-01-10</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>
