On Mon, Oct 19, 2009 at 7:55 PM, Roberto Chinnici
<Roberto.Chinnici(a)sun.com> wrote:
But that's the issue, because it triggers scanning of all
application
classes.
No it doesn't! Thats the whole point!
Pete of course has implemented this without scanning of non-bean
deployment archives.
On top of that, it's speculative scanning. If the bean isn't
discovered until we find a use of the "second bean" (with @New), should we
tentatively retain as valid all the resources the bean declares, during
scanning, only to discard them if it turns out the bean does not actually
exist (i.e. there is no usage with @New)? I'm also starting to wonder where
this process ends, given that the SPI lets the application register new
beans at runtime. Does that mean that all resources declared anywhere are
valid?
Nononononono!
The 299 impl creates the Bean object for the "second bean"
(unfortunate term) when it notices the injection point with @New.
Obviously we thought this through carefully to be sure that it was
implementable.
--
Gavin King
gavin.king(a)gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org