deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rafab...@apache.org
Subject svn commit: r1647970 - in /deltaspike/site/trunk/content/documentation: configure.html container-control.html core.html jsf.html
Date Fri, 26 Dec 2014 12:53:16 GMT
Author: rafabene
Date: Fri Dec 26 12:53:15 2014
New Revision: 1647970

URL: http://svn.apache.org/r1647970
Log:
Site checkin for project Apache DeltaSpike - Documentation

Modified:
    deltaspike/site/trunk/content/documentation/configure.html
    deltaspike/site/trunk/content/documentation/container-control.html
    deltaspike/site/trunk/content/documentation/core.html
    deltaspike/site/trunk/content/documentation/jsf.html

Modified: deltaspike/site/trunk/content/documentation/configure.html
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/configure.html?rev=1647970&r1=1647969&r2=1647970&view=diff
==============================================================================
--- deltaspike/site/trunk/content/documentation/configure.html (original)
+++ deltaspike/site/trunk/content/documentation/configure.html Fri Dec 26 12:53:15 2014
@@ -215,7 +215,7 @@ You can also opt to use the lastest Delt
 <div class="listingblock">
 <div class="content">
 <pre class="CodeRay highlight"><code data-lang="xml"><span class="tag">&lt;properties&gt;</span>
-    <span class="tag">&lt;deltaspike.version&gt;</span>1.2.0<span
class="tag">&lt;/deltaspike.version&gt;</span>
+    <span class="tag">&lt;deltaspike.version&gt;</span>1.2.1<span
class="tag">&lt;/deltaspike.version&gt;</span>
 <span class="tag">&lt;/properties&gt;</span></code></pre>
 </div>
 </div>

