Dependency Injection with @Inject in Weld (JSR-299 RI). How is the corresponding @Produces found?
Posted
by Thorbjørn Ravn Andersen
on Stack Overflow
See other posts from Stack Overflow
or by Thorbjørn Ravn Andersen
Published on 2010-04-04T12:00:59Z
Indexed on
2010/04/04
12:03 UTC
Read the original article
Hit count: 311
I have played with the JSR-299 Reference Implementation "Weld" with the purpose of using it in a stand-alone application, and I have had a look at the documentation, and marveled at the magic.
My question is how the producer of a given object to be @Inject'ed is found?
Either the java compiler produces hints for annotations which is easily found by the classloader, or the complete classpath must be traversed loading all classes to see what they do which sounds highly inefficient to me, or it is a completely different approach.
What is the trick?
© Stack Overflow or respective owner