deltaspike-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r892998 - in /websites/staging/deltaspike/trunk/content: ./ jsf.html
Date Mon, 06 Jan 2014 14:48:38 GMT
Author: buildbot
Date: Mon Jan  6 14:48:38 2014
New Revision: 892998

Log:
Staging update by buildbot for deltaspike

Modified:
    websites/staging/deltaspike/trunk/content/   (props changed)
    websites/staging/deltaspike/trunk/content/jsf.html

Propchange: websites/staging/deltaspike/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Mon Jan  6 14:48:38 2014
@@ -1 +1 @@
-1555642
+1555830

Modified: websites/staging/deltaspike/trunk/content/jsf.html
==============================================================================
--- websites/staging/deltaspike/trunk/content/jsf.html (original)
+++ websites/staging/deltaspike/trunk/content/jsf.html Mon Jan  6 14:48:38 2014
@@ -126,6 +126,7 @@
 </li>
 <li><a href="#grouped-conversations">(Grouped-)Conversations</a><ul>
 <li><a href="#terminating-conversations">Terminating Conversations</a></li>
+<li><a href="#sub-conversation-groups">Sub-Conversation-Groups</a></li>
 </ul>
 </li>
 <li><a href="#support-of-ear-deployments">Support of EAR deployments</a></li>
@@ -989,6 +990,65 @@ If you have an use-case (e.g. a wizard) 
 
 <p>Hint:
 DeltaSpike conversations get closed/restarted immediately instead of keeping them until the
end of the request like std. conversations do, because the behaviour of std. conversations
breaks a lot of use-cases. However, if you really need to keep them until the end of the request,
you can close them in a <code>@PostRenderView</code> callback.</p>
+<h2 id="sub-conversation-groups">Sub-Conversation-Groups</h2>
+<p>Due to the parallel conversation concept of DeltaSpike there is no need of something
like nested conversations. Just use them in parallel and terminate them in a fine-granular
way as soon as you don't need them any longer. As described above, you can terminate a whole
conversation-group. However, sometimes it's essential to have subgroups if you need to end
just a part of an use-case instead of all beans related to an use-case.
+A sub-group is just a class or an interface used to identify a bunch of beans within a group.
To terminate such a sub-group, it's just needed to pass the class/interface to the corresponding
API for terminating a conversation. The sub-group gets detected autom. and instead of terminating
a whole conversation-group, the beans of the sub-group get un-scoped.</p>
+<p>Example - Explicitly listing beans of a sub-group:</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kd">class</span> <span class="nc">MyGroup</span><span class="o">{}</span>
+
+<span class="nd">@GroupedConversationScoped</span>
+<span class="nd">@ConversationGroup</span><span class="o">(</span><span
class="n">MyGroup</span><span class="o">.</span><span class="na">class</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">BeanA</span> <span class="o">{}</span>
+
+<span class="nd">@GroupedConversationScoped</span>
+<span class="nd">@ConversationGroup</span><span class="o">(</span><span
class="n">MyGroup</span><span class="o">.</span><span class="na">class</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">BeanB</span> <span class="o">{}</span>
+
+<span class="nd">@GroupedConversationScoped</span>
+<span class="nd">@ConversationGroup</span><span class="o">(</span><span
class="n">MyGroup</span><span class="o">.</span><span class="na">class</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">BeanC</span> <span class="o">{}</span>
+
+<span class="nd">@ConversationSubGroup</span><span class="o">(</span><span
class="n">subGroup</span> <span class="o">=</span> <span class="o">{</span><span
class="n">BeanA</span><span class="o">.</span><span class="na">class</span><span
class="o">,</span> <span class="n">BeanB</span><span class="o">.</span><span
class="na">class</span><span class="o">})</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">MySubGroup</span> <span class="kd">extends</span> <span
class="n">MyGroup</span> <span class="o">{}</span>
+
+<span class="c1">//or</span>
+
+<span class="nd">@ConversationSubGroup</span><span class="o">(</span><span
class="n">of</span> <span class="o">=</span> <span class="n">MyGroup</span><span
class="o">.</span><span class="na">class</span><span class="o">,</span>
<span class="n">subGroup</span> <span class="o">=</span> <span
class="o">{</span><span class="n">BeanA</span><span class="o">.</span><span
class="na">class</span><span class="o">,</span> <span class="n">BeanB</span><span
class="o">.</span><span class="na">class</span><span class="o">})</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">MySubGroup</span> <span class="o">{}</span>
+</pre></div>
+
+
+<p>Example - Terminating a sub-group:</p>
+<div class="codehilite"><pre><span class="nd">@Inject</span>
+<span class="kd">private</span> <span class="n">GroupedConversationManager</span>
<span class="n">conversationManager</span><span class="o">;</span>
+
+<span class="c1">//...</span>
+<span class="k">this</span><span class="o">.</span><span class="na">conversationManager</span><span
class="o">.</span><span class="na">closeConversationGroup</span><span
class="o">(</span><span class="n">MySubGroup</span><span class="o">.</span><span
class="na">class</span><span class="o">);</span>
+</pre></div>
+
+
+<p>As you see the class/interface of the sub-group has to extend/implement the group
or you specify it via the @ConversationSubGroup#of. With @ConversationSubGroup#subGroup you
can list all beans which belong to the sub-group. If you have a lot of such beans or you would
like to form (sub-)use-case oriented groups, you can use implicit groups:</p>
+<p>Example - Implicit sub-group:</p>
+<div class="codehilite"><pre><span class="kd">public</span> <span
class="kd">interface</span> <span class="nc">Wizard</span> <span class="o">{}</span>
+
+<span class="nd">@ConversationSubGroup</span><span class="o">(</span><span
class="n">of</span> <span class="o">=</span> <span class="n">MyGroup</span><span
class="o">.</span><span class="na">class</span><span class="o">,</span>
<span class="n">subGroup</span> <span class="o">=</span> <span
class="n">Wizard</span><span class="o">.</span><span class="na">class</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">ImplicitSubGroup</span>
+<span class="o">{</span>
+<span class="o">}</span>
+
+<span class="nd">@Named</span><span class="o">(</span><span class="s">&quot;myWizard&quot;</span><span
class="o">)</span>
+<span class="nd">@GroupedConversationScoped</span>
+<span class="nd">@ConversationGroup</span><span class="o">(</span><span
class="n">MyGroup</span><span class="o">.</span><span class="na">class</span><span
class="o">)</span>
+<span class="kd">public</span> <span class="kd">class</span> <span
class="nc">WizardController</span> <span class="kd">implements</span>
<span class="n">Serializable</span><span class="o">,</span> <span
class="n">Wizard</span>
+<span class="o">{</span>
+    <span class="c1">//...</span>
+<span class="o">}</span>
+
+<span class="k">this</span><span class="o">.</span><span class="na">conversationManager</span><span
class="o">.</span><span class="na">closeConversationGroup</span><span
class="o">(</span><span class="n">ImplicitSubGroup</span><span class="o">.</span><span
class="na">class</span><span class="o">);</span>
+</pre></div>
+
+
+<p>In the listing above all beans which implement the Wizard interface will be closed
as soon as you close the ImplicitSubGroup.</p>
 <h1 id="support-of-ear-deployments">Support of EAR deployments</h1>
 <p>Before using features described by this page, please ensure that you are aware of
<a href="https://issues.apache.org/jira/browse/DELTASPIKE-335">DELTASPIKE-335</a>
and the corresponding impact.</p>
 <h1 id="hints">Hints</h1>



Mime
View raw message