Modified: deltaspike/site/trunk/content/documentation/container-control.html
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/container-control.html?rev=1647970&r1=1647969&r2=1647970&view=diff
==============================================================================
--- deltaspike/site/trunk/content/documentation/container-control.html (original)
+++ deltaspike/site/trunk/content/documentation/container-control.html Fri Dec 26 12:53:15
2014
@@ -180,7 +180,8 @@ body {
 <li><a href="#_use_the_module_features">Use the Module Features</a>
 <ul class="sectlevel2">
 <li><a href="#_cdicontainer">CdiContainer</a></li>
-<li><a href="#_contextcontrol_usage">ContextControl Usage</a>
+<li><a href="#_contextcontrol_usage">ContextControl Usage</a></li>
+<li><a href="#_procedure_for_builing_uber_jar">Procedure for builing Uber jar</a>
 <ul class="sectlevel3">
 <li><a href="#_restart_the_requestcontext_in_unit_tests">Restart the RequestContext
in Unit Tests</a></li>
 <li><a href="#_attach_a_requestcontext_to_a_new_thread_in_ee">Attach a RequestContext
to a New Thread in EE</a></li>
@@ -250,6 +251,34 @@ body {
 <div class="paragraph">
 <p>The <code>ContextControl</code> interface provides life-cycle control
of the CDI container built-in contexts. This includes starting and stoping built-in standard
contexts like <code>@RequestScoped</code>, <code>@ConversationScoped</code>,
and <code>@SessionScoped</code>. It is provided as an <code>@Dependent</code>
bean and can be injected in the classic CDI way. This feature can be used and is helpful in
all Java environments, including Java SE, as illustrated here.</p>
 </div>
+</div>
+<div class="sect2">
+<h3 id="_procedure_for_builing_uber_jar">Procedure for builing Uber jar</h3>
+<div class="paragraph">
+<p>Uber jar or executable jar can created by using the maven shade plugin. Some things
you needs to be aware of when you use it.</p>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>Multiple <code>beans.xml</code> and <code>javax.enterprise.inject.spi.Extension</code>
files needs to be merged into the final jar using a transformer.</p>
+</li>
+</ul>
+</div>
+<div class="listingblock">
+<div class="content">
+<pre>&lt;transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/&gt;</pre>
+</div>
+</div>
+<div class="ulist">
+<ul>
+<li>
+<p>The <em>asm:asm:3.3.1</em> transitive dependency of OpenWebBeans isn&#8217;t
properly included in the Uber jar.  Add it as a project dependency if you use OWB. (Only needed
for OWB 1.1.8 !)</p>
+</li>
+<li>
+<p>Some frameworks, like logging frameworks, aren&#8217;t CDI compatible.  So you
need to exclude them from scanning. Use for example the <code>scan</code> feature
of Weld to define which packages needs to be excluded.</p>
+</li>
+</ul>
+</div>
 <div class="sect3">
 <h4 id="_restart_the_requestcontext_in_unit_tests">Restart the RequestContext in Unit
Tests</h4>
 <div class="paragraph">

Modified: deltaspike/site/trunk/content/documentation/core.html
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/core.html?rev=1647970&r1=1647969&r2=1647970&view=diff
==============================================================================
--- deltaspike/site/trunk/content/documentation/core.html (original)
+++ deltaspike/site/trunk/content/documentation/core.html Fri Dec 26 12:53:15 2014
@@ -441,7 +441,7 @@ by CDI even if they are in a CDI enabled
 </div>
 </div>
 <div class="listingblock">
-<div class="title">Excluding a Bean if the pProjectStageis Different from Development</div>
+<div class="title">Excluding a Bean if the ProjectStage is different from Development</div>
 <div class="content">
 <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@Exclude</span>(exceptIfProjectStage
= ProjectStage.Development.class)
 <span class="directive">public</span> <span class="type">class</span>
<span class="class">MyDevBean</span>
@@ -490,8 +490,7 @@ expressions.</p>
 </div>
 </div>
 <div class="paragraph">
-<p>In several cases it is also useful to combine this feature with the
-<code>@Alternative</code> annotation provided by CDI.</p>
+<p>In several cases it is also useful to combine this feature with the <code>@Alternative</code>
annotation provided by CDI.</p>
 </div>
 <div class="paragraph">
 <p>In addition to the following snippet, it is required to configure the
@@ -499,11 +498,8 @@ implementation as alternative in the bea
 will not be changed, for example for different environments, because it just gets
 active if it is not excluded during the bootstrapping process.</p>
 </div>
-<div class="paragraph">
-<div class="title">Excluding an Alternative Implementation if the pProjectStageis</div>
-<p>Different from Development</p>
-</div>
 <div class="listingblock">
+<div class="title">Excluding an Alternative implementation if the ProjectStage is different
from Development</div>
 <div class="content">
 <pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@Exclude</span>(exceptIfProjectStage
= ProjectStage.Development.class)
 <span class="annotation">@Alternative</span>

Modified: deltaspike/site/trunk/content/documentation/jsf.html
URL: http://svn.apache.org/viewvc/deltaspike/site/trunk/content/documentation/jsf.html?rev=1647970&r1=1647969&r2=1647970&view=diff
==============================================================================
--- deltaspike/site/trunk/content/documentation/jsf.html (original)
+++ deltaspike/site/trunk/content/documentation/jsf.html Fri Dec 26 12:53:15 2014
@@ -234,7 +234,6 @@ body {
 <li><a href="#_referencing_views_via_viewref">Referencing Views via @ViewRef</a></li>
 <li><a href="#_using_the_optional_viewnavigationhandler">Using the (Optional)
ViewNavigationHandler</a></li>
 <li><a href="#_configuring_a_default_error_view">Configuring a Default Error-View</a></li>
-<li><a href="#_using_matches">Using @Matches</a></li>
 <li><a href="#_using_viewconfigresolver">Using ViewConfigResolver</a></li>
 </ul>
 </li>
@@ -268,7 +267,7 @@ body {
 <li><a href="#_sub_conversation_groups">Sub-Conversation-Groups</a></li>
 </ul>
 </li>
-<li><a href="#_injection_in_jsf_artifacts_todo">Injection in JSF Artifacts (TODO)</a>
+<li><a href="#_injection_in_jsf_artifacts">Injection in JSF Artifacts</a>
 <ul class="sectlevel3">
 <li><a href="#_converter_and_validator">Converter and Validator</a></li>
 <li><a href="#_phaselistener">PhaseListener</a></li>
@@ -276,8 +275,8 @@ body {
 </li>
 <li><a href="#_event_broadcasting">Event broadcasting</a>
 <ul class="sectlevel3">
-<li><a href="#_beforejsfrequest_afterjsfrequest_todo">BeforeJsfRequest / AfterJsfRequest
(TODO)</a></li>
-<li><a href="#_beforephase_afterphase_todo">BeforePhase / AfterPhase (TODO)</a></li>
+<li><a href="#_observe_faces_requests">Observe Faces-Requests</a></li>
+<li><a href="#_beforephase_afterphase">BeforePhase / AfterPhase</a></li>
 <li><a href="#_jsf_systemevents">JSF SystemEvents</a></li>
 </ul>
 </li>
@@ -1763,12 +1762,6 @@ transformed to a standard (implicit) JSF
 </div>
 </div>
 <div class="sect4">
-<h5 id="_using_matches">Using @Matches</h5>
-<div class="paragraph">
-<p>This annotation is currently not integrated. [TODO]</p>
-</div>
-</div>
-<div class="sect4">
 <h5 id="_using_viewconfigresolver">Using ViewConfigResolver</h5>
 <div class="paragraph">
 <p>If you would like to query view-meta-data yourself (for whatever
@@ -2465,25 +2458,105 @@ be closed as soon as you close the Impli
 </div>
 </div>
 <div class="sect2">
-<h3 id="_injection_in_jsf_artifacts_todo">Injection in JSF Artifacts (TODO)</h3>
+<h3 id="_injection_in_jsf_artifacts">Injection in JSF Artifacts</h3>
 <div class="sect3">
 <h4 id="_converter_and_validator">Converter and Validator</h4>
-
+<div class="paragraph">
+<p>Per default the JSF module of DeltaSpike handles JSF converters and validators as
std. CDI beans and
+therefore it&#8217;s possible to use injection, lifecycle-callbacks, scope-annotations,&#8230;&#8203;
+the same way as with any other CDI bean.
+The usage is the same as for <code>PhaseListener</code> s.</p>
+</div>
 </div>
 <div class="sect3">
 <h4 id="_phaselistener">PhaseListener</h4>
+<div class="paragraph">
+<p>Once a std. JSF-<code>PhaseListener</code> is annotated with <code>@org.apache.deltaspike.jsf.api.listener.phase.JsfPhaseListener</code>,
+that <code>PhaseListener</code> gets active without additional config in <code>faces-config.xml</code>.
+Since such <code>PhaseListener</code> s are std. CDI beans,
+it&#8217;s possible to use injection, lifecycle-callbacks as well as scope-annotations
+the same way as with any other CDI bean.
+Furthermore, it&#8217;s possible to order <code>PhaseListener</code> s via
<code>ordinal</code>.
+DeltaSpike itself uses it internally e.g. in case of <code>DoubleSubmitAwarePhaseListener</code>
which looks like:</p>
+</div>
+<div class="listingblock">
+<div class="title">Example</div>
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="java"><span class="annotation">@JsfPhaseListener</span>(ordinal
= <span class="integer">9000</span>)
+<span class="directive">public</span> <span class="type">class</span>
<span class="class">DoubleSubmitAwarePhaseListener</span> <span class="directive">implements</span>
PhaseListener, Deactivatable
+{
+    <span class="annotation">@Inject</span>
+    <span class="directive">private</span> PostRequestTokenManager postRequestTokenManager;
 
+    <span class="annotation">@Override</span>
+    <span class="directive">public</span> <span class="type">void</span>
beforePhase(PhaseEvent event)
+    {
+        <span class="comment">//...</span>
+    }
+
+    <span class="annotation">@Override</span>
+    <span class="directive">public</span> <span class="type">void</span>
afterPhase(PhaseEvent event)
+    {
+        <span class="comment">//...</span>
+    }
+
+    <span class="annotation">@Override</span>
+    <span class="directive">public</span> PhaseId getPhaseId()
+    {
+        <span class="keyword">return</span> PhaseId.RESTORE_VIEW;
+    }
+}</code></pre>
+</div>
+</div>
 </div>
 </div>
 <div class="sect2">
 <h3 id="_event_broadcasting">Event broadcasting</h3>
 <div class="sect3">
-<h4 id="_beforejsfrequest_afterjsfrequest_todo">BeforeJsfRequest / AfterJsfRequest
(TODO)</h4>
+<h4 id="_observe_faces_requests">Observe Faces-Requests</h4>
+<div class="paragraph">
+<p>It is possible to observe JSF-Requests via <code>@Observes</code> in
combination with
+<code>@org.apache.deltaspike.core.api.lifecycle.Initialized</code> or
+<code>@org.apache.deltaspike.core.api.lifecycle.Destroyed</code> as qualifier
for <code>javax.faces.context.FacesContext</code>.</p>
+</div>
+<div class="paragraph">
+<p>Such observer-methods look e.g. like:</p>
+</div>
+<div class="listingblock">
+<div class="title">Example</div>
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span>
<span class="type">void</span> onBeforeFacesRequest(<span class="annotation">@Observes</span>
<span class="annotation">@Initialized</span> FacesContext facesContext) {
+    <span class="comment">//...</span>
+}
 
+<span class="directive">public</span> <span class="type">void</span>
onAfterFacesRequest(<span class="annotation">@Observes</span> <span class="annotation">@Destroyed</span>
FacesContext facesContext) {
+    <span class="comment">//...</span>
+}</code></pre>
+</div>
+</div>
 </div>
 <div class="sect3">
-<h4 id="_beforephase_afterphase_todo">BeforePhase / AfterPhase (TODO)</h4>
+<h4 id="_beforephase_afterphase">BeforePhase / AfterPhase</h4>
+<div class="paragraph">
+<p>It is possible to observe JSF request-lifecycle phase-events via <code>@Observes</code>
in combination with
+<code>@org.apache.deltaspike.jsf.api.listener.phase.BeforePhase</code> or
+<code>@org.apache.deltaspike.jsf.api.listener.phase.AfterPhase</code> as qualifier
for <code>javax.faces.event.PhaseEvent</code>.</p>
+</div>
+<div class="paragraph">
+<p>Such observer-methods look e.g. like:</p>
+</div>
+<div class="listingblock">
+<div class="title">Example</div>
+<div class="content">
+<pre class="CodeRay highlight"><code data-lang="java"><span class="directive">public</span>
<span class="type">void</span> onPhaseStart(<span class="annotation">@Observes</span>
<span class="annotation">@BeforePhase</span>(JsfPhaseId.ANY_PHASE) PhaseEvent
event) {
+    <span class="comment">//...</span>
+}
 
+<span class="directive">public</span> <span class="type">void</span>
onPhaseEnd(<span class="annotation">@Observes</span> <span class="annotation">@AfterPhase</span>(JsfPhaseId.ANY_PHASE)
PhaseEvent event) {
+    <span class="comment">//...</span>
+}</code></pre>
+</div>
+</div>
 </div>
 <div class="sect3">
 <h4 id="_jsf_systemevents">JSF SystemEvents</h4>



Mime
View raw message