deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r922514 [2/11] - in /websites/staging/deltaspike/trunk/content: ./ documentation/ retired/
Date Wed, 17 Sep 2014 12:22:53 GMT
Added: websites/staging/deltaspike/trunk/content/retired/_modules.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/retired/_modules.html (added)
+++ websites/staging/deltaspike/trunk/content/retired/_modules.html Wed Sep 17 12:22:52 2014
@@ -0,0 +1,581 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - Modules</title>
+
+    
+
+    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
+
+    <!-- Styles -->
+    
+    <link href="./../resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./../resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./../resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./../resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand logocolor" href="/index.html">Apache DeltaSpike</a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./../index.html">Home</a></li>
+                        <li><a href="./../documentation.html">Documentation</a></li>
+                        <li><a href="./../source.html">Source</a></li>
+                        <li><a href="./../download.html">Download</a></li>
+                        <li><a href="./../community.html">Community</a></li>
+                        <!-- <li><a href="./../support.html">Support</a></li>  -->
+                        <li><a href="./../news.html">News</a></li>
+                        <li><a href="./../migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1>Modules</h1>
+              </div>
+              <div class="toc">
+<ul>
+<li><a href="#security">Security</a><ul>
+<li><a href="#securitybinding-for-class-and-method-invocations">SecurityBinding for class and method invocations</a></li>
+<li><a href="#integrating-3rd-party-security-frameworks">Integrating 3rd party security frameworks</a><ul>
+<li><a href="#secured">@Secured</a></li>
+<li><a href="#accessdecisionvoter">AccessDecisionVoter</a></li>
+<li><a href="#securityviolation">SecurityViolation</a></li>
+<li><a href="#secured-and-stereotypes-with-custom-meta-data">@Secured and Stereotypes with custom Meta-data</a></li>
+</ul>
+</li>
+<li><a href="#accessdecisionvotercontext">AccessDecisionVoterContext</a></li>
+<li><a href="#securitystrategy-spi">SecurityStrategy SPI</a></li>
+</ul>
+</li>
+<li><a href="#jpa">JPA</a><ul>
+<li><a href="#transactional">@Transactional</a></li>
+<li><a href="#transactionscoped">@TransactionScoped</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<hr />
+<h1 id="security">Security</h1>
+<h2 id="securitybinding-for-class-and-method-invocations">SecurityBinding for class and method invocations</h2>
+<p>This feature of the security module functions by intercepting method calls, and performing a security check before invocation is allowed to proceed.</p>
+<p>In order to use the DeltaSpike security module, you must first have installed the proper dependencies into your POM file. Once this is complete, you may proceed to create a security parameter binding annotation. This is what we will use to add security behavior to our business classes and methods.</p>
+<div class="codehilite"><pre><span class="n">Create</span> <span class="n">the</span> <span class="n">SecurityBinding</span>
+<span class="err">@</span><span class="n">Retention</span><span class="p">(</span><span class="n">value</span> <span class="o">=</span> <span class="n">RUNTIME</span><span class="p">)</span>
+<span class="err">@</span><span class="n">Target</span><span class="p">({</span><span class="n">TYPE</span><span class="p">,</span> <span class="n">METHOD</span><span class="p">})</span>
+<span class="err">@</span><span class="n">Documented</span>
+<span class="err">@</span><span class="n">SecurityBindingType</span>
+<span class="n">public</span> <span class="err">@</span><span class="n">interface</span> <span class="n">CustomSecurityBinding</span> <span class="p">{</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Next, we must define an Authorizer class to implement behavior for our custom SecurityBindingType. This class is simply a CDI bean which declares a @Secures method, qualified with the security binding annotation we created in the first step.</p>
+<p>This method has access to the InvocationContext of the method call, so if we need to access parameter arguments, we can do so using the given context. Note that we may also inject other beans into the parameter list of our @Secures method.</p>
+<div class="codehilite"><pre><span class="n">Create</span> <span class="n">the</span> <span class="n">Authorizer</span>
+<span class="p">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">CustomAuthorizer</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Secures</span>
+    <span class="p">@</span><span class="n">CustomSecurityBinding</span>
+    <span class="n">public</span> <span class="n">boolean</span> <span class="n">doSecuredCheck</span><span class="p">(</span><span class="n">InvocationContext</span> <span class="n">invocationContext</span><span class="p">,</span> <span class="n">BeanManager</span> <span class="n">manager</span><span class="p">,</span> <span class="p">@</span><span class="n">LoggedIn</span> <span class="n">User</span> <span class="n">user</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">user</span><span class="p">.</span><span class="n">isLoggedIn</span><span class="p">();</span> <span class="o">//</span> <span class="n">perform</span> <span class="n">security</span> <span class="n">check</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>We can then use our new annotation to secure business or bean methods. This binding annotation may be placed on the entire class (securing all methods,) or on individual methods that you wish to secure.</p>
+<div class="codehilite"><pre><span class="n">Secure</span> <span class="n">a</span> <span class="n">bean</span> <span class="n">method</span>
+<span class="p">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SecuredBean1</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">CustomSecurityBinding</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">doSomething</span><span class="p">(</span><span class="n">Thing</span> <span class="n">thing</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">thing</span><span class="p">.</span><span class="n">doSomething</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Next, we may access parameter values from the method invocation directly in our authorizer bean by creating custom @SecurityParameterBinding types; this is a simple step once we have completed the work above:</p>
+<div class="codehilite"><pre><span class="n">Create</span> <span class="n">a</span> <span class="n">parameter</span> <span class="n">binding</span> <span class="n">annotation</span>
+<span class="err">@</span><span class="n">Retention</span><span class="p">(</span><span class="n">value</span> <span class="o">=</span> <span class="n">RUNTIME</span><span class="p">)</span>
+<span class="err">@</span><span class="n">Target</span><span class="p">({</span><span class="n">PARAMETER</span><span class="p">})</span>
+<span class="err">@</span><span class="n">Documented</span>
+<span class="err">@</span><span class="n">SecurityParameterBinding</span>
+<span class="n">public</span> <span class="err">@</span><span class="n">interface</span> <span class="n">CurrentThing</span> <span class="p">{</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Now, when a secured method is invoked, we can inject actual parameter values as arguments into our authorizer method, providing domain-level security in our applications:</p>
+<div class="codehilite"><pre><span class="n">Update</span> <span class="n">the</span> <span class="n">Authorizer</span> <span class="n">to</span> <span class="n">use</span> <span class="n">parameter</span> <span class="n">binding</span>
+<span class="p">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">CustomAuthorizer</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Secures</span>
+    <span class="p">@</span><span class="n">CustomSecurityBinding</span>
+    <span class="n">public</span> <span class="n">boolean</span> <span class="n">doSecuredCheck</span><span class="p">(</span><span class="n">InvocationContext</span> <span class="n">invocationContext</span><span class="p">,</span> <span class="n">BeanManager</span> <span class="n">manager</span><span class="p">,</span> <span class="p">@</span><span class="n">LoggedIn</span> <span class="n">User</span> <span class="n">user</span><span class="p">,</span> <span class="p">@</span><span class="n">CurrentThing</span> <span class="n">Thing</span> <span class="n">thing</span><span class="p">)</span> <span class="n">throws</span> <span class="n">Exception</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">thing</span><span class="p">.</span><span class="n">hasMember</span><span class="p">(</span><span class="n">user</span><span class="p">);</span> <span class="o">//</span> <span class="n">perform</span> <span class="n">security</span> <span class="n">check</span> <span class="n">against</span> <span class="n">our</span> <span class="n">method</span> <span class="n">parameter</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Note that our business method must also be annotated.</p>
+<div class="codehilite"><pre><span class="n">Complete</span> <span class="n">the</span> <span class="n">parameter</span> <span class="n">binding</span>
+<span class="p">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SecuredBean1</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">CustomSecurityBinding</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">doSomething</span><span class="p">(@</span><span class="n">CurrentThing</span> <span class="n">Thing</span> <span class="n">thing</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">thing</span><span class="p">.</span><span class="n">doSomething</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Our method is now secured, and we are able to use given parameter values as part of our security authorizer!</p>
+<h2 id="integrating-3rd-party-security-frameworks">Integrating 3rd party security frameworks</h2>
+<h3 id="secured">@Secured</h3>
+<p>{{@Secured}} is build on {{@SecurityBindingType}} and a very simple alternative to the rest of the security module.
+It's a basic hook to integrate a custom security concept, 3rd party frameworks,... . It doesn't provide a full blown security concept like the rest of the security module, but other DeltaSpike modules ensure that the security concepts are integrated properly (e.g. correct behaviour within custom scope implementations,...). It just allows to integrate other security frameworks easily.</p>
+<p>(In MyFaces CODI it was originally a CDI interceptor. This part changed a bit, because between the interceptor and {{@Secured}} is the {{@SecurityBindingType}} concept which triggers {{@Secured}} as on possible approach. Therefore the basic behaviour remains the same and you can think about it like an interceptor.)</p>
+<div class="codehilite"><pre><span class="n">Securing</span> <span class="n">all</span> <span class="n">intercepted</span> <span class="k">methods</span> <span class="n">of</span> <span class="n">a</span> <span class="n">CDI</span> <span class="n">bean</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="p">@</span><span class="n">Secured</span><span class="p">(</span><span class="n">CustomAccessDecisionVoter</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SecuredBean</span>
+<span class="p">{</span>
+    <span class="o">//</span><span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>or</p>
+<div class="codehilite"><pre><span class="n">Securing</span> <span class="n">specific</span> <span class="k">methods</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">SecuredBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Secured</span><span class="p">(</span><span class="n">CustomAccessDecisionVoter</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+    <span class="n">public</span> <span class="n">String</span> <span class="n">getResult</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="o">//</span><span class="p">...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<h3 id="accessdecisionvoter">AccessDecisionVoter</h3>
+<p>This interface is (besides the {{Secured}} annotation) the most important part of the concept. Both artifact types are also the only required parts.</p>
+<div class="codehilite"><pre><span class="n">public</span> <span class="n">class</span> <span class="n">CustomAccessDecisionVoter</span> <span class="n">implements</span> <span class="n">AccessDecisionVoter</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Override</span>
+    <span class="n">public</span> <span class="n">Set</span><span class="o">&lt;</span><span class="n">SecurityViolation</span><span class="o">&gt;</span> <span class="n">checkPermission</span><span class="p">(</span><span class="n">AccessDecisionVoterContext</span> <span class="n">accessDecisionVoterContext</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">Method</span> <span class="n">method</span> <span class="p">=</span> <span class="n">accessDecisionVoterContext</span><span class="p">.</span><span class="o">&lt;</span><span class="n">InvocationContext</span><span class="o">&gt;</span><span class="n">getSource</span><span class="p">().</span><span class="n">getMethod</span><span class="p">();</span>
+
+        <span class="o">//</span><span class="p">...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>[TODO] hint about the changed parameter/s</p>
+<h3 id="securityviolation">SecurityViolation</h3>
+<p>In case of a detected violation a {{SecurityViolation}} has to be added to the result returned by the {{AccessDecisionVoter}}.</p>
+<p>[TODO] AbstractAccessDecisionVoter</p>
+<h3 id="secured-and-stereotypes-with-custom-meta-data">@Secured and Stereotypes with custom Meta-data</h3>
+<p>If there are multiple {{AccessDecisionVoter}} and maybe in different constellations, it's easier to provide an expressive CDI stereotypes for it. Later on that also allows to change the behaviour in a central place.</p>
+<div class="codehilite"><pre><span class="n">Stereotype</span> <span class="n">support</span> <span class="n">of</span> <span class="err">@</span><span class="n">Secured</span><span class="p">}</span>
+<span class="err">@</span><span class="n">Named</span>
+<span class="err">@</span><span class="n">Admin</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">MyBean</span> <span class="n">implements</span> <span class="n">Serializable</span>
+<span class="p">{</span>
+  <span class="c1">//...</span>
+<span class="p">}</span>
+
+<span class="c1">//...</span>
+<span class="err">@</span><span class="n">Stereotype</span>
+<span class="err">@</span><span class="n">Secured</span><span class="p">(</span><span class="n">RoleAccessDecisionVoter</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+<span class="n">public</span> <span class="err">@</span><span class="n">interface</span> <span class="n">Admin</span>
+<span class="p">{</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Furthermore, it's possible to provide custom meta-data easily.</p>
+<div class="codehilite"><pre><span class="n">Stereotype</span> <span class="n">of</span> <span class="err">@</span><span class="n">Secured</span> <span class="n">with</span> <span class="n">custom</span> <span class="n">meta</span><span class="o">-</span><span class="n">data</span><span class="p">}</span>
+<span class="err">@</span><span class="n">Named</span>
+<span class="err">@</span><span class="n">Admin</span><span class="p">(</span><span class="n">securityLevel</span><span class="o">=</span><span class="mi">3</span><span class="p">)</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">MyBean</span> <span class="n">implements</span> <span class="n">Serializable</span>
+<span class="p">{</span>
+  <span class="c1">//...</span>
+<span class="p">}</span>
+
+<span class="c1">//...</span>
+<span class="err">@</span><span class="n">Stereotype</span>
+<span class="err">@</span><span class="n">Secured</span><span class="p">(</span><span class="n">RoleAccessDecisionVoter</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+<span class="n">public</span> <span class="err">@</span><span class="n">interface</span> <span class="n">Admin</span>
+<span class="p">{</span>
+  <span class="kt">int</span> <span class="n">securityLevel</span><span class="p">();</span>
+<span class="p">}</span>
+
+<span class="err">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">RoleAccessDecisionVoter</span> <span class="n">implements</span> <span class="n">AccessDecisionVoter</span>
+<span class="p">{</span>
+    <span class="n">private</span> <span class="k">static</span> <span class="n">final</span> <span class="kt">long</span> <span class="n">serialVersionUID</span> <span class="o">=</span> <span class="o">-</span><span class="mi">8007511215776345835L</span><span class="p">;</span>
+
+    <span class="n">public</span> <span class="n">Set</span><span class="o">&lt;</span><span class="n">SecurityViolation</span><span class="o">&gt;</span> <span class="n">checkPermission</span><span class="p">(</span><span class="n">AccessDecisionVoterContext</span> <span class="n">voterContext</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="n">Admin</span> <span class="n">admin</span> <span class="o">=</span> <span class="n">voterContext</span><span class="p">.</span><span class="n">getMetaDataFor</span><span class="p">(</span><span class="n">Admin</span><span class="p">.</span><span class="n">class</span><span class="p">.</span><span class="n">getName</span><span class="p">(),</span> <span class="n">Admin</span><span class="p">.</span><span class="n">class</span><span class="p">);</span>
+        <span class="kt">int</span> <span class="n">level</span> <span class="o">=</span> <span class="n">admin</span><span class="p">.</span><span class="n">securityLevel</span><span class="p">();</span>
+        <span class="c1">//...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>{code}</p>
+<h2 id="accessdecisionvotercontext">AccessDecisionVoterContext</h2>
+<p>[TODO]</p>
+<h2 id="securitystrategy-spi">SecurityStrategy SPI</h2>
+<p>[TODO]</p>
+<h1 id="jpa">JPA</h1>
+<h2 id="transactional">@Transactional</h2>
+<p>This annotation is an alternative to transactional EJBs which allows to execute a method within a transaction.
+Before it's possible to start using the annotation, it's required to implement a CDI producer for an {{EntityManager}} and it's needed to inject the {{EntityManager}} in the bean which uses {{@Transactional}}. As shown later on it's also possible to use multiple qualifiers for using different {{EntityManager}}s.</p>
+<p>The following example shows a simple producer for an {{EntityManager}} and the corresponding dispose-method.
+Producing it as request scoped bean means that the dispose method will be called on finishing the request.
+As an alternative it's possible to use a special scope called {{@TransactionScoped}} provided by the same DeltaSpike module.</p>
+<div class="codehilite"><pre><span class="n">Producer</span> <span class="k">for</span> <span class="n">the</span> <span class="n">default</span> <span class="n">EntityManager</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">EntityManagerProducer</span>
+<span class="p">{</span>
+    <span class="o">//</span><span class="n">or</span> <span class="n">manual</span> <span class="n">bootstrapping</span>
+    <span class="p">@</span><span class="n">PersistenceContext</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Produces</span>
+    <span class="p">@</span><span class="n">RequestScoped</span>
+    <span class="n">protected</span> <span class="n">EntityManager</span> <span class="n">createEntityManager</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">this</span><span class="p">.</span><span class="n">entityManager</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">protected</span> <span class="n">void</span> <span class="n">closeEntityManager</span><span class="p">(@</span><span class="n">Disposes</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">entityManager</span><span class="p">.</span><span class="n">isOpen</span><span class="p">())</span>
+        <span class="p">{</span>
+            <span class="n">entityManager</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The following examples show how to use the {{EntityManager}} produced by the example above.</p>
+<div class="codehilite"><pre><span class="n">Beans</span> <span class="n">with</span> <span class="n">transactional</span> <span class="n">method</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">TransactionalBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="o">//</span><span class="p">...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="n">Simple</span> <span class="n">transactional</span> <span class="n">bean</span> <span class="p">(</span><span class="n">all</span> <span class="k">methods</span> <span class="n">transactional</span><span class="p">)</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="p">@</span><span class="n">Transactional</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">TransactionalBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="o">//</span><span class="p">...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>As illustrated in the following example it's also possible to use {{@Transactional}} for stereotypes.</p>
+<div class="codehilite"><pre><span class="n">Stereotype</span> <span class="k">for</span> <span class="n">transactional</span> <span class="n">beans</span> <span class="p">(</span><span class="o">+</span> <span class="n">usage</span><span class="p">)</span>
+<span class="err">@</span><span class="n">Stereotype</span>
+<span class="err">@</span><span class="n">Transactional</span>
+<span class="err">@</span><span class="n">ApplicationScoped</span>
+<span class="n">public</span> <span class="err">@</span><span class="n">interface</span> <span class="n">Repository</span>
+<span class="p">{</span>
+<span class="p">}</span>
+
+<span class="c1">//...</span>
+<span class="err">@</span><span class="n">Repository</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">TransactionalBean</span>
+<span class="p">{</span>
+    <span class="err">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="c1">//...</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>Besides such simple usages, it's also supported to use qualifiers to access multiple persistence-units in parallel.
+The default qualifier for {{@Transactional}} is {{@Any}}. Therefore a transaction for every injected entity manager will be started.
+The example afterwards shows how to change this default behaviour.</p>
+<div class="codehilite"><pre><span class="n">Producer</span> <span class="k">for</span> <span class="n">multiple</span> <span class="n">entity</span> <span class="n">managers</span> <span class="p">(</span><span class="o">+</span> <span class="n">usage</span><span class="p">)</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">EntityManagerProducer</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">PersistenceContext</span><span class="p">(</span><span class="n">unitName</span> <span class="p">=</span> &quot;<span class="n">firstDB</span>&quot;<span class="p">)</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">firstEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">PersistenceContext</span><span class="p">(</span><span class="n">unitName</span> <span class="p">=</span> &quot;<span class="n">secondDB</span>&quot;<span class="p">)</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">secondEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Produces</span>
+    <span class="p">@</span><span class="n">First</span>
+    <span class="p">@</span><span class="n">RequestScoped</span>
+    <span class="n">protected</span> <span class="n">EntityManager</span> <span class="n">createFirstEntityManager</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">this</span><span class="p">.</span><span class="n">firstEntityManager</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">protected</span> <span class="n">void</span> <span class="n">closeFirstEntityManager</span><span class="p">(@</span><span class="n">Disposes</span> <span class="p">@</span><span class="n">First</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">firstEntityManager</span><span class="p">.</span><span class="n">isOpen</span><span class="p">())</span>
+        <span class="p">{</span>
+            <span class="n">firstEntityManager</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">Produces</span>
+    <span class="p">@</span><span class="n">Second</span>
+    <span class="p">@</span><span class="n">RequestScoped</span>
+    <span class="n">protected</span> <span class="n">EntityManager</span> <span class="n">createSecondEntityManager</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">this</span><span class="p">.</span><span class="n">secondEntityManager</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">protected</span> <span class="n">void</span> <span class="n">closeSecondEntityManager</span><span class="p">(@</span><span class="n">Disposes</span> <span class="p">@</span><span class="n">Second</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">secondEntityManager</span><span class="p">.</span><span class="n">isOpen</span><span class="p">())</span>
+        <span class="p">{</span>
+            <span class="n">secondEntityManager</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+
+
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">FirstLevelTransactionBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="p">@</span><span class="n">First</span> <span class="n">EntityManager</span> <span class="n">firstEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">NestedTransactionBean</span> <span class="n">nestedTransactionBean</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="o">//</span><span class="p">...</span>
+        <span class="n">this</span><span class="p">.</span><span class="n">nestedTransactionBean</span><span class="p">.</span><span class="n">executeInTransaction</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">NestedTransactionBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="p">@</span><span class="n">Second</span> <span class="n">EntityManager</span> <span class="n">secondEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="o">//</span><span class="p">...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The following example shows how to use only the specified {{EntityManager}}/s</p>
+<div class="codehilite"><pre><span class="n">Activating</span> <span class="n">entity</span> <span class="n">managers</span> <span class="n">manually</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">MultiTransactionBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">defaultEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="p">@</span><span class="n">First</span> <span class="n">EntityManager</span> <span class="n">firstEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="p">@</span><span class="n">Second</span> <span class="n">EntityManager</span> <span class="n">secondEntityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span><span class="p">(</span><span class="n">qualifier</span> <span class="p">=</span> <span class="n">Default</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInDefaultTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">Transactional</span><span class="p">(</span><span class="n">qualifier</span> <span class="p">=</span> <span class="n">First</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInFirstTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">Transactional</span><span class="p">(</span><span class="n">qualifier</span> <span class="p">=</span> <span class="n">Second</span><span class="p">.</span><span class="n">class</span><span class="p">)</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInSecondTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+    <span class="p">}</span>
+
+    <span class="p">@</span><span class="n">Transactional</span><span class="p">(</span><span class="n">qualifier</span> <span class="p">=</span> <span class="p">{</span><span class="n">First</span><span class="p">.</span><span class="n">class</span><span class="p">,</span> <span class="n">Second</span><span class="p">.</span><span class="n">class</span><span class="p">})</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInFirstAndSecondTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>All examples also work with nested calls. In the following example the transaction handling is done on the entry point (after FirstLevelTransactionBean#executeInTransaction).</p>
+<div class="codehilite"><pre><span class="n">Joining</span> <span class="n">existing</span> <span class="n">transaction</span> <span class="n">in</span> <span class="n">nested</span> <span class="n">call</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">FirstLevelTransactionBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">NestedTransactionBean</span> <span class="n">nestedTransactionBean</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="n">this</span><span class="p">.</span><span class="n">nestedTransactionBean</span><span class="p">.</span><span class="n">executeInTransaction</span><span class="p">();</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">NestedTransactionBean</span>
+<span class="p">{</span>
+    <span class="p">@</span><span class="n">Inject</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Transactional</span>
+    <span class="n">public</span> <span class="n">void</span> <span class="n">executeInTransaction</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="o">//</span><span class="p">...</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+
+
+<p>The final transaction handling for all {{EntityManager}} s is also done after the outermost transactional method if {{NestedTransactionBean}} uses a different {{EntityManager}}.
+So it's possible to catch an exception in {{FirstLevelTransactionBean}} e.g. to try an optional path instead of an immediate rollback.</p>
+<h2 id="transactionscoped">@TransactionScoped</h2>
+<p>{{@Transactional}} also starts a context which is available as long as the transaction started by {{@Transactional}}. Besides other beans you can use this scope for the {{EntityManager}} itself. That means the {{EntityManager}} will be closed after leaving the method annotated with {{@Transactional}}.</p>
+<div class="codehilite"><pre><span class="n">Producer</span> <span class="k">for</span> <span class="n">the</span> <span class="n">default</span> <span class="n">EntityManager</span> <span class="n">which</span> <span class="n">should</span> <span class="n">be</span> <span class="n">used</span> <span class="n">only</span> <span class="k">for</span> <span class="n">one</span> <span class="n">transaction</span>
+<span class="o">//</span><span class="p">...</span>
+<span class="n">public</span> <span class="n">class</span> <span class="n">EntityManagerProducer</span>
+<span class="p">{</span>
+    <span class="o">//</span><span class="n">or</span> <span class="n">manual</span> <span class="n">bootstrapping</span>
+    <span class="p">@</span><span class="n">PersistenceContext</span>
+    <span class="n">private</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">;</span>
+
+    <span class="p">@</span><span class="n">Produces</span>
+    <span class="p">@</span><span class="n">TransactionScoped</span>
+    <span class="n">protected</span> <span class="n">EntityManager</span> <span class="n">createEntityManager</span><span class="p">()</span>
+    <span class="p">{</span>
+        <span class="k">return</span> <span class="n">this</span><span class="p">.</span><span class="n">entityManager</span><span class="p">;</span>
+    <span class="p">}</span>
+
+    <span class="n">protected</span> <span class="n">void</span> <span class="n">closeEntityManager</span><span class="p">(@</span><span class="n">Disposes</span> <span class="n">EntityManager</span> <span class="n">entityManager</span><span class="p">)</span>
+    <span class="p">{</span>
+        <span class="k">if</span> <span class="p">(</span><span class="n">entityManager</span><span class="p">.</span><span class="n">isOpen</span><span class="p">())</span>
+        <span class="p">{</span>
+            <span class="n">entityManager</span><span class="p">.</span><span class="n">close</span><span class="p">();</span>
+        <span class="p">}</span>
+    <span class="p">}</span>
+<span class="p">}</span>
+</pre></div>
+          </div>
+      </div>
+
+      <hr>
+
+      <footer>
+        <p>Copyright © 2011-2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</p>
+        <p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+      </footer>
+
+    </div> <!-- /.container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <!--<script src="./../resources/js/prettyfy.js"></script> -->
+    <script src="./../resources/js/prettyprint.js"></script>
+    <script src="./../resources/js/jquery.js"></script>
+    <script src="./../resources/js/bootstrap-transition.js"></script>
+    <script src="./../resources/js/bootstrap-alert.js"></script>
+    <script src="./../resources/js/bootstrap-modal.js"></script>
+    <script src="./../resources/js/bootstrap-dropdown.js"></script>
+    <script src="./../resources/js/bootstrap-scrollspy.js"></script>
+    <script src="./../resources/js/bootstrap-tab.js"></script>
+    <script src="./../resources/js/bootstrap-tooltip.js"></script>
+    <script src="./../resources/js/bootstrap-popover.js"></script>
+    <script src="./../resources/js/bootstrap-button.js"></script>
+    <script src="./../resources/js/bootstrap-collapse.js"></script>
+    <script src="./../resources/js/bootstrap-carousel.js"></script>
+    <script src="./../resources/js/bootstrap-typeahead.js"></script>
+</body>
+</html>

Added: websites/staging/deltaspike/trunk/content/retired/bean-validation.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/retired/bean-validation.html (added)
+++ websites/staging/deltaspike/trunk/content/retired/bean-validation.html Wed Sep 17 12:22:52 2014
@@ -0,0 +1,141 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - Bean Validation Module</title>
+
+    
+
+    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
+
+    <!-- Styles -->
+    
+    <link href="./../resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./../resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./../resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./../resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand logocolor" href="/index.html">Apache DeltaSpike</a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./../index.html">Home</a></li>
+                        <li><a href="./../documentation.html">Documentation</a></li>
+                        <li><a href="./../source.html">Source</a></li>
+                        <li><a href="./../download.html">Download</a></li>
+                        <li><a href="./../community.html">Community</a></li>
+                        <!-- <li><a href="./../support.html">Support</a></li>  -->
+                        <li><a href="./../news.html">News</a></li>
+                        <li><a href="./../migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1>Bean Validation Module</h1>
+              </div>
+              <div class="toc">
+<ul>
+<li><a href="#introduction">Introduction</a><ul>
+<li><a href="#scoping">Scoping</a></li>
+<li><a href="#code-requirements">Code Requirements</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<hr />
+<h1 id="introduction">Introduction</h1>
+<p>The main feature of the Bean Validation module is to provide CDI integration in to <code>ConstraintValidator</code>s.  This allows you to inject CDI objects, EJBs etc in to your validators.</p>
+<h2 id="scoping">Scoping</h2>
+<p><code>ConstraintValidator</code>s will inherit whatever scope as defined in the bean class. Inherently, a <code>ConstraintValidator</code> may be invoked by multiple threads so please keep that in mind when using them.  You should consider using at least <code>RequestScoped</code> validators.</p>
+<h2 id="code-requirements">Code Requirements</h2>
+<p>There are no compile dependencies to use the Bean Validation module.  You simply need to override the factory, either in Java:</p>
+<div class="codehilite"><pre><span class="n">Validation</span><span class="o">.</span><span class="na">byDefaultProvider</span><span class="o">().</span><span class="na">configure</span><span class="o">().</span><span class="na">constraintValidatorFactory</span><span class="o">(</span><span class="k">new</span> <span class="n">CDIAwareConstraintValidatorFactory</span><span class="o">()).</span><span class="na">buildValidatorFactory</span><span class="o">()</span>
+</pre></div>
+
+
+<p>Or in XML:</p>
+<div class="codehilite"><pre><span class="nt">&lt;validation-config</span> <span class="na">xmlns=</span><span class="s">&quot;http://jboss.org/xml/ns/javax/validation/configuration&quot;</span>
+ <span class="na">xmlns:xsi=</span><span class="s">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span>
+ <span class="na">xsi:schemaLocation=</span><span class="s">&quot;http://jboss.org/xml/ns/javax/validation/configuration&quot;</span><span class="nt">&gt;</span>
+    <span class="nt">&lt;constraint-validator-factory&gt;</span>org.apache.deltaspike.beanvalidation.impl.CDIAwareConstraintValidatorFactory<span class="nt">&lt;/constraint-validator-factory&gt;</span>
+<span class="nt">&lt;/validation-config&gt;</span>
+</pre></div>
+
+
+<p>And then you can simply build your <code>ConstraintValidator</code>s based on CDI programming rules.</p>
+          </div>
+      </div>
+
+      <hr>
+
+      <footer>
+        <p>Copyright © 2011-2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</p>
+        <p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+      </footer>
+
+    </div> <!-- /.container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <!--<script src="./../resources/js/prettyfy.js"></script> -->
+    <script src="./../resources/js/prettyprint.js"></script>
+    <script src="./../resources/js/jquery.js"></script>
+    <script src="./../resources/js/bootstrap-transition.js"></script>
+    <script src="./../resources/js/bootstrap-alert.js"></script>
+    <script src="./../resources/js/bootstrap-modal.js"></script>
+    <script src="./../resources/js/bootstrap-dropdown.js"></script>
+    <script src="./../resources/js/bootstrap-scrollspy.js"></script>
+    <script src="./../resources/js/bootstrap-tab.js"></script>
+    <script src="./../resources/js/bootstrap-tooltip.js"></script>
+    <script src="./../resources/js/bootstrap-popover.js"></script>
+    <script src="./../resources/js/bootstrap-button.js"></script>
+    <script src="./../resources/js/bootstrap-collapse.js"></script>
+    <script src="./../resources/js/bootstrap-carousel.js"></script>
+    <script src="./../resources/js/bootstrap-typeahead.js"></script>
+</body>
+</html>

Added: websites/staging/deltaspike/trunk/content/retired/build.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/retired/build.html (added)
+++ websites/staging/deltaspike/trunk/content/retired/build.html Wed Sep 17 12:22:52 2014
@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - Building DeltaSpike from source</title>
+
+    
+
+    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
+
+    <!-- Styles -->
+    
+    <link href="./../resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./../resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./../resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./../resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand logocolor" href="/index.html">Apache DeltaSpike</a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./../index.html">Home</a></li>
+                        <li><a href="./../documentation.html">Documentation</a></li>
+                        <li><a href="./../source.html">Source</a></li>
+                        <li><a href="./../download.html">Download</a></li>
+                        <li><a href="./../community.html">Community</a></li>
+                        <!-- <li><a href="./../support.html">Support</a></li>  -->
+                        <li><a href="./../news.html">News</a></li>
+                        <li><a href="./../migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1>Building DeltaSpike from source</h1>
+              </div>
+              <div class="toc">
+<ul>
+<li><a href="#introduction">Introduction</a><ul>
+<li><a href="#full-build">Full build</a></li>
+<li><a href="#build-with-test">Build with test</a></li>
+<li><a href="#integration-tests">Integration Tests</a><ul>
+<li><a href="#tomee">TomEE</a></li>
+<li><a href="#jboss-as7">JBoss AS7</a><ul>
+<li><a href="#without-existing-as7">Without existing AS7</a></li>
+<li><a href="#with-existing-as7">With existing AS7</a></li>
+</ul>
+</li>
+<li><a href="#wildfly-8">WildFly 8</a><ul>
+<li><a href="#without-existing-wf8">Without existing WF8</a></li>
+<li><a href="#with-existing-wf8">With existing WF8</a></li>
+</ul>
+</li>
+<li><a href="#glassfish-31">GlassFish 3.1</a><ul>
+<li><a href="#without-existing-gf3">Without existing GF3</a></li>
+<li><a href="#with-existing-gf3">With existing GF3</a></li>
+</ul>
+</li>
+<li><a href="#glassfish-4">GlassFish 4</a><ul>
+<li><a href="#without-existing-gf4">Without existing GF4</a></li>
+</ul>
+</li>
+<li><a href="#weblogic-12c">WebLogic 12c</a></li>
+</ul>
+</li>
+<li><a href="#jenkins-builds">Jenkins Builds</a></li>
+<li><a href="#sonar">Sonar</a></li>
+</ul>
+</li>
+</ul>
+</div>
+<hr />
+<h1 id="introduction">Introduction</h1>
+<p>Deltaspike uses <a href="http://maven.apache.org/">maven</a> build tool to automate the compilation, testing and packaging of the project</p>
+<h2 id="full-build">Full build</h2>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span>
+</pre></div>
+
+
+<h2 id="build-with-test">Build with test</h2>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">POWB</span> <span class="o">//</span><span class="n">execute</span> <span class="n">the</span> <span class="n">unit</span> <span class="n">tests</span> <span class="n">with</span> <span class="n">OpenWebBeans</span>
+<span class="n">or</span>
+<span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">PWeld</span> <span class="o">//</span><span class="n">execute</span> <span class="n">the</span> <span class="n">unit</span> <span class="n">tests</span> <span class="n">with</span> <span class="n">Weld</span>
+</pre></div>
+
+
+<h2 id="integration-tests">Integration Tests</h2>
+<p>With the unpack Maven-Plugin all Arquillian-Tests get copied to the integration-test module. Together with the special integration-tests they get executed via a remote container. Currently we have configurations for the following containers.</p>
+<h3 id="tomee">TomEE</h3>
+<p><strong>Executing the Arquillian tests with Apache TomEE</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Ptomee</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">managed</span>
+</pre></div>
+
+
+<h3 id="jboss-as7">JBoss AS7</h3>
+<h4 id="without-existing-as7">Without existing AS7</h4>
+<p><strong>Executing the Arquillian tests with JBoss AS7 (without AS7 installation)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pjbossas</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">managed</span><span class="o">-</span>7
+</pre></div>
+
+
+<h4 id="with-existing-as7">With existing AS7</h4>
+<p>Set JBoss_HOME</p>
+<p><strong>Executing the Arquillian tests with JBoss AS7 (AS7 installation required)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pjbossas</span><span class="o">-</span><span class="n">managed</span><span class="o">-</span>7
+</pre></div>
+
+
+<h3 id="wildfly-8">WildFly 8</h3>
+<h4 id="without-existing-wf8">Without existing WF8</h4>
+<p><strong>Executing the Arquillian tests with JBoss-WF8 (without WF8 installation)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pwildfly</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">managed</span>
+</pre></div>
+
+
+<h4 id="with-existing-wf8">With existing WF8</h4>
+<p>Set WILDFLY_HOME</p>
+<p><strong>Executing the Arquillian tests with JBoss-WF8 (WF8 installation required)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pwildfly</span><span class="o">-</span><span class="n">managed</span>
+</pre></div>
+
+
+<h3 id="glassfish-31">GlassFish 3.1</h3>
+<h4 id="without-existing-gf3">Without existing GF3</h4>
+<p><strong>Executing the Arquillian tests with GF3 (without GF3 installation)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pglassfish</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">managed</span><span class="o">-</span>3
+</pre></div>
+
+
+<h4 id="with-existing-gf3">With existing GF3</h4>
+<p>Install GlassFish (default setup without admin-password) and start GlassFish with asadmin start-domain <strong>and</strong> asadmin start-database</p>
+<p><strong>Executing the Arquillian tests with Oracle Glassfish 3.1+</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pglassfish</span><span class="o">-</span><span class="n">remote</span><span class="o">-</span>3<span class="p">.</span>1
+</pre></div>
+
+
+<h3 id="glassfish-4">GlassFish 4</h3>
+<h4 id="without-existing-gf4">Without existing GF4</h4>
+<p><strong>Executing the Arquillian tests with GF4 (without GF4 installation)</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pglassfish</span><span class="o">-</span><span class="n">build</span><span class="o">-</span><span class="n">managed</span><span class="o">-</span>4
+</pre></div>
+
+
+<h3 id="weblogic-12c">WebLogic 12c</h3>
+<p>Install WebLogic 12c. Start Confiuration Wizard to create a new basic WebLogic Domain. Default options and domain name = base_domain, administrator user name = weblogic1, administrator password = weblogic1.
+Set WLS_HOME so that %WLS_HOME%\server\lib\weblogic.jar exists.
+Start the domain.</p>
+<p><strong>Executing the Arquillian tests with Oracle WebLogic 12c</strong></p>
+<div class="codehilite"><pre><span class="n">mvn</span> <span class="n">clean</span> <span class="n">install</span> <span class="o">-</span><span class="n">Pwls</span><span class="o">-</span><span class="n">remote</span><span class="o">-</span>12<span class="n">c</span>
+</pre></div>
+
+
+<h2 id="jenkins-builds">Jenkins Builds</h2>
+<p><a href="https://builds.apache.org/view/A-D/view/DeltaSpike/">https://builds.apache.org/view/A-D/view/DeltaSpike/</a></p>
+<h2 id="sonar">Sonar</h2>
+<p>https://analysis.apache.org/dashboard/index/org.apache.deltaspike:deltaspike-project</p>
+          </div>
+      </div>
+
+      <hr>
+
+      <footer>
+        <p>Copyright © 2011-2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</p>
+        <p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+      </footer>
+
+    </div> <!-- /.container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <!--<script src="./../resources/js/prettyfy.js"></script> -->
+    <script src="./../resources/js/prettyprint.js"></script>
+    <script src="./../resources/js/jquery.js"></script>
+    <script src="./../resources/js/bootstrap-transition.js"></script>
+    <script src="./../resources/js/bootstrap-alert.js"></script>
+    <script src="./../resources/js/bootstrap-modal.js"></script>
+    <script src="./../resources/js/bootstrap-dropdown.js"></script>
+    <script src="./../resources/js/bootstrap-scrollspy.js"></script>
+    <script src="./../resources/js/bootstrap-tab.js"></script>
+    <script src="./../resources/js/bootstrap-tooltip.js"></script>
+    <script src="./../resources/js/bootstrap-popover.js"></script>
+    <script src="./../resources/js/bootstrap-button.js"></script>
+    <script src="./../resources/js/bootstrap-collapse.js"></script>
+    <script src="./../resources/js/bootstrap-carousel.js"></script>
+    <script src="./../resources/js/bootstrap-typeahead.js"></script>
+</body>
+</html>

Added: websites/staging/deltaspike/trunk/content/retired/configuration.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/retired/configuration.html (added)
+++ websites/staging/deltaspike/trunk/content/retired/configuration.html Wed Sep 17 12:22:52 2014
@@ -0,0 +1,324 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <meta name="description" content="deltaspike-generate-pages">
+    <meta name="author" content="chm">
+
+    <title>Apache DeltaSpike - DeltaSpike Configuration Mechanism</title>
+
+    
+
+    
+    <!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file to you under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License.  You may obtain a copy of the License at . http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License. -->
+
+    <!-- Styles -->
+    
+    <link href="./../resources/css/bootstrap.css" rel="stylesheet">    
+    <!--<link href="./../resources/css/prettify.css" rel="stylesheet" /> -->
+    <link href="./../resources/css/codehilite.css" rel="stylesheet" />
+    <link href="./../resources/css/bootstrap-responsive.css" rel="stylesheet">
+    <style type="text/css">
+        body {
+            padding-top: 60px;
+            padding-bottom: 40px;
+        }
+    </style>
+	<script type="text/javascript">
+
+	  var _gaq = _gaq || [];
+	  _gaq.push(['_setAccount', 'UA-36103647-1']);
+	  _gaq.push(['_trackPageview']);
+	
+	  (function() {
+		var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+		ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+		var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+	  })();
+	
+	</script>
+</head>
+
+<body>
+    <div class="navbar navbar-fixed-top">
+        <div class="navbar-inner">
+            <div class="container">
+                <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                    <span class="icon-bar"></span>
+                </a>
+                <a class="brand logocolor" href="/index.html">Apache DeltaSpike</a>
+                <div class="nav-collapse">
+                    <ul class="nav">
+                        <li class="active"><a href="./../index.html">Home</a></li>
+                        <li><a href="./../documentation.html">Documentation</a></li>
+                        <li><a href="./../source.html">Source</a></li>
+                        <li><a href="./../download.html">Download</a></li>
+                        <li><a href="./../community.html">Community</a></li>
+                        <!-- <li><a href="./../support.html">Support</a></li>  -->
+                        <li><a href="./../news.html">News</a></li>
+                        <li><a href="./../migration-guide.html">Migration</a></li>
+                    </ul>
+                </div><!--/.nav-collapse -->
+                <form id="search-form" action="http://www.google.com/search" method="get"  class="navbar-search pull-right" >
+                    <input value="deltaspike.apache.org" name="sitesearch" type="hidden"/>
+                    <input class="search-query" name="q" id="query" type="text" />
+                </form>
+            </div>
+        </div>
+    </div>
+
+    <div class="container">
+      <div class="row">
+          <div class="span12">
+              <div class="page-title">
+                <h1>DeltaSpike Configuration Mechanism</h1>
+              </div>
+              <div class="toc">
+<ul>
+<li><a href="#configuration-basics">Configuration Basics</a><ul>
+<li><a href="#benefits-for-production">Benefits for Production</a></li>
+<li><a href="#drop-in-configuration">Drop-In Configuration</a></li>
+<li><a href="#cdi-extension-configuration">CDI-Extension Configuration</a></li>
+<li><a href="#userland-configuration">Userland Configuration</a></li>
+</ul>
+</li>
+<li><a href="#configresolver">ConfigResolver</a><ul>
+<li><a href="#getpropertyvalue">getPropertyValue()</a></li>
+<li><a href="#getprojectstageawarepropertyvalue">getProjectStageAwarePropertyValue()</a></li>
+<li><a href="#getpropertyawarepropertyvalue">getPropertyAwarePropertyValue()</a></li>
+<li><a href="#handling-of-default-values">handling of default values</a></li>
+</ul>
+</li>
+<li><a href="#configsource">ConfigSource</a><ul>
+<li><a href="#configsources-provided-by-default">ConfigSources provided by default</a></li>
+<li><a href="#reordering-of-the-default-order-of-config-sources">Reordering of the default order of Config-Sources</a></li>
+<li><a href="#custom-config-sources">Custom Config-Sources</a><ul>
+<li><a href="#propertyfileconfig">PropertyFileConfig</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#type-safe-configuration">Type-safe configuration</a></li>
+</ul>
+</div>
+<hr />
+<h1 id="configuration-basics">Configuration Basics</h1>
+<p>The goal of the DeltaSpike configuration mechanism is to make it obsolete to touch
+released binaries for changing the configuration of your project.
+All values which are needed in your code (but should not be hardcoded as static final constants) can be
+maintained via DeltaSpikes own configuration mechanism in a very flexible and powerful way.</p>
+<h3 id="benefits-for-production">Benefits for Production</h3>
+<p>Once a binary like a WAR file or an EAR got created and tested, it must <em>not</em> get changed anymore.
+The exact same binary which got created by the release manager will get moved to the Test system,
+then further propagated to the Staging environment and finally (if all people are happy with it)
+will get moved to the Production system. And all this without any changes on the binary itself!</p>
+<p>The Apache DeltaSpike configuration system makes this possible by providing a default configuration
+inside the binary and allowing to amend this configuration (e.g. database credentials,
+some URLs from remote REST or SOAP endpoints, etc) from outside
+like environment settings, JNDI or the current <a href="projectstage.html">ProjectStage</a>.</p>
+<h3 id="drop-in-configuration">Drop-In Configuration</h3>
+<p>This mechanism also allows for dynamic configuration in case of a JAR drop-in.
+By adding some JAR to the classpath, all it's contained configuration will get picked up
+and considered in the property value evaluation.
+You could also use this mechanism to switch implementations of some SPI
+(Service Provider Interface) in your own code.</p>
+<h3 id="cdi-extension-configuration">CDI-Extension Configuration</h3>
+<p>In some cases low-level configs are needed e.g. during the bootstrapping process of the CDI container.</p>
+<p>The good news: our DeltaSpike configuration mechanism does not rely on any other EE mechanism to
+be booted. Which means it can perfectly get used to even configure those parts itself.
+Since the mechanism doesn't rely on CDI it can for example be used to configure CDI-Extensions.</p>
+<p>Currently this is e.g. used to configure the value of the current <a href="projectstage.html">ProjectStage</a>,
+configured values which can be used in the expressions for <code>@Exclude</code>, 'Deactivatable', etc.
+DeltaSpike needs such a low-level approach for several features internally,
+but users can utilize it for their own needs as well.
+This is done by using the <code>ConfigResolver</code> which resolves and caches <code>ConfigSource</code>s per application.</p>
+<h3 id="userland-configuration">Userland Configuration</h3>
+<p>DeltaSpike also provides a mechanism to inject those configured values using the
+<code>@ConfigProperty</code> CDI Qualifier.</p>
+<h1 id="configresolver">ConfigResolver</h1>
+<p>The <code>ConfigResolver</code> is the central point to pick up configured values in DeltaSpike.</p>
+<h3 id="getpropertyvalue">getPropertyValue()</h3>
+<p>The method <code>ConfigResolver#getPropertyValue(String key)</code> allows to provide a string based key and
+returns the configured value as <code>String</code>, or <code>null</code> if no value has been found.</p>
+<p><code>ConfigResolver#getAllPropertyValues(String key)</code> has a similar contract but it returns a list which might
+be empty if there are no configured values for the given key.</p>
+<p>This is a code excerpt about how to do a simple lookup in the deltaspike configuration:</p>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">dbUserName</span> <span class="o">=</span> <span class="n">ConfigResolver</span><span class="o">.</span><span class="na">getPropertyValue</span><span class="o">(</span><span class="s">&quot;databaseconfig.username&quot;</span><span class="o">);</span>
+</pre></div>
+
+
+<h3 id="getprojectstageawarepropertyvalue">getProjectStageAwarePropertyValue()</h3>
+<p>The method <code>ConfigResolver#getProjectStageAwarePropertyValue(String key)</code> utilizes the
+<a href="projectstage.html">DeltaSpike ProjectStage</a> mechanism to allow configured values
+to depend on the current <code>ProjectStage</code> of the system we run on.</p>
+<p>This is done by first looking up the ProjectStage (this internally happens with the
+DeltaSpike ConfigResolver as well) and then go down the following lookup chain until
+we found a configured value.</p>
+<ul>
+<li>key + '.' + projectStage , e.g. "databaseconfig.username.Production"</li>
+<li>key alone , e.g. "databaseconfig.username"</li>
+</ul>
+<h3 id="getpropertyawarepropertyvalue">getPropertyAwarePropertyValue()</h3>
+<p>The method <code>ConfigResolver#getProjectStageAwarePropertyValue(String key, String property)</code>
+first looks up the configured value of the given property and uses this value to determine
+the final lookup path. All those lookups take the <a href="projectstage.html">DeltaSpike ProjectStage</a>
+mechanism into account.</p>
+<p>Given we have the following code in our program:</p>
+<div class="codehilite"><pre><span class="n">String</span> <span class="n">dbUserName</span> <span class="o">=</span> <span class="n">ConfigResolver</span><span class="o">.</span><span class="na">getPropertyAwarePropertyValue</span><span class="o">(</span><span class="s">&quot;databaseconfig.username&quot;</span><span class="o">,</span> <span class="s">&quot;dbvendor&quot;</span><span class="o">);</span>
+</pre></div>
+
+
+<p>This will end up in the following lookup sequences. First we need to resolve the value of the property:</p>
+<ul>
+<li>propertyValue = property + '.'  + projectStage, e.g. "dbvendor.Production"</li>
+<li>if nothing found: propertyValue = property, e.g. "dbvendor"</li>
+</ul>
+<p>Let's assume we found the value 'mysql' for our dbvendor. In this case the following
+lookup chain is used until a value got found:</p>
+<ul>
+<li>key + '.' + property + projectstage, e.g. "databaseconfig.username.mysql.Production"</li>
+<li>key + '.' + property, e.g. "databaseconfig.username.mysql"</li>
+<li>key + '.' + projectstage, e.g. "databaseconfig.username.Production"</li>
+<li>key,  e.g. "databaseconfig.username"</li>
+</ul>
+<h3 id="handling-of-default-values">handling of default values</h3>
+<p>There is a 2nd variant of all those methods where it is possible to provide a
+default value which gets returned instead of <code>null</code> or if the final result is an empty String.</p>
+<p><strong>Performance Hint:</strong></p>
+<p>The only <code>ConfigResolver</code> operation which is cached is the determination of the <code>ConfigSources</code>.
+The various getPropertyValue operations are not cached in the ConfigResolver but might be cached in
+the ConfigSources. This makes the overall calculation a bit slower, but allows for values to change
+dynamically if someone likes to e.g. implement a <code>JmxConfigSource</code> (not yet part of DeltaSpike,
+but easily implementable).</p>
+<h1 id="configsource">ConfigSource</h1>
+<p>A <code>ConfigSource</code> is exactly what it's name says: a source for configured values.
+The <code>ConfigResolver</code> uses all configured implementations of <code>ConfigSource</code> to lookup the property in question.</p>
+<p>Each 'ConfigSource' has a specified 'ordinal' which can be configured using the key <code>deltaspike_ordinal</code>.
+This ordinal get's used to determine the importance of the values taken from the very ConfigSource.
+A higher ordinal means that the values taken from this ConfigSource will override values from less important
+ConfigSources. This is the trick which allows to amend configuration from outside a binary - given
+those outside ConfigSources have a higher <code>deltaspike_ordinal</code> than the ones who pickup the values from
+within the release binaries.</p>
+<h3 id="configsources-provided-by-default">ConfigSources provided by default</h3>
+<p>Per default there are implementations for the following config sources (listed in the lookup order):</p>
+<ul>
+<li>System properties (deltaspike_ordinal = 400)</li>
+<li>Environment properties (deltaspike_ordinal = 300)</li>
+<li>JNDI values (deltaspike_ordinal = 200, the base name is "java:comp/env/deltaspike/")</li>
+<li>Properties file values (apache-deltaspike.properties) (deltaspike_ordinal = 100, default filename is "META-INF/apache-deltaspike.properties")</li>
+</ul>
+<p><strong>It's possible to change this order and to add custom config sources.</strong></p>
+<p><strong>Note:</strong> Important Hints esp. for custom implementations:
+  - The config-source with the highest ordinal gets used first.
+  - If a custom implementation should be invoked <em>before</em> the default implementations, use an ordinal-value &gt; 400
+  - If a custom implementation should be invoked <em>after</em> the default implementations, use an ordinal-value &lt; 100
+  - The <code>ConfigResolver</code> performs no caching. If your custom ConfigSource operation is expensive, then you might
+    think about introducing some caching.</p>
+<h3 id="reordering-of-the-default-order-of-config-sources">Reordering of the default order of Config-Sources</h3>
+<p>To change the lookup order, you have to configure the ordinal in the corresponding config source
+(e.g. to change the config ordinal of the config source for system properties, you have to set
+the system property with the ordinal key 'deltaspike_ordinal' and the new value).</p>
+<p>Example with <code>/META-INF/apache-deltaspike.properties</code>: If the properties file/s should be used
+<strong>before</strong> the other implementations, you have to configure an ordinal &gt; 400.
+That means, you have to add e.g. <code>deltaspike_ordinal=401</code>.</p>
+<p>Each single property file is treated as own <code>ConfigSource</code> and thus can have different
+<code>deltaspike_ordinal</code> values!</p>
+<p><strong>Hint:</strong></p>
+<p>In case of <strong>property files</strong> which are supported by default (<code>/META-INF/apache-deltaspike.properties</code>)
+every file is handled as independent config-source, but all of them have ordinal 400 by default (and can be reordered in a fine-grained manner).</p>
+<h2 id="custom-config-sources">Custom Config-Sources</h2>
+<p>ConfigSources are picked up using the `java.util.ServiceLoader' mechanism.</p>
+<p>To add a custom config-source, you have to implement the interface <code>ConfigSource</code> and register
+your implementation in a file
+<code>/META-INF/services/org.apache.deltaspike.core.spi.config.ConfigSource</code>
+by writing the fully qualified class name of the custom implementation/s into it.</p>
+<p>If you need dynamic ConfigSources you can also register a <code>ConfigSourceProvider</code> in a similar way.
+This is useful if you like to dynamically pick up multiple ConfigSources of the same kind.
+E.g. if you like to pick up all <code>myproject.properties</code> files from all the JARs in your classpath.</p>
+<p>Please note that a single <code>ConfigSource</code> should be either registered directly or
+via a <code>ConfigSourceProvider</code>, but never both ways.</p>
+<p><strong>Important Hint:</strong></p>
+<p>Have a look at the abstract base-implementation of <code>ConfigSource</code> DeltaSpike is using internally,
+if a custom implementation should load the ordinal value from the config-source
+like the default implementations provided by DeltaSpike do.</p>
+<h3 id="propertyfileconfig">PropertyFileConfig</h3>
+<p>For registering all your own property files of a certain name in your classpath
+to get picked up as <code>ConfigSource</code>s you can also provide a class
+which implements the <code>PropertyFileConfig</code> interface.</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyCustomPropertyFileConfig</span> <span class="kd">implements</span> <span class="n">PropertyFileConfig</span>
+<span class="o">{</span>
+    <span class="nd">@Override</span>
+    <span class="kd">public</span> <span class="n">String</span> <span class="nf">getPropertyFileName</span><span class="o">()</span>
+    <span class="o">{</span>
+        <span class="k">return</span> <span class="s">&quot;myconfig.properties&quot;</span><span class="o">;</span>
+    <span class="o">}</span>
+<span class="o">}</span>
+</pre></div>
+
+
+<p><em>Note: If you are using WildFly with EAR packaging and with ear-subdeployments-isolated=true, then your EAR should have a deployment dependency to the module that contains the property file.</em></p>
+<div class="codehilite"><pre><span class="nt">&lt;jboss-deployment-structure&gt;</span>
+    <span class="nt">&lt;ear-subdeployments-isolated&gt;</span>true<span class="nt">&lt;/ear-subdeployments-isolated&gt;</span>
+      <span class="nt">&lt;deployment&gt;</span>
+            <span class="nt">&lt;dependencies&gt;</span>
+            <span class="c">&lt;!-- This module contains the custom PropertyFileConfig and the property file --&gt;</span>
+                  <span class="nt">&lt;module</span> <span class="na">name=</span><span class="s">&quot;deployment.yourproject.ear.yoursubmodule.jar&quot;</span>  <span class="na">meta-inf=</span><span class="s">&quot;import&quot;</span> <span class="nt">/&gt;</span>
+            <span class="nt">&lt;/dependencies&gt;</span>
+     <span class="nt">&lt;/deployment&gt;</span>
+<span class="nt">&lt;/jboss-deployment-structure&gt;</span>
+</pre></div>
+
+
+<h1 id="type-safe-configuration">Type-safe configuration</h1>
+<p>DeltaSpike provides a way to directly inject configured values into your code
+via the qualifier <code>@ConfigProperty</code>.</p>
+<div class="codehilite"><pre><span class="nd">@ApplicationScoped</span>
+<span class="kd">public</span> <span class="kd">class</span> <span class="nc">SomeRandomService</span>
+<span class="o">{</span>
+    <span class="nd">@Inject</span>
+    <span class="nd">@ConfigProperty</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;endpoint.poll.interval&quot;</span><span class="o">)</span>
+    <span class="kd">private</span> <span class="n">Integer</span> <span class="n">pollInterval</span><span class="o">;</span>
+
+    <span class="nd">@Inject</span>
+    <span class="nd">@ConfigProperty</span><span class="o">(</span><span class="n">name</span> <span class="o">=</span> <span class="s">&quot;endpoint.poll.servername&quot;</span><span class="o">)</span>
+    <span class="kd">private</span> <span class="n">String</span> <span class="n">pollUrl</span><span class="o">;</span>
+
+    <span class="o">...</span>
+ <span class="o">}</span>
+</pre></div>
+          </div>
+      </div>
+
+      <hr>
+
+      <footer>
+        <p>Copyright © 2011-2014 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.</p>
+        <p>Apache and the Apache feather logo are trademarks of The Apache Software Foundation.</p>
+      </footer>
+
+    </div> <!-- /.container -->
+
+    <!-- Javascript
+    ================================================== -->
+    <!-- Placed at the end of the document so the pages load faster -->
+    <!--<script src="./../resources/js/prettyfy.js"></script> -->
+    <script src="./../resources/js/prettyprint.js"></script>
+    <script src="./../resources/js/jquery.js"></script>
+    <script src="./../resources/js/bootstrap-transition.js"></script>
+    <script src="./../resources/js/bootstrap-alert.js"></script>
+    <script src="./../resources/js/bootstrap-modal.js"></script>
+    <script src="./../resources/js/bootstrap-dropdown.js"></script>
+    <script src="./../resources/js/bootstrap-scrollspy.js"></script>
+    <script src="./../resources/js/bootstrap-tab.js"></script>
+    <script src="./../resources/js/bootstrap-tooltip.js"></script>
+    <script src="./../resources/js/bootstrap-popover.js"></script>
+    <script src="./../resources/js/bootstrap-button.js"></script>
+    <script src="./../resources/js/bootstrap-collapse.js"></script>
+    <script src="./../resources/js/bootstrap-carousel.js"></script>
+    <script src="./../resources/js/bootstrap-typeahead.js"></script>
+</body>
+</html>



Mime
View raw message