2015-08-25 22:53 GMT+02:00 arjan tijms <arjan.tijms@gmail.com>:
Hi,

On Tue, Aug 25, 2015 at 7:07 PM, Nigel Deakin <nigel.deakin@oracle.com> wrote:
> On 25/08/2015 12:38, arjan tijms wrote:
> This looks very interesting. Does this work with any normal scope?

Yes, all normal scopes that are available in standard Java EE support
this as far as I know.


Events are not mandatory for a normal scope - at least was the case in 1.2 - so JMS can't rely on it for custom normal scopes.
 
There's the small caveat that CDI itself doesn't know about this
automatically for any custom normal scope. That implementation of such
scope (via a Context) must explicitly throw these events.

For example, this is what Mojarra does for the @FlowScoped implementation:

https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIEventFireHelperImpl.java

Which is fired when the scope starts here:
https://github.com/omnifaces/mojarra/blob/master/jsf-ri/src/main/java/com/sun/faces/flow/FlowCDIContext.java#L431

(the exact same code is used for @ViewScoped in Mojarra as well)


> then every time a new request starts, this event is fired which causes an
> instance of the bean to be created for that request?

Yes, that is what this does ;)

Kind regards,
Arjan Tijms
_______________________________________________
cdi-dev mailing list
cdi-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.