Benjamin Confino the correct answer is:
3. The lifecycle of javax.enterprise.inject.spi.CDI ends
It would be 2. (destroyed when SomeBean is destroyed) if you used @Inject Instance<DependantScopedBean> to obtain the DependantScopedBean bean instance in SomeBean. Note that CDI.current() is a static method and is called in a completely different context.The spec is clear that "An instance of a bean with scope @Dependent obtained by direct invocation of an Instance is a dependent object of the instance of Instance." (see also 6.4.1. Dependent objects) and CDI implements Instance. |