[cdi-dev] RequestScoped and Injection Points

Pete Muir pmuir at redhat.com
Sat Sep 10 11:19:07 EDT 2011

The only way to register a bean for every single variant of a qualifier would be to scan injection points. 

I'm only somewhat aware of what exactly you are doing, but really the issue is that CDI is not designed to be used in the way you are trying, which is why you hit this impedance mismatch.

On 10 Sep 2011, at 05:14, John D. Ament wrote:

> Well, I think my issue as that it worked the exact way I needed it to work, so I figured I was fine :-) .  Obviously though, I ran into some limitations with it.
> So just to bounce some ideas off you guys; what would be the correct approach in this case? Assuming that I want it to be taken into account when resolving injection points, do I need to gather metadata around injection points and dynamically build producer method impl's that are generated at deployment type via an extension that did something like:
> 1. Scan for any injection points that match the type(s) as well as qualifier(s) that I am interested in.
> 2. Also understand the scope of the object they are being injected into.

Not sure why you need to do this?

> However, it seems like producers are the one thing that you cannot register at runtime/deployment time.  Is this a case where I would need to create bean instances instead of producer instances?

You can only register beans at runtime using CDI 1.0, no producers, managed beans, etc.

More information about the cdi-dev mailing list