Pete<br><br><div class="gmail_quote">On Sat, Sep 10, 2011 at 11:19 AM, Pete Muir <span dir="ltr">&lt;<a href="mailto:pmuir@redhat.com" target="_blank">pmuir@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

The only way to register a bean for every single variant of a qualifier would be to scan injection points.<br>
<br></blockquote><div><br>Right, so assuming I use something like Solder&#39;s BeanBuilder to create the necessary beans behind the scene, I would be able to satisfy every one of those injection points, correct?<br> </div>

<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
I&#39;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.<br></blockquote><div><br>If you have another way for me to think about it, I&#39;m all eyes (so to speak).  The idea is that I create a JMS session bound at the HTTP (Request|Session) Scope or bound at an ApplicationScope, or with some new scope (this should really be determined at runtime somehow; similar to a conversation or a dependent scoped object):<br>

<br>@Inject @JMSConnection(factory=&quot;/ConnectionFactory&quot;) Session session;<br><br>Then within the same scope, reuse this session to inject a MessageProducer:<br><br>@Inject @JMSConnection(factory=&quot;/ConnectionFactory&quot;) @JMSDestination(lookup=&quot;jms/SomeDestination&quot;)<br>

MessageProducer messageProducer;<br><br>I would think that&#39;s enough for an application developer to handle the remaining injection (e.g. provide a producer field/method to handle the real injection, or something like that; maybe).<br>
 </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><br>
<br>
On 10 Sep 2011, at 05:14, John D. Ament wrote:<br>
<br>
&gt; 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.<br>
&gt;<br>
&gt; 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&#39;s that are generated at deployment type via an extension that did something like:<br>


&gt;<br>
&gt; 1. Scan for any injection points that match the type(s) as well as qualifier(s) that I am interested in.<br>
&gt; 2. Also understand the scope of the object they are being injected into.<br>
<br>
</div>Not sure why you need to do this?<br></blockquote><div><br>Scope? We need to consolidate the number of objects being created.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div><br>
&gt;<br>
&gt; 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?<br>
<br>
</div>You can only register beans at runtime using CDI 1.0, no producers, managed beans, etc.</blockquote></div><br><br>John<br><br>