deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r921871 [4/7] - in /websites/staging/deltaspike/trunk/content: ./ documentation/
Date Thu, 11 Sep 2014 14:16:50 GMT
Modified: websites/staging/deltaspike/trunk/content/documentation/deltaspike_1.0.2.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/documentation/deltaspike_1.0.2.html (original)
+++ websites/staging/deltaspike/trunk/content/documentation/deltaspike_1.0.2.html Thu Sep 11 14:16:50 2014
@@ -188,7 +188,7 @@ body {
 <p>The DeltaSpike team is proud to announce the release of v1.0.2.  See <a href="http://apache-deltaspike-incubator-discussions.2316169.n4.nabble.com/ANNOUNCE-Release-of-Apache-DeltaSpike-1-0-2-td4658671.html" target="_blank">our release announcement email</a> for additional information.</p>
 </div>
 <div class="paragraph">
-<p>Please read our <a href="http://deltaspike.apache.org/documentation.html#getting-started" target="_blank">setup guide</a> to add DeltaSpike to your application.</p>
+<p>Please read our <a href="index.html#_getting_started">setup guide</a> to add DeltaSpike to your application.</p>
 </div>
 </div>
 </div>

Added: websites/staging/deltaspike/trunk/content/documentation/index.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/documentation/index.html (added)
+++ websites/staging/deltaspike/trunk/content/documentation/index.html Thu Sep 11 14:16:50 2014
@@ -0,0 +1,1100 @@
+<!DOCTYPE html>
+<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>Documentation</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="http://deltaspike.apache.org/resources/css/bootstrap.css" rel="stylesheet">
+<link href="http://deltaspike.apache.org/resources/css/bootstrap-responsive.css" rel="stylesheet">
+
+<style type="text/css">
+/* Foundation stylesheet for CodeRay (to match GitHub theme) | MIT License | http://foundation.zurb.com */
+table.CodeRay { border-collapse: collapse; padding: 2px; margin-bottom: 0; border: 0; background: transparent; }
+table.CodeRay td { padding: 0 .5em; vertical-align: top; }
+table.CodeRay td.line-numbers { text-align: right; color: #999; border-right: 1px solid #e5e5e5; padding-left: 0; }
+span.line-numbers { border-right: 1px solid #E5E5E5; color: #999; display: inline-block; margin-right: 0.5em; padding-right: 0.5em; }
+.CodeRay td.line-numbers strong, .CodeRay span.line-numbers strong { font-weight: normal; }
+.CodeRay .debug { color: white !important; background: blue !important; }
+.CodeRay .annotation { color: #007; }
+.CodeRay .attribute-name { color: #f08; }
+.CodeRay .attribute-value { color: #700; }
+.CodeRay .binary { color: #509; }
+.CodeRay .comment  { color: #999; font-style: italic; }
+.CodeRay .char { color: #04D; }
+.CodeRay .char .content { color: #04D; }
+.CodeRay .char .delimiter { color: #039; }
+.CodeRay .class { color: #458; }
+.CodeRay .complex { color: #A08; }
+.CodeRay .constant { color: teal; }
+.CodeRay .color { color: #0A0; }
+.CodeRay .class-variable { color: #369; }
+.CodeRay .decorator { color: #B0B; }
+.CodeRay .definition { color: #099; }
+.CodeRay .directive { color: #088; }
+.CodeRay .delimiter { color: black; }
+.CodeRay .doc { color: #970; }
+.CodeRay .doctype { color: #34b; }
+.CodeRay .doc-string { color: #D42; }
+.CodeRay .escape  { color: #666; }
+.CodeRay .entity { color: #800; }
+.CodeRay .error { color: #808; }
+.CodeRay .exception { color: #C00; }
+.CodeRay .filename { color: #099; }
+.CodeRay .function { color: #900; }
+.CodeRay .global-variable { color: teal; }
+.CodeRay .hex { color: #058; }
+.CodeRay .integer  { color: #099; }
+.CodeRay .include { color: #B44; }
+.CodeRay .inline { color: black; }
+.CodeRay .inline .inline { background: #ccc; }
+.CodeRay .inline .inline .inline { background: #bbb; }
+.CodeRay .inline .inline-delimiter { color: #D14; }
+.CodeRay .inline-delimiter { color: #D14; }
+.CodeRay .important { color: #f00; }
+.CodeRay .interpreted { color: #B2B; }
+.CodeRay .instance-variable { color: teal; }
+.CodeRay .label { color: #970; }
+.CodeRay .local-variable { color: #963; }
+.CodeRay .octal { color: #40E; }
+.CodeRay .predefined { color: #369; }
+.CodeRay .preprocessor { color: #579; }
+.CodeRay .pseudo-class { color: #00C; }
+.CodeRay .predefined-type { color: #074; }
+.CodeRay .reserved, .keyword  { color: #000; }
+.CodeRay .key { color: #808; }
+.CodeRay .key .delimiter { color: #606; }
+.CodeRay .key .char { color: #80f; }
+.CodeRay .value { color: #088; }
+.CodeRay .regexp { background-color: #fff0ff; }
+.CodeRay .regexp .content { color: #808; }
+.CodeRay .regexp .delimiter { color: #404; }
+.CodeRay .regexp .modifier { color: #C2C; }
+.CodeRay .regexp .function  { color: #404; font-weight: bold; }
+.CodeRay .string { color: #D20; }
+.CodeRay .string .string { }
+.CodeRay .string .string .string { background-color: #ffd0d0; }
+.CodeRay .string .content { color: #D14; }
+.CodeRay .string .char { color: #D14; }
+.CodeRay .string .delimiter { color: #D14; }
+.CodeRay .shell { color: #D14; }
+.CodeRay .shell .content { }
+.CodeRay .shell .delimiter { color: #D14; }
+.CodeRay .symbol { color: #990073; }
+.CodeRay .symbol .content { color: #A60; }
+.CodeRay .symbol .delimiter { color: #630; }
+.CodeRay .tag, .CodeRay .attribute-name { color: #070; }
+.CodeRay .tag-special { color: #D70; }
+.CodeRay .type { color: #339; }
+.CodeRay .variable  { color: #036; }
+.CodeRay .insert { background: #afa; }
+.CodeRay .delete { background: #faa; }
+.CodeRay .change { color: #aaf; background: #007; }
+.CodeRay .head { color: #f8f; background: #505; }
+.CodeRay .insert .insert { color: #080; }
+.CodeRay .delete .delete { color: #800; }
+.CodeRay .change .change { color: #66f; }
+.CodeRay .head .head { color: #f4f; }
+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="http://deltaspike.apache.org/index.html">Apache
+					DeltaSpike</a>
+				<div class="nav-collapse">
+					<ul class="nav">
+						<li class="active"><a
+							href="http://deltaspike.apache.org/index.html">Home</a></li>
+						<li><a href="http://deltaspike.apache.org/documentation">Documentation</a></li>
+						<li><a href="http://deltaspike.apache.org/source.html">Source</a></li>
+						<li><a href="http://deltaspike.apache.org/download.html">Download</a></li>
+						<li><a href="http://deltaspike.apache.org/community.html">Community</a></li>
+						<!-- <li><a href="./support.html">Support</a></li>  -->
+						<li><a href="http://deltaspike.apache.org/news.html">News</a></li>
+						<li><a
+							href="http://deltaspike.apache.org/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>Documentation</h1>
+                </div>
+
+				<div id="toc" class="toc2">
+       	 		<ul class="sectlevel1">
+<li><a href="#_introduction">Introduction</a></li>
+<li>
+<ul class="sectlevel2">
+<li><a href="#_what_is_a_portable_cdi_extension">What is a portable CDI extension ?</a></li>
+<li><a href="#_deltaspike_in_a_nutshell">DeltaSpike in a nutshell</a></li>
+<li>
+<ul class="sectlevel3">
+<li><a href="#_java_ee_7_without_java_ee_7">Java EE 7 without Java EE 7!</a></li>
+<li><a href="#_jsf_improvements">JSF Improvements</a></li>
+<li><a href="#_productivity_improvements">Productivity Improvements</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#_getting_started">Getting Started</a></li>
+<li>
+<ul class="sectlevel2">
+<li><a href="#_project_configuration_without_maven">Project Configuration without Maven</a></li>
+<li><a href="#_project_configuration_with_maven">Project Configuration with Maven</a></li>
+<li>
+<ul class="sectlevel3">
+<li><a href="#_configuration_of_deltaspike_core">Configuration of DeltaSpike Core</a></li>
+<li><a href="#_configuration_of_deltaspike_modules">Configuration of DeltaSpike Modules</a></li>
+<li><a href="#_with_java_se">With Java SE</a></li>
+<li><a href="#__for_apache_openwebbeans"> &#8230; for Apache OpenWebBeans</a></li>
+<li><a href="#__for_jboss_weld_ri"> &#8230; for JBoss Weld (RI)</a></li>
+<li><a href="#_for_embedded_servlet_runtimes_you_can_add">For Embedded Servlet Runtimes, you can add</a></li>
+<li><a href="#_testing_snapshots">Testing Snapshots</a></li>
+</ul>
+</li>
+</ul>
+</li>
+<li><a href="#_deployment_mode">Deployment mode</a></li>
+<li>
+<ul class="sectlevel2">
+<li><a href="#_with_java_ee6">With Java EE6+</a></li>
+<li><a href="#_with_java_ee5_or_servlet_containers">With Java EE5 or Servlet Containers</a></li>
+<li><a href="#_standard_java_se6">Standard Java SE6+</a></li>
+</ul>
+</li>
+<li><a href="#_start_a_cdi_container_using_java_se">Start a CDI container using Java SE</a></li>
+<li><a href="#_module_overview">Module Overview</a></li>
+<li>
+<ul class="sectlevel2">
+<li><a href="#_core_required">Core (required)</a></li>
+<li><a href="#_security_optional">Security (optional)</a></li>
+<li><a href="#_jpa_optional">JPA (optional)</a></li>
+<li><a href="#_jsf_optional">JSF (optional)</a></li>
+<li><a href="#_container_control_optional">Container Control (optional)</a></li>
+<li><a href="#_bean_validation_optional">Bean Validation (optional)</a></li>
+<li><a href="#_servlet_optional">Servlet (optional)</a></li>
+<li><a href="#_partial_bean_optional">Partial-Bean (optional)</a></li>
+<li><a href="#_data_optional">Data (optional)</a></li>
+<li><a href="#_test_control_optional">Test-Control (optional)</a></li>
+<li><a href="#_scheduler_optional">Scheduler (optional)</a></li>
+</ul>
+</li>
+<li><a href="#_deltaspike_spi">DeltaSpike SPI</a></li>
+<li><a href="#_external">External</a></li>
+<li>
+<ul class="sectlevel2">
+<li><a href="#_blogs">Blogs</a></li>
+<li><a href="#_add_ons">Add-ons</a></li>
+<li><a href="#_project_templates">Project Templates</a></li>
+<li><a href="#_examples">Examples</a></li>
+</ul>
+</li>
+</ul>
+       	 		<hr>	
+       	 		
+				<div class="sect1">
+<h2 id="_introduction">Introduction</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Apache DeltaSpike project has been created to support the development of
+portable CDI extensions that provide useful features for Java
+applications not provided out of the box by the CDI spec (Security, JPA,
+&#8230;). CDI extensions created by the DeltaSpike community are packaged as
+modules.</p>
+</div>
+<div class="paragraph">
+<p>Therefore, Apache DeltaSpike is a great toolbox for CDI. More than a set
+of powerful extension and tools to ease extension development,
+DeltaSpike also proves that CDI allows Java EE to evolve between each
+release.</p>
+</div>
+<div class="paragraph">
+<p>The goal of the project is also to provide useful classes to :</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Boot CDI Container (Weld, OpenWebbeans, OpenEJB) for Java SE,</p>
+</li>
+<li>
+<p>Stage a project,</p>
+</li>
+<li>
+<p>Provide new scopes (Window Scope, &#8230;),</p>
+</li>
+<li>
+<p>Manage messages and configurations</p>
+</li>
+</ul>
+</div>
+<div class="paragraph">
+<p>The project is currently tested on different CDI implementations like
+Apache OpenWebBeans and JBoss Weld, and also on different Java Web
+containers like Apache TomEE or JavaEE, JBoss AS7, Oracle GlassFish
+3.1+, Oracle WebLogic Server 12c.</p>
+</div>
+<div class="sect2">
+<h3 id="_what_is_a_portable_cdi_extension">What is a portable CDI extension ?</h3>
+<div class="paragraph">
+<p>A portable CDI extension means that CDI itself can be extended. Such
+extensions can be used with any spec. compliant CDI implementation. From
+the user perspective, it means that you can simply drop in CDI extension
+jars into your runtime e.g. to integrate third-party APIs with CDI or to
+improve existing JavaEE-APIs.</p>
+</div>
+<div class="paragraph">
+<p>The CDI Portable extensions SPI (Service Provider Interface) allows to
+define additional beans, scopes, stereotypes, interceptors and
+decorators. The SPI of CDI is a powerful vehicle for innovation and
+DeltaSpike is an example of it.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_deltaspike_in_a_nutshell">DeltaSpike in a nutshell</h3>
+<div class="sect3">
+<h4 id="_java_ee_7_without_java_ee_7">Java EE 7 without Java EE 7!</h4>
+<div class="paragraph">
+<p><strong>Transactional support for non-EJB beans:</strong> The Transactional Interceptor
+in DeltaSpike paved the way for @Transactional in Java EE 7.</p>
+</div>
+<div class="paragraph">
+<p><strong>Injectable Servlet objects:</strong> Allows the developer to inject CDI beans
+on Servlets on Java EE 6/CDI 1.0 environments</p>
+</div>
+<div class="paragraph">
+<p><strong>Injectable resources:</strong> Configuration, resource bundles,&#8230; are easy to
+inject when using CDI and Apache DeltaSpike.</p>
+</div>
+<div class="paragraph">
+<p><strong>@Exclude annotation:</strong> it&#8217;s possible to annotate beans which should be
+ignored by CDI even if they are in a CDI enabled archive on Java EE
+6/CDI 1.0 environment where you can&#8217;t use @Vetoed or a veto based on
+project-stages or expressions is needed.</p>
+</div>
+<div class="paragraph">
+<p><strong>Scheduling tasks</strong>: Async processes in a non Java EE 7 environment.</p>
+</div>
+<div class="paragraph">
+<p><strong>Bean Validation integration:</strong> Allows to inject CDI beans and EJB in to
+Constraint-Validators.</p>
+</div>
+<div class="paragraph">
+<p><strong>BeanProvider:</strong> Access the BeanManager and CDI beans even in non managed
+classes like JPA-2.0 EntityListeners or Spring Beans.</p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_jsf_improvements">JSF Improvements</h4>
+<div class="paragraph">
+<p><strong>Multi-window handling:</strong> Allows to manage logical windows for
+batches,&#8230; or in case of JSF it offers proper separation of
+browser-tabs.</p>
+</div>
+<div class="paragraph">
+<p><strong>Type-safe view-config:</strong> It allows to bind meta-data (e.g. for security)
+to views with a type-safe, but flexible approach. It provides a more
+solid navigation in case of JSF and helps a lot in the maintenance
+phase.</p>
+</div>
+<div class="paragraph">
+<p><strong>View-Controller:</strong> Based on type-safe view-configs view-controller
+annotations provide a type-safe alternative to standard-tags.</p>
+</div>
+<div class="paragraph">
+<p><strong>Injection on Converters and Validators:</strong> Allows to inject CDI beans and
+EJB in to JSF Converters and Validators.</p>
+</div>
+<div class="paragraph">
+<p><strong>JSF event broadcasting to CDI:</strong> Allows CDI to be notified about JSF
+events</p>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_productivity_improvements">Productivity Improvements</h4>
+<div class="paragraph">
+<p><strong>Security based on annotations:</strong> The foundation for building a robust,
+capable and non invasive security solution.</p>
+</div>
+<div class="paragraph">
+<p><strong>New CDI scopes:</strong> TransactionScoped, WindowScoped, ViewScoped,
+ViewAccess scope, Grouped conversion scope</p>
+</div>
+<div class="paragraph">
+<p><strong>Container Control &amp; Test Control:</strong> Java SE with CDI, all with a
+unifying API. Start, stop, add classes to a running CDI container.</p>
+</div>
+<div class="paragraph">
+<p><strong>Data Module:</strong> An out of the box entity framework solution complete with
+support for container or application managed persistence contexts, as
+well as JDBC.</p>
+</div>
+<div class="paragraph">
+<p><strong>Decoupled Exception handling:</strong> Allows to do exception handling in one
+location similar to CDI Observers.</p>
+</div>
+<div class="paragraph">
+<p><strong>JMX integration:</strong> Any CDI bean can be exposed via JMX easily with one
+annotation.</p>
+</div>
+<div class="paragraph">
+<p><strong>Type-safe i18n messages:</strong> Localized messages are easy to use with an
+interface and a resource bundle, no more boilerplate and your messages
+now have context within the code.</p>
+</div>
+<div class="paragraph">
+<p><strong>Type-safe Project-Stages:</strong> Compared to project-stages in JSF,
+DeltaSpike provides a type-safe, but still extensible approach which can
+be used in CDI based applications.</p>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_getting_started">Getting Started</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>A DeltaSpike project can be designed using or not Apache Maven and
+consists in a collection of jar files. Depending on your needs, you will
+package DeltaSpike core jar (api and impl) files or extend the list with
+DeltaSpike modules. DeltaSpike Api and Impl are mandatory and provide
+code required to benefits of portable CDI extensions or useful features
+created.</p>
+</div>
+<div class="paragraph">
+<p>Remark : For Java SE, an additional step is required as you have to
+select the CDI implementation of your choice to boot a CDI container.</p>
+</div>
+<div class="paragraph">
+<p>[TODO] Add a section or remark to explain how to package &amp; deploy
+DeltaSpike in an OSGI environment (Apache Felix, Apache Karaf, Apache
+ServiceMix)</p>
+</div>
+<div class="sect2">
+<h3 id="_project_configuration_without_maven">Project Configuration without Maven</h3>
+<div class="paragraph">
+<p>You can manually download all JARs described above or you get <a href="source.html">the source-code</a> and <a href="build.html">build</a> DeltaSpike
+manually.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_project_configuration_with_maven">Project Configuration with Maven</h3>
+<div class="paragraph">
+<p><strong>Hint:</strong> In the listings below replace the placeholders for the version
+with the version of your choice or use:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;properties&gt;</span>
+    <span class="tag">&lt;deltaspike.version&gt;</span>1.0.2<span class="tag">&lt;/deltaspike.version&gt;</span>
+<span class="tag">&lt;/properties&gt;</span></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Or if you want to very bleeding edge, point to our current snapshot.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;properties&gt;</span>
+    <span class="tag">&lt;deltaspike.version&gt;</span>1.0.3-SNAPSHOT<span class="tag">&lt;/deltaspike.version&gt;</span>
+<span class="tag">&lt;/properties&gt;</span></code></pre>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_configuration_of_deltaspike_core">Configuration of DeltaSpike Core</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.core<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-core-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.core<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-core-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_configuration_of_deltaspike_modules">Configuration of DeltaSpike Modules</h4>
+<div class="sect4">
+<h5 id="_security_module">Security Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-security-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-security-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_jpa_module">JPA Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-jpa-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-jpa-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_jsf_module">JSF Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-jsf-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-jsf-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Some EE6 servers can&#8217;t handle optional classes. If you don&#8217;t like the
+corresponding log entries during the startup or the deployment fails,
+you can use an alternative impl-module (instead of
+deltaspike-jsf-module-impl) since v1.0.1:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-jsf-module-impl-ee6<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_bean_validation_module">Bean Validation Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-bean-validation-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_servlet_module">Servlet Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-servlet-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-servlet-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_data_module">Data Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-data-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-data-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_test_control_module">Test-Control Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-test-control-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>test<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-test-control-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>test<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_scheduler_module">Scheduler Module</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-scheduler-module-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.modules<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-scheduler-module-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_with_java_se">With Java SE</h4>
+<div class="paragraph">
+<p>To use DeltaSpike with Java SE, we must provide additional jars file
+corresponding to the DeltaSpike CDI Controller API and its
+implementation. The Controller uses Java Services to resolve the CDI
+container
+(<a href="http://docs.jboss.org/weld/reference/1.1.5.Final/en-US/html/">JBoss
+Weld</a>, <a href="http://openwebbeans.apache.org">Apache OpenWebbeans</a> (and
+<a href="http://openejb.apache.org">Apache OpenEJB</a>)) and implementation contains
+the code to manage the <a href="#_container_control_optional">CDI container and contexts</a>.</p>
+</div>
+<div class="paragraph">
+<p><strong>Hint:</strong> In the listings below replace the placeholders for the version
+with the version of your choice or use:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;properties&gt;</span>
+    <span class="tag">&lt;deltaspike.version&gt;</span>1.0.0<span class="tag">&lt;/deltaspike.version&gt;</span>
+    <span class="tag">&lt;owb.version&gt;</span>1.2.0<span class="tag">&lt;/owb.version&gt;</span>
+    <span class="tag">&lt;weld.version&gt;</span>1.1.9.Final<span class="tag">&lt;/weld.version&gt;</span>
+<span class="tag">&lt;/properties&gt;</span></code></pre>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_add_the_deltaspike_container_ctrl_api">Add the DeltaSpike Container Ctrl API</h5>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-cdictrl-api<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect4">
+<h5 id="_add_a_cdi_container_container_ctrl_impl">Add a CDI container + Container Ctrl Impl</h5>
+
+</div>
+</div>
+<div class="sect3">
+<h4 id="__for_apache_openwebbeans"> &#8230; for Apache OpenWebBeans</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.openwebbeans<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>openwebbeans-impl<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${owb.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.openwebbeans<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>openwebbeans-spi<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${owb.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-cdictrl-owb<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="__for_jboss_weld_ri"> &#8230; for JBoss Weld (RI)</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-cdictrl-weld<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span>
+
+<span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.jboss.weld.se<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>weld-se<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${weld.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>runtime<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_for_embedded_servlet_runtimes_you_can_add">For Embedded Servlet Runtimes, you can add</h4>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;dependency&gt;</span>
+    <span class="tag">&lt;groupId&gt;</span>org.apache.deltaspike.cdictrl<span class="tag">&lt;/groupId&gt;</span>
+    <span class="tag">&lt;artifactId&gt;</span>deltaspike-cdictrl-servlet<span class="tag">&lt;/artifactId&gt;</span>
+    <span class="tag">&lt;version&gt;</span>${deltaspike.version}<span class="tag">&lt;/version&gt;</span>
+    <span class="tag">&lt;scope&gt;</span>compile<span class="tag">&lt;/scope&gt;</span>
+<span class="tag">&lt;/dependency&gt;</span></code></pre>
+</div>
+</div>
+</div>
+<div class="sect3">
+<h4 id="_testing_snapshots">Testing Snapshots</h4>
+<div class="paragraph">
+<p>If you would like to test the latest Snapshot, you can &lt;&lt;build.adoc#,build DeltaSpike locally or you
+get it from the Apache Snapshot-Repository:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;repositories&gt;</span>
+    <span class="tag">&lt;repository&gt;</span>
+        <span class="tag">&lt;id&gt;</span>apache-snapshot-repository<span class="tag">&lt;/id&gt;</span>
+        <span class="tag">&lt;url&gt;</span>http://repository.apache.org/snapshots/<span class="tag">&lt;/url&gt;</span>
+        <span class="tag">&lt;releases&gt;</span>
+            <span class="tag">&lt;enabled&gt;</span>false<span class="tag">&lt;/enabled&gt;</span>
+        <span class="tag">&lt;/releases&gt;</span>
+        <span class="tag">&lt;snapshots&gt;</span>
+            <span class="tag">&lt;enabled&gt;</span>true<span class="tag">&lt;/enabled&gt;</span>
+        <span class="tag">&lt;/snapshots&gt;</span>
+    <span class="tag">&lt;/repository&gt;</span>
+<span class="tag">&lt;/repositories&gt;</span></code></pre>
+</div>
+</div>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_deployment_mode">Deployment mode</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>DeltaSpike can be deployed in different Java environments. Depending
+which Java container and release you are using, the procedure which is
+different is explained here after.</p>
+</div>
+<div class="sect2">
+<h3 id="_with_java_ee6">With Java EE6+</h3>
+<div class="paragraph">
+<p>If you are using DeltaSpike in a Java EE6 environment, you don&#8217;t need to
+configure a CDI implementation explicitly because it&#8217;s shipped with the
+container.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_with_java_ee5_or_servlet_containers">With Java EE5 or Servlet Containers</h3>
+<div class="paragraph">
+<p>Java EE5 application servers as well as pure servlet containers like
+Apache Tomcat / Eclipse Jetty don&#8217;t provide a CDI implementation
+out-of-the-box. So don&#8217;t forget to setup the CDI implementation of your
+choice.</p>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_standard_java_se6">Standard Java SE6+</h3>
+<div class="paragraph">
+<p>If you are only using a JDK and runs Java in a standalone or standard
+mode (Java SE), then DeltaSpike will allow you to boot a CDI
+implementation where you can use Dependency Injection with a Bean
+Manager. Such an example will be presented at the next section.</p>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_start_a_cdi_container_using_java_se">Start a CDI container using Java SE</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>This code snippet show you how with a Java MainApplication a CDI
+container can be started (= boot) by DeltaSpike using Java SE and how
+you define a CDI scope and resolve beans injected.</p>
+</div>
+<div class="paragraph">
+<p><strong>Hint</strong>: To bootstrap a CDI container in your Java application, you
+just need to instantiate the <code>CdiContainer</code> and call the <code>#boot</code> method.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="keyword">import</span> <span class="include">org.apache.deltaspike.cdise.api.CdiContainer</span>;
+<span class="keyword">import</span> <span class="include">org.apache.deltaspike.cdise.api.CdiContainerLoader</span>;
+
+<span class="directive">public</span> <span class="type">class</span> <span class="class">MainApp</span> {
+    <span class="directive">public</span> <span class="directive">static</span> <span class="type">void</span> main(<span class="predefined-type">String</span><span class="type">[]</span> args) {
+
+        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
+        cdiContainer.boot();
+
+        <span class="comment">// You can use CDI here</span>
+
+        cdiContainer.shutdown();
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>When <code>#boot</code> is called, the <code>CdiContainer</code> will scan CDI enabled
+archives for beans and CDI extensions.</p>
+</div>
+<div class="paragraph">
+<p><strong>Note</strong>: Booting the container does not automatically start all CDI
+Contexts!</p>
+</div>
+<div class="paragraph">
+<p>Example for starting the application-context:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="keyword">import</span> <span class="include">org.apache.deltaspike.cdise.api.CdiContainer</span>;
+<span class="keyword">import</span> <span class="include">org.apache.deltaspike.cdise.api.CdiContainerLoader</span>;
+<span class="keyword">import</span> <span class="include">org.apache.deltaspike.cdise.api.ContextControl</span>;
+<span class="keyword">import</span> <span class="include">javax.enterprise.context.ApplicationScoped</span>;
+
+<span class="directive">public</span> <span class="type">class</span> <span class="class">MainApp</span> {
+    <span class="directive">public</span> <span class="directive">static</span> <span class="type">void</span> main(<span class="predefined-type">String</span><span class="type">[]</span> args) {
+
+        CdiContainer cdiContainer = CdiContainerLoader.getCdiContainer();
+        cdiContainer.boot();
+
+        <span class="comment">// Starting the application-context allows to use @ApplicationScoped beans</span>
+        ContextControl contextControl = cdiContainer.getContextControl();
+        contextControl.startContext(ApplicationScoped.class);
+
+        <span class="comment">// You can use CDI here</span>
+
+        cdiContainer.shutdown();
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>To resolve a bean of this project, you can use the <code>BeanProvider</code>
+provided by DeltaSpike. The following example shows how to resolve the a
+bean without qualifiers. It depends on the application if <code>EchoService</code>
+is a concrete implementation or just an interface. In case of an
+interface the corresponding implementation will be resolved. The
+resolved bean is a normal CDI bean which means you can use all CDI
+concepts like <code>@Inject</code> in the class (and you don&#8217;t need further usages
+of <code>BeanProvider</code>).</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java">EchoService echoService = BeanProvider.getContextualReference(EchoService.class, <span class="predefined-constant">false</span>);</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Before the application exits, you have to call <code>#shutdown</code> to destroy
+beans,&#8230; in a well-ordered fashion.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_module_overview">Module Overview</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>The core features of DeltaSpike project are packaged under the following
+different modules. Some of them are mandatory while others are optional.</p>
+</div>
+<div class="sect2">
+<h3 id="_core_required">Core (required)</h3>
+<div class="paragraph">
+<p>Definition : Contain the API and util classes of DeltaSpike project</p>
+</div>
+<a class="btn" href="core.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_security_optional">Security (optional)</h3>
+<div class="paragraph">
+<p>Definition : Intercept and check security</p>
+</div>
+<a class="btn" href="security.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_jpa_optional">JPA (optional)</h3>
+<div class="paragraph">
+<p>Definition :</p>
+</div>
+<a class="btn" href="jpa.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_jsf_optional">JSF (optional)</h3>
+<div class="paragraph">
+<p>Definition :</p>
+</div>
+<a class="btn" href="jsf.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_container_control_optional">Container Control (optional)</h3>
+<div class="paragraph">
+<p>Definition :</p>
+</div>
+<a class="btn" href="container-control.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_bean_validation_optional">Bean Validation (optional)</h3>
+<div class="paragraph">
+<p>Definition : A module for adding CDI support in Bean Validation.</p>
+</div>
+<div class="paragraph">
+<p>Features : Allows a developer to create CDI aware `ConstraintValidator`s
+that can use business objects (EJBs, ManagedBeans) to support validation
+needs.</p>
+</div>
+<a class="btn" href="bean-validation.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_servlet_optional">Servlet (optional)</h3>
+<div class="paragraph">
+<p>Definition : The DeltaSpike Servlet module provides integration with the
+Java Servlet API.</p>
+</div>
+<div class="paragraph">
+<p>Features :</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Injection of common servlet objects.</p>
+</li>
+<li>
+<p>Propagation of servlet events to the CDI event bus.</p>
+</li>
+</ul>
+</div>
+<a class="btn" href="servlet.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_partial_bean_optional">Partial-Bean (optional)</h3>
+<a class="btn" href="partial-bean.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_data_optional">Data (optional)</h3>
+<div class="paragraph">
+<p>Definition : The DeltaSpike Data module provides enhanced JPA experience
+with declarative queries, reducing boilerplate to a minimum.</p>
+</div>
+<div class="paragraph">
+<p>Features :</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Derive queries by simple method names or by method annotations
+defining JPQL, named queries or plain SQL</p>
+</li>
+<li>
+<p>Result pagination and sorting</p>
+</li>
+<li>
+<p>Auditing of entities</p>
+</li>
+<li>
+<p>A simplified alternative to the Criteria API</p>
+</li>
+<li>
+<p>Mapping of entities from and to DTOs</p>
+</li>
+</ul>
+</div>
+<a class="btn" href="data.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_test_control_optional">Test-Control (optional)</h3>
+<div class="paragraph">
+<p>Definition : This module allows to write CDI based tests easily.</p>
+</div>
+<a class="btn" href="test-control.html">View details »</a>
+</div>
+<div class="sect2">
+<h3 id="_scheduler_optional">Scheduler (optional)</h3>
+<div class="paragraph">
+<p>Definition : This module provides a simple integration with Quartz v2
+(per default) or any other scheduler which supports cron-expressions for
+job-classes.</p>
+</div>
+<a class="btn" href="scheduler.html">View details »</a>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_deltaspike_spi">DeltaSpike SPI</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>DeltaSpike Service Provider Interface (SPI)</p>
+</div>
+<a class="btn" href="spi.html">View details »</a>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_external">External</h2>
+<div class="sectionbody">
+<div class="sect2">
+<h3 id="_blogs">Blogs</h3>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="http://os890.blogspot.com/search/label/deltaspike">http://os890.blogspot.com/search/label/deltaspike</a></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_add_ons">Add-ons</h3>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="https://github.com/os890/ds-monitoring-addon">Monitoring- and Auditing</a></p>
+</li>
+<li>
+<p><a href="https://github.com/os890/ds-spring-bridge-addon">CDI/Spring Bridge</a></p>
+</li>
+<li>
+<p><a href="https://github.com/os890/ds-disruptor-addon">Fast events via Disruptor</a></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_project_templates">Project Templates</h3>
+<div class="ulist">
+<ul>
+<li>
+<p><a href="https://github.com/os890/javase-cdi-ds-project-template">Java SE + CDI + DS</a></p>
+</li>
+<li>
+<p><a href="https://github.com/os890/javaweb-cdi-ds-project-template">JSF + CDI + DS (Servlet-Container)</a></p>
+</li>
+<li>
+<p><a href="https://github.com/os890/javaee_cdi_ejb_ds_project_template">EJB + CDI + DS (Module)</a></p>
+</li>
+<li>
+<p><a href="https://github.com/os890/javaee_jsf_cdi_ejb_ds_project_template">JSF + EJB + CDI + DS (EE-Server)</a></p>
+</li>
+</ul>
+</div>
+</div>
+<div class="sect2">
+<h3 id="_examples">Examples</h3>
+<div class="paragraph">
+<p>See External Examples</p>
+</div>
+</div>
+</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 -->
+
+</body>
+</html>
\ No newline at end of file

Added: websites/staging/deltaspike/trunk/content/documentation/jpa.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/documentation/jpa.html (added)
+++ websites/staging/deltaspike/trunk/content/documentation/jpa.html Thu Sep 11 14:16:50 2014
@@ -0,0 +1,740 @@
+<!DOCTYPE html>
+<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>JPA 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="http://deltaspike.apache.org/resources/css/bootstrap.css" rel="stylesheet">
+<link href="http://deltaspike.apache.org/resources/css/bootstrap-responsive.css" rel="stylesheet">
+
+<style type="text/css">
+/* Foundation stylesheet for CodeRay (to match GitHub theme) | MIT License | http://foundation.zurb.com */
+table.CodeRay { border-collapse: collapse; padding: 2px; margin-bottom: 0; border: 0; background: transparent; }
+table.CodeRay td { padding: 0 .5em; vertical-align: top; }
+table.CodeRay td.line-numbers { text-align: right; color: #999; border-right: 1px solid #e5e5e5; padding-left: 0; }
+span.line-numbers { border-right: 1px solid #E5E5E5; color: #999; display: inline-block; margin-right: 0.5em; padding-right: 0.5em; }
+.CodeRay td.line-numbers strong, .CodeRay span.line-numbers strong { font-weight: normal; }
+.CodeRay .debug { color: white !important; background: blue !important; }
+.CodeRay .annotation { color: #007; }
+.CodeRay .attribute-name { color: #f08; }
+.CodeRay .attribute-value { color: #700; }
+.CodeRay .binary { color: #509; }
+.CodeRay .comment  { color: #999; font-style: italic; }
+.CodeRay .char { color: #04D; }
+.CodeRay .char .content { color: #04D; }
+.CodeRay .char .delimiter { color: #039; }
+.CodeRay .class { color: #458; }
+.CodeRay .complex { color: #A08; }
+.CodeRay .constant { color: teal; }
+.CodeRay .color { color: #0A0; }
+.CodeRay .class-variable { color: #369; }
+.CodeRay .decorator { color: #B0B; }
+.CodeRay .definition { color: #099; }
+.CodeRay .directive { color: #088; }
+.CodeRay .delimiter { color: black; }
+.CodeRay .doc { color: #970; }
+.CodeRay .doctype { color: #34b; }
+.CodeRay .doc-string { color: #D42; }
+.CodeRay .escape  { color: #666; }
+.CodeRay .entity { color: #800; }
+.CodeRay .error { color: #808; }
+.CodeRay .exception { color: #C00; }
+.CodeRay .filename { color: #099; }
+.CodeRay .function { color: #900; }
+.CodeRay .global-variable { color: teal; }
+.CodeRay .hex { color: #058; }
+.CodeRay .integer  { color: #099; }
+.CodeRay .include { color: #B44; }
+.CodeRay .inline { color: black; }
+.CodeRay .inline .inline { background: #ccc; }
+.CodeRay .inline .inline .inline { background: #bbb; }
+.CodeRay .inline .inline-delimiter { color: #D14; }
+.CodeRay .inline-delimiter { color: #D14; }
+.CodeRay .important { color: #f00; }
+.CodeRay .interpreted { color: #B2B; }
+.CodeRay .instance-variable { color: teal; }
+.CodeRay .label { color: #970; }
+.CodeRay .local-variable { color: #963; }
+.CodeRay .octal { color: #40E; }
+.CodeRay .predefined { color: #369; }
+.CodeRay .preprocessor { color: #579; }
+.CodeRay .pseudo-class { color: #00C; }
+.CodeRay .predefined-type { color: #074; }
+.CodeRay .reserved, .keyword  { color: #000; }
+.CodeRay .key { color: #808; }
+.CodeRay .key .delimiter { color: #606; }
+.CodeRay .key .char { color: #80f; }
+.CodeRay .value { color: #088; }
+.CodeRay .regexp { background-color: #fff0ff; }
+.CodeRay .regexp .content { color: #808; }
+.CodeRay .regexp .delimiter { color: #404; }
+.CodeRay .regexp .modifier { color: #C2C; }
+.CodeRay .regexp .function  { color: #404; font-weight: bold; }
+.CodeRay .string { color: #D20; }
+.CodeRay .string .string { }
+.CodeRay .string .string .string { background-color: #ffd0d0; }
+.CodeRay .string .content { color: #D14; }
+.CodeRay .string .char { color: #D14; }
+.CodeRay .string .delimiter { color: #D14; }
+.CodeRay .shell { color: #D14; }
+.CodeRay .shell .content { }
+.CodeRay .shell .delimiter { color: #D14; }
+.CodeRay .symbol { color: #990073; }
+.CodeRay .symbol .content { color: #A60; }
+.CodeRay .symbol .delimiter { color: #630; }
+.CodeRay .tag, .CodeRay .attribute-name { color: #070; }
+.CodeRay .tag-special { color: #D70; }
+.CodeRay .type { color: #339; }
+.CodeRay .variable  { color: #036; }
+.CodeRay .insert { background: #afa; }
+.CodeRay .delete { background: #faa; }
+.CodeRay .change { color: #aaf; background: #007; }
+.CodeRay .head { color: #f8f; background: #505; }
+.CodeRay .insert .insert { color: #080; }
+.CodeRay .delete .delete { color: #800; }
+.CodeRay .change .change { color: #66f; }
+.CodeRay .head .head { color: #f4f; }
+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="http://deltaspike.apache.org/index.html">Apache
+					DeltaSpike</a>
+				<div class="nav-collapse">
+					<ul class="nav">
+						<li class="active"><a
+							href="http://deltaspike.apache.org/index.html">Home</a></li>
+						<li><a href="http://deltaspike.apache.org/documentation">Documentation</a></li>
+						<li><a href="http://deltaspike.apache.org/source.html">Source</a></li>
+						<li><a href="http://deltaspike.apache.org/download.html">Download</a></li>
+						<li><a href="http://deltaspike.apache.org/community.html">Community</a></li>
+						<!-- <li><a href="./support.html">Support</a></li>  -->
+						<li><a href="http://deltaspike.apache.org/news.html">News</a></li>
+						<li><a
+							href="http://deltaspike.apache.org/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>JPA Module</h1>
+                </div>
+
+				<div id="toc" class="toc2">
+       	 		<ul class="sectlevel1">
+<li><a href="#__transactional">@Transactional</a></li>
+<li><a href="#transactionscoped">@TransactionScoped</a></li>
+<li><a href="#_extended_persistence_contexts">Extended Persistence Contexts</a></li>
+<li><a href="#_jta_support">JTA Support</a></li>
+</ul>
+       	 		<hr>	
+       	 		
+				<div class="sect1">
+<h2 id="__transactional">@Transactional</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>This annotation is an alternative to transactional EJBs which allows to
+execute a method within a transaction. Before it&#8217;s possible to start
+using the annotation, it&#8217;s required to implement a CDI producer for an
+<code>EntityManager</code> and it&#8217;s needed to inject the <code>EntityManager</code> in the
+bean which uses <code>@Transactional</code>. As shown later on it&#8217;s also possible
+to use multiple qualifiers for using different `EntityManager`s.</p>
+</div>
+<div class="paragraph">
+<p><strong>Hint:</strong> If you are using features described by this page and the CDI
+container you are using is Weld (or OpenWebBeans in BDA mode), you have
+to enable the transaction interceptor in your beans.xml file:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;beans&gt;</span>
+    <span class="tag">&lt;interceptors&gt;</span>
+        <span class="tag">&lt;class&gt;</span>org.apache.deltaspike.jpa.impl.transaction.TransactionalInterceptor<span class="tag">&lt;/class&gt;</span>
+    <span class="tag">&lt;/interceptors&gt;</span>
+<span class="tag">&lt;/beans&gt;</span></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The following example shows a simple producer for an <code>EntityManager</code> 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&#8217;s possible to use a special scope called
+<code>@TransactionScoped</code> provided by the same DeltaSpike module.</p>
+</div>
+<div class="paragraph">
+<p>Producer for the default EntityManager (<strong>no EE-Server</strong>):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">EntityManagerProducer</span>
+{
+    <span class="comment">//or manual bootstrapping</span>
+    <span class="annotation">@PersistenceContext</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">protected</span> EntityManager createEntityManager()
+    {
+        <span class="keyword">return</span> <span class="local-variable">this</span>.entityManager;
+    }
+
+    <span class="directive">protected</span> <span class="type">void</span> closeEntityManager(<span class="annotation">@Disposes</span> EntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Producer for the default EntityManager (<strong>EE-Server</strong>):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="annotation">@ApplicationScoped</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">EntityManagerProducer</span>
+{
+    <span class="annotation">@PersistenceUnit</span>
+    <span class="directive">private</span> EntityManagerFactory entityManagerFactory;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@Default</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">public</span> EntityManager create()
+    {
+        <span class="keyword">return</span> <span class="local-variable">this</span>.entityManagerFactory.createEntityManager();
+    }
+
+    <span class="directive">public</span> <span class="type">void</span> dispose(<span class="annotation">@Disposes</span> <span class="annotation">@Default</span> EntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The following examples show how to use the <code>EntityManager</code> produced by
+the example above.</p>
+</div>
+<div class="paragraph">
+<p>Beans with transactional method:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">TransactionalBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Transactional</span>
+    <span class="directive">public</span> <span class="type">void</span> executeInTransaction()
+    {
+        <span class="comment">//...</span>
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Simple transactional bean (all methods transactional):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="annotation">@Transactional</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">TransactionalBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="comment">//...</span>
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>As illustrated in the following example it&#8217;s also possible to use
+<code>@Transactional</code> for stereotypes.</p>
+</div>
+<div class="paragraph">
+<p>Stereotype for transactional beans (+ usage):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="annotation">@Stereotype</span>
+<span class="annotation">@Transactional</span>
+<span class="annotation">@ApplicationScoped</span>
+<span class="directive">public</span> <span class="annotation">@interface</span> Repository
+{
+}
+
+<span class="comment">//...</span>
+<span class="annotation">@Repository</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">TransactionalBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="comment">//...</span>
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Besides such simple usages, it&#8217;s also supported to use qualifiers to
+access multiple persistence-units in parallel. The default qualifier for
+<code>@Transactional</code> is <code>@Any</code>. Therefore a transaction for every injected
+entity manager will be started. The example afterwards shows how to
+change this default behaviour.</p>
+</div>
+<div class="paragraph">
+<p>Producer for multiple entity managers (+ usage):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">EntityManagerProducer</span>
+{
+    <span class="annotation">@PersistenceContext</span>(unitName = <span class="string"><span class="delimiter">&quot;</span><span class="content">firstDB</span><span class="delimiter">&quot;</span></span>)
+    <span class="directive">private</span> EntityManager firstEntityManager;
+
+    <span class="annotation">@PersistenceContext</span>(unitName = <span class="string"><span class="delimiter">&quot;</span><span class="content">secondDB</span><span class="delimiter">&quot;</span></span>)
+    <span class="directive">private</span> EntityManager secondEntityManager;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@First</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">protected</span> EntityManager createFirstEntityManager()
+    {
+        <span class="keyword">return</span> <span class="local-variable">this</span>.firstEntityManager;
+    }
+
+    <span class="directive">protected</span> <span class="type">void</span> closeFirstEntityManager(<span class="annotation">@Disposes</span> <span class="annotation">@First</span> EntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@Second</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">protected</span> EntityManager createSecondEntityManager()
+    {
+        <span class="keyword">return</span> <span class="local-variable">this</span>.secondEntityManager;
+    }
+
+    <span class="directive">protected</span> <span class="type">void</span> closeSecondEntityManager(<span class="annotation">@Disposes</span> <span class="annotation">@Second</span> EntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}
+
+<span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">FirstLevelTransactionBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> <span class="annotation">@First</span> EntityManager firstEntityManager;
+
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> NestedTransactionBean nestedTransactionBean;
+
+    <span class="annotation">@Transactional</span>
+    <span class="directive">public</span> <span class="type">void</span> executeInTransaction()
+    {
+        <span class="comment">//...</span>
+        <span class="local-variable">this</span>.nestedTransactionBean.executeInTransaction();
+    }
+}
+
+<span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">NestedTransactionBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> <span class="annotation">@Second</span> EntityManager secondEntityManager;
+
+    <span class="annotation">@Transactional</span>
+    <span class="directive">public</span> <span class="type">void</span> executeInTransaction()
+    {
+        <span class="comment">//...</span>
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The following example shows how to use only the specified
+<code>EntityManager</code>/s</p>
+</div>
+<div class="paragraph">
+<p>Activating entity managers manually:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="directive">public</span> <span class="type">class</span> <span class="class">MultiTransactionBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager defaultEntityManager;
+
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> <span class="annotation">@First</span> EntityManager firstEntityManager;
+
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> <span class="annotation">@Second</span> EntityManager secondEntityManager;
+
+    <span class="annotation">@Transactional</span>(qualifier = Default.class)
+    <span class="directive">public</span> <span class="type">void</span> executeInDefaultTransaction()
+    {
+    }
+
+    <span class="annotation">@Transactional</span>(qualifier = First.class)
+    <span class="directive">public</span> <span class="type">void</span> executeInFirstTransaction()
+    {
+    }
+
+    <span class="annotation">@Transactional</span>(qualifier = Second.class)
+    <span class="directive">public</span> <span class="type">void</span> executeInSecondTransaction()
+    {
+    }
+
+    <span class="annotation">@Transactional</span>(qualifier = {First.class, Second.class})
+    <span class="directive">public</span> <span class="type">void</span> executeInFirstAndSecondTransaction()
+    {
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<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>
+<div class="paragraph">
+<p>Joining existing transaction in nested call:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">FirstLevelTransactionBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> NestedTransactionBean nestedTransactionBean;
+
+    <span class="annotation">@Transactional</span>
+    <span class="directive">public</span> <span class="type">void</span> executeInTransaction()
+    {
+        <span class="local-variable">this</span>.nestedTransactionBean.executeInTransaction();
+    }
+}
+
+<span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">NestedTransactionBean</span>
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Transactional</span>
+    <span class="directive">public</span> <span class="type">void</span> executeInTransaction()
+    {
+        <span class="comment">//...</span>
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>The final transaction handling for all <code>EntityManager</code> s is also done
+after the outermost transactional method if <code>NestedTransactionBean</code> uses
+a different <code>EntityManager</code>. So it&#8217;s possible to catch an exception in
+<code>FirstLevelTransactionBean</code> e.g. to try an optional path instead of an
+immediate rollback.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="transactionscoped">@TransactionScoped</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p><code>@Transactional</code> also starts a context which is available as long as the
+transaction started by <code>@Transactional</code>. Besides other beans you can use
+this scope for the <code>EntityManager</code> itself. That means the
+<code>EntityManager</code> will be closed after leaving the method annotated with
+<code>@Transactional</code>.</p>
+</div>
+<div class="paragraph">
+<p>Producer for the default EntityManager which should be used only for one
+transaction:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">EntityManagerProducer</span>
+{
+    <span class="comment">//or manual bootstrapping</span>
+    <span class="annotation">@PersistenceContext</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@TransactionScoped</span>
+    <span class="directive">protected</span> EntityManager createEntityManager()
+    {
+        <span class="keyword">return</span> <span class="local-variable">this</span>.entityManager;
+    }
+
+    <span class="directive">protected</span> <span class="type">void</span> closeEntityManager(<span class="annotation">@Disposes</span> EntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}</code></pre>
+</div>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_extended_persistence_contexts">Extended Persistence Contexts</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Frameworks like MyFaces Orchestra provide a feature which allows keeping
+an <code>EntityManager</code> across multiple requests. That means it isn&#8217;t
+required to call <code>EntityManager#merge</code> to add detached entities to the
+context. However, several application architectures don&#8217;t allow such an
+approach (due to different reasons like scalability). In theory that
+sounds nice and it works pretty well for small to medium sized projects
+esp. if an application doesn&#8217;t rely on session replication in clusters.
+That also means that such an approach restricts your target environment
+from the very beginning. One of the base problems is that an
+<code>EntityManager</code> isn&#8217;t serializable. Beans which are scoped in a
+normal-scoped CDI context have to be serializable. So by default it
+isn&#8217;t allowed by CDI to provide a producer-method which exposes e.g. a
+conversation scoped <code>EntityManager</code> as it is. We <strong>don&#8217;t</strong> recommend to
+use this approach and therefore it isn&#8217;t available out-of-the-box.
+However, if you really need this approach to avoid calling <code>#merge</code> for
+your detached entities, it&#8217;s pretty simple to add this functionality.</p>
+</div>
+<div class="paragraph">
+<p>Usage of a simple <code>ExtendedEntityManager</code></p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="annotation">@Inject</span>
+<span class="directive">private</span> EntityManager entityManager;</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>As you see the usage is the same. You <strong>don&#8217;t</strong> have to use
+<code>ExtendedEntityManager</code> at the injection point. It&#8217;s just needed in the
+producer-method:</p>
+</div>
+<div class="paragraph">
+<p>Producer for the default Extended-<code>EntityManager</code> (<strong>no EE-Server</strong>):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="comment">//...</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">ExtendedEntityManagerProducer</span>
+{
+    <span class="comment">//or manual bootstrapping</span>
+    <span class="annotation">@PersistenceContext</span>
+    <span class="directive">private</span> EntityManager entityManager;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">protected</span> ExtendedEntityManager createEntityManager()
+    {
+        <span class="keyword">return</span> <span class="keyword">new</span> ExtendedEntityManager(<span class="local-variable">this</span>.entityManager);
+    }
+
+    <span class="directive">protected</span> <span class="type">void</span> closeEntityManager(<span class="annotation">@Disposes</span> ExtendedEntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Producer for the default Extended-<code>EntityManager</code> (<strong>EE-Server</strong>):</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="annotation">@ApplicationScoped</span>
+<span class="directive">public</span> <span class="type">class</span> <span class="class">ExtendedEntityManagerProducer</span>
+{
+    <span class="annotation">@PersistenceUnit</span>
+    <span class="directive">private</span> EntityManagerFactory entityManagerFactory;
+
+    <span class="annotation">@Produces</span>
+    <span class="annotation">@Default</span>
+    <span class="annotation">@RequestScoped</span>
+    <span class="directive">public</span> ExtendedEntityManager create()
+    {
+        <span class="keyword">return</span> <span class="keyword">new</span> ExtendedEntityManager(<span class="local-variable">this</span>.entityManagerFactory.createEntityManager());
+    }
+
+    <span class="directive">public</span> <span class="type">void</span> dispose(<span class="annotation">@Disposes</span> <span class="annotation">@Default</span> ExtendedEntityManager entityManager)
+    {
+        <span class="keyword">if</span> (entityManager.isOpen())
+        {
+            entityManager.close();
+        }
+    }
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>Implementation of a simple <code>ExtendedEntityManager</code>:</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="java language-java"><span class="annotation">@Typed</span>()
+<span class="directive">public</span> <span class="type">class</span> <span class="class">ExtendedEntityManager</span> <span class="directive">implements</span> EntityManager, <span class="predefined-type">Serializable</span>
+{
+    <span class="directive">private</span> <span class="directive">static</span> <span class="directive">final</span> <span class="type">long</span> serialVersionUID = <span class="integer">3770954229283539616L</span>;
+
+    <span class="directive">private</span> <span class="directive">transient</span> EntityManager wrapped;
+
+    <span class="directive">protected</span> ExtendedEntityManager()
+    {
+    }
+
+    <span class="directive">public</span> ExtendedEntityManager(EntityManager wrapped)
+    {
+        <span class="local-variable">this</span>.wrapped = wrapped;
+    }
+
+    <span class="comment">/*
+     * generated
+     */</span>
+    <span class="comment">//delegate all calls to this.wrapped - most IDEs allow to generate it</span>
+}</code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>This approach just works if it <strong>doesn&#8217;t come to serialization</strong> of this
+wrapper e.g. in case of session-replication. If those beans get
+serialized, you have to overcome this restriction by storing the
+persistence-unit-name and recreate the <code>EntityManager</code> via
+<code>Persistence.createEntityManagerFactory(this.persistenceUnitName).createEntityManager();</code>
+and sync it with the database before closing it on serialization.
+Furthermore, you have to intercept some methods of the <code>EntityManager</code>
+to merge detached entities automatically if those entities get
+serialized as well. However, as mentioned before <strong>we don&#8217;t recommend</strong>
+such an approach.</p>
+</div>
+</div>
+</div>
+<div class="sect1">
+<h2 id="_jta_support">JTA Support</h2>
+<div class="sectionbody">
+<div class="paragraph">
+<p>Per default the transaction-type used by <code>@Transactional`is
+'RESOURCE_LOCAL'. If you configure `transaction-type="JTA"`in the
+persistence.xml, you have to enable an alternative `TransactionStrategy</code>
+in the beans.xml which is called
+<code>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</code>.</p>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre class="CodeRay"><code class="xml language-xml"><span class="tag">&lt;beans&gt;</span>
+    <span class="tag">&lt;alternatives&gt;</span>
+        <span class="tag">&lt;class&gt;</span>org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy<span class="tag">&lt;/class&gt;</span>
+    <span class="tag">&lt;/alternatives&gt;</span>
+<span class="tag">&lt;/beans&gt;</span></code></pre>
+</div>
+</div>
+<div class="paragraph">
+<p>If you have multiple persistence-units and you have to use both
+transaction-types or the settings for development have to be different
+than the production settings, you can use
+<code>org.apache.deltaspike.jpa.impl.transaction.EnvironmentAwareTransactionStrategy</code>
+instead.</p>
+</div>
+<div class="paragraph">
+<p><strong>Hint:</strong></p>
+</div>
+<div class="paragraph">
+<p>In case of some versions of Weld (or OpenWebBeans in BDA mode), you have
+to configure it as global-alternative instead of an <code>&lt;alternatives&gt;</code> in
+beans.xml. That means you have to add e.g.:
+<code>globalAlternatives.org.apache.deltaspike.jpa.spi.transaction.TransactionStrategy=org.apache.deltaspike.jpa.impl.transaction.BeanManagedUserTransactionStrategy</code>
+to /META-INF/apache-deltaspike.properties</p>
+</div>
+</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 -->
+
+</body>
+</html>
\ No newline at end of file



Mime
View raw message