Author: gpetracek
Date: Mon Jan 6 14:48:32 2014
New Revision: 1555830
URL: http://svn.apache.org/r1555830
Log:
updated content
Modified:
deltaspike/site/trunk/content/jsf.mdtext
Modified: deltaspike/site/trunk/content/jsf.mdtext
URL:
http://svn.apache.org/viewvc/deltaspike/site/trunk/content/jsf.mdtext?rev=1555830&r1=1555829&r2=1555830&view=diff
==============================================================================
--- deltaspike/site/trunk/content/jsf.mdtext (original)
+++ deltaspike/site/trunk/content/jsf.mdtext Mon Jan 6 14:48:32 2014
@@ -951,9 +951,74 @@ Example - Terminate all conversations:
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
`@PostRenderView` callback.
+## Sub-Conversation-Groups
+
+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.
+
+Example - Explicitly listing beans of a sub-group:
+
+ :::java
+ public class MyGroup{}
+
+ @GroupedConversationScoped
+ @ConversationGroup(MyGroup.class)
+ public class BeanA {}
+
+ @GroupedConversationScoped
+ @ConversationGroup(MyGroup.class)
+ public class BeanB {}
+
+ @GroupedConversationScoped
+ @ConversationGroup(MyGroup.class)
+ public class BeanC {}
+
+ @ConversationSubGroup(subGroup = {BeanA.class, BeanB.class})
+ public class MySubGroup extends MyGroup {}
+
+ //or
+
+ @ConversationSubGroup(of = MyGroup.class, subGroup = {BeanA.class,
BeanB.class})
+ public class MySubGroup {}
+
+
+Example - Terminating a sub-group:
+
+ :::java
+ @Inject
+ private GroupedConversationManager conversationManager;
+
+ //...
+ this.conversationManager.closeConversationGroup(MySubGroup.class);
+
+
+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:
+
+Example - Implicit sub-group:
+
+ :::java
+ public interface Wizard {}
+
+ @ConversationSubGroup(of = MyGroup.class, subGroup = Wizard.class)
+ public class ImplicitSubGroup
+ {
+ }
+
+ @Named("myWizard")
+ @GroupedConversationScoped
+ @ConversationGroup(MyGroup.class)
+ public class WizardController implements Serializable, Wizard
+ {
+ //...
+ }
+
+ this.conversationManager.closeConversationGroup(ImplicitSubGroup.class);
+
+In the listing above all beans which implement the Wizard interface will be
closed as soon as you close the ImplicitSubGroup.
+
# Support of EAR deployments
Before using features described by this page, please ensure that you are aware
of [DELTASPIKE-335](https://issues.apache.org/jira/browse/DELTASPIKE-335) and
the corresponding impact.
# Hints
-Using errorView, DefaultErrorView or ViewNavigationHandler will fail with Weld
versions below 1.1.10 due to
[WELD-1178](https://issues.jboss.org/browse/WELD-1178).
+Using errorView, DefaultErrorView or ViewNavigationHandler will fail with Weld
versions below 1.1.10 due to
[WELD-1178](https://issues.jboss.org/browse/WELD-1178).
\ No newline at end of file