<div dir="ltr">What is the need exactly ? Beeing able to scope a component to a Session? If so it is now possible to define a scope to a component thanks to <a href="https://jira.exoplatform.org/browse/KER-258">https://jira.exoplatform.org/browse/KER-258</a>. Out of the box, the kernel supports the scope Singleton, ApplicationScoped and Dependent. By adding some configuration you can extend the list to SessionScoped and RequestScoped. Here is the configuration to add if you want both:<div>

<br></div><div><div><span class="" style="white-space:pre">        </span>&lt;component&gt;</div><div><span class="" style="white-space:pre">                </span>&lt;key&gt;org.exoplatform.container.context.ContextManager&lt;/key&gt;</div>
<div>
<span class="" style="white-space:pre">                </span>&lt;type&gt;org.exoplatform.container.context.ContextManagerImpl&lt;/type&gt;</div><div><span class="" style="white-space:pre">                </span>&lt;component-plugins&gt;</div><div>
<span class="" style="white-space:pre">                        </span>&lt;component-plugin&gt;</div>
<div><span class="" style="white-space:pre">                                </span>&lt;name&gt;main-scopes&lt;/name&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;set-method&gt;addContexts&lt;/set-method&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;type&gt;org.exoplatform.container.context.ContextPlugin&lt;/type&gt;</div>

<div><span class="" style="white-space:pre">                                </span>&lt;init-params&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;object-param&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;name&gt;request-scope&lt;/name&gt;</div>

<div><span class="" style="white-space:pre">                                                </span>&lt;object type=&quot;org.exoplatform.container.context.RequestContext&quot;/&gt;</div><div><span class="" style="white-space:pre">                                        </span>&lt;/object-param&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;object-param&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;name&gt;session-scope&lt;/name&gt;</div><div><span class="" style="white-space:pre">                                                </span>&lt;object type=&quot;org.exoplatform.container.context.SessionContext&quot;/&gt;</div>

<div><span class="" style="white-space:pre">                                        </span>&lt;/object-param&gt;</div><div><span class="" style="white-space:pre">                                </span>&lt;/init-params&gt;</div><div><span class="" style="white-space:pre">                        </span>&lt;/component-plugin&gt;</div>

<div><span class="" style="white-space:pre">                </span>&lt;/component-plugins&gt;</div><div><span class="" style="white-space:pre">        </span>&lt;/component&gt;</div></div><div><br></div><div>Please note that the components that you want to scope to SessionScoped or RequestScoped must be proxyable as they are normal scopes (which means that you will access to the methods through a proxy and you must not access to the fields directly), moreover components that you want to scope to SessionScoped must be Serializable as SessionScoped is a passivating scope.</div>

<div><br></div><div>Please also note that thanks to <span style="color:rgb(51,51,51);font-family:&#39;Helvetica Neue&#39;,Helvetica,Arial,sans-serif;font-size:13px;line-height:20px">KER-252 you can use the annotations defined in JSR 330 such as Inject</span></div>

















</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 28, 2013 at 3:36 PM, Lucas Ponce <span dir="ltr">&lt;<a href="mailto:lponce@redhat.com" target="_blank">lponce@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
There is a issue in current master that is impacting to REST management services in GateIn.<br>
<br>
<a href="https://issues.jboss.org/browse/GTNPORTAL-3308" target="_blank">https://issues.jboss.org/browse/GTNPORTAL-3308</a><br>
<br>
Investigating it looks like that issue appears since migration to 2.6.0-Alpha3 core.<br>
<br>
Main symptom is a NPE in POMSessionManager class:<br>
<br>
<a href="https://github.com/gatein/gatein-portal/blob/428874e25ee9e6dada3fd1a54a4aa9f02f42d641/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java#L224-L229" target="_blank">https://github.com/gatein/gatein-portal/blob/428874e25ee9e6dada3fd1a54a4aa9f02f42d641/component/portal/src/main/java/org/exoplatform/portal/pom/config/POMSessionManager.java#L224-L229</a><br>


<br>
One of the changes of 2.6.0-Alpha3 is to drop the SessionManagerContainer interface from PortalContainer.<br>
<br>
Is there a workaround to access to same functionality in order to fix this issue ?<br>
<br>
Thanks in advance,<br>
Lucas<br>
_______________________________________________<br>
gatein-dev mailing list<br>
<a href="mailto:gatein-dev@lists.jboss.org">gatein-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/gatein-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/gatein-dev</a><br>
</blockquote></div><br></div>