<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2015-08-25 22:53 GMT+02:00 arjan tijms <span dir="ltr">&lt;<a href="mailto:arjan.tijms@gmail.com" target="_blank">arjan.tijms@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<span class=""><br>
On Tue, Aug 25, 2015 at 7:07 PM, Nigel Deakin &lt;<a href="mailto:nigel.deakin@oracle.com">nigel.deakin@oracle.com</a>&gt; wrote:<br>
&gt; On 25/08/2015 12:38, arjan tijms wrote:<br>
</span><span class="">&gt; This looks very interesting. Does this work with any normal scope?<br>
<br>
</span>Yes, all normal scopes that are available in standard Java EE support<br>
this as far as I know.<br>
<br></blockquote><div><br></div><div>Events are not mandatory for a normal scope - at least was the case in 1.2 - so JMS can&#39;t rely on it for custom normal scopes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
There&#39;s the small caveat that CDI itself doesn&#39;t know about this<br>
automatically for any custom normal scope. That implementation of such<br>
scope (via a Context) must explicitly throw these events.<br>
<br>
For example, this is what Mojarra does for the @FlowScoped implementation:<br>
<br>
<a href="https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIEventFireHelperImpl.java" rel="noreferrer" target="_blank">https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIEventFireHelperImpl.java</a><br>
<br>
Which is fired when the scope starts here:<br>
<a href="https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIContext.java#L431" rel="noreferrer" target="_blank">https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIContext.java#L431</a><br>
<br>
(the exact same code is used for @ViewScoped in Mojarra as well)<br>
<span class=""><br>
<br>
&gt; then every time a new request starts, this event is fired which causes an<br>
&gt; instance of the bean to be created for that request?<br>
<br>
</span>Yes, that is what this does ;)<br>
<br>
Kind regards,<br>
Arjan Tijms<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
cdi-dev mailing list<br>
<a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br>
</div></div></blockquote></div><br></div></div>