This content has been marked as final.
Show 5 replies
-
1. Re: Custom qualifiers
gavin.king Nov 20, 2009 1:42 AM (in response to asookazian)You missed the critical piece of code:
@Produces @LoggedIn User getCurrentUser() { ... }
-
2. Re: Custom qualifiers
asookazian Nov 20, 2009 1:46 AM (in response to asookazian)So when the container goes to inject an instance (and they're not context variables like in Seam), it must find and use a producer method?
So it's always a 1:1 ratio on injectee and producer??? If there's no producer then the injection fails or is null?
-
3. Re: Custom qualifiers
gavin.king Nov 20, 2009 1:53 AM (in response to asookazian)No.
Some beans are producer methods. Some beans are just classes. Some beans are neither.
-
4. Re: Custom qualifiers
asookazian Nov 20, 2009 5:29 AM (in response to asookazian)Ok so you can @Inject in CDI w/o a producer method. But the variable that is injected is originating from a specific context/scope or not? IIRC you stated that there are no context variables in CDI...
-
5. Re: Custom qualifiers
nickarls Nov 20, 2009 7:40 AM (in response to asookazian)A bean only has one scope (@RequestScoped or whatever). It's in that context. Always. Since you can't outject it to another scope.