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
https://jira.exoplatform.org/browse/KER-258. 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:
<component>
<key>org.exoplatform.container.context.ContextManager</key>
<type>org.exoplatform.container.context.ContextManagerImpl</type>
<component-plugins>
<component-plugin>
<name>main-scopes</name>
<set-method>addContexts</set-method>
<type>org.exoplatform.container.context.ContextPlugin</type>
<init-params>
<object-param>
<name>request-scope</name>
<object type="org.exoplatform.container.context.RequestContext"/>
</object-param>
<object-param>
<name>session-scope</name>
<object type="org.exoplatform.container.context.SessionContext"/>
</object-param>
</init-params>
</component-plugin>
</component-plugins>
</component>
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.
Please also note that thanks to KER-252 you can use the annotations defined in JSR 330 such as Inject