<div dir="ltr">Thanks! Had it on my todo, but good that you created it ;)</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 27, 2018 at 2:23 PM, Matej Novotny <span dir="ltr">&lt;<a href="mailto:manovotn@redhat.com" target="_blank">manovotn@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">FYI I have taken the liberty to create CDI issue so that this is not forgotten (for I believe that it could be valuable addition).<br>
Feel free to comment - <a href="https://issues.jboss.org/browse/CDI-723" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/CDI-723</a><br>
<span class="HOEnZb"><font color="#888888"><br>
Matej<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
----- Original Message -----<br>
&gt; From: &quot;Martin Kouba&quot; &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;<br>
&gt; To: &quot;arjan tijms&quot; &lt;<a href="mailto:arjan.tijms@gmail.com">arjan.tijms@gmail.com</a>&gt;<br>
&gt; Cc: <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; Sent: Friday, February 16, 2018 11:28:10 AM<br>
&gt; Subject: Re: [cdi-dev] Easy way to get &#39;original&#39; type from alternative producers<br>
&gt;<br>
&gt; Dne 15.2.2018 v 18:15 arjan tijms napsal(a):<br>
&gt; &gt; Hi,<br>
&gt; &gt;<br>
&gt; &gt; On Thu, Feb 15, 2018 at 10:57 AM, Martin Kouba &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a><br>
&gt; &gt; &lt;mailto:<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt;&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     I think it could be a nice feature. Pls file a JIRA issue.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Allright, I&#39;ll do that. Thx!<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;         In order to get that bean, a bunch of quite verbose code is<br>
&gt; &gt;         needed. I.e I came up with:<br>
&gt; &gt;<br>
&gt; &gt;         HttpAuthenticationMechanism mechanism =<br>
&gt; &gt;               createRef(<br>
&gt; &gt;                   beanManager.resolve(<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     This wouldn&#39;t work because BeanManager.resolve() attempts to resolve<br>
&gt; &gt;     the ambiguities thus eliminate all non-alternative beans.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; It actually does seem to work, and I&#39;ve been using it for a while now.<br>
&gt;<br>
&gt; You&#39;re right - you&#39;re actually filtering the alternative bean<br>
&gt; (ApplicationInit producer) and so there is only one bean left.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     This would not work - you would need to distinguish the original<br>
&gt; &gt;     injection point.<br>
&gt; &gt;<br>
&gt; &gt;                   return ...<br>
&gt; &gt;               }<br>
&gt; &gt;         }<br>
&gt; &gt;<br>
&gt; &gt;         Or reuse the @Delegate (perhaps with the @Alternative annotation)<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt;     -1 This might be confusing.<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt; &gt; Agreed with both, it was just a bit of brain storming. Not sure what<br>
&gt; &gt; would be a better name though. @Original? @NonAlternative?<br>
&gt; &gt;<br>
&gt; &gt; Kind regards,<br>
&gt; &gt; Arjan Tijms<br>
&gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
&gt; --<br>
&gt; Martin Kouba<br>
&gt; Senior Software Engineer<br>
&gt; Red Hat, Czech Republic<br>
</div></div><div class="HOEnZb"><div class="h5">&gt; ______________________________<wbr>_________________<br>
&gt; cdi-dev mailing list<br>
&gt; <a href="mailto:cdi-dev@lists.jboss.org">cdi-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/cdi-dev</a><br>
&gt;<br>
&gt; Note that for all code provided on this list, the provider licenses the code<br>
&gt; under the Apache License, Version 2<br>
&gt; (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" target="_blank">http://www.apache.org/<wbr>licenses/LICENSE-2.0.html</a>). For all other ideas<br>
&gt; provided on this list, the provider waives all patent and other intellectual<br>
&gt; property rights inherent in such information.<br>
</div></div></blockquote></div><br></div>