<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>Well it sounds almost like a user would have to find the outer most value of getTypes to figure out which is the right type.</p>
<p><br>
</p>
<p>This means that popular CDI enabled frameworks, including Camel and&nbsp;DeltaSpike, are potentially doing it wrong</p>
<p><br>
</p>
<p><a href="https://github.com/apache/deltaspike/blob/master/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/bean/BeanBuilder.java#L115" class="OWAAutoLink" id="LPlnk821568" previewremoved="true" title="https://github.com/apache/deltaspike/blob/master/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/bean/BeanBuilder.java#L115
Cmd&#43;Click or tap to follow the link">https://github.com/apache/deltaspike/blob/master/deltaspike/core/api/src/main/java/org/apache/deltaspike/core/util/bean/BeanBuilder.java#L115</a><br>
</p>
<p><a href="https://github.com/apache/camel/blob/master/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java#L365" class="OWAAutoLink" id="LPlnk778613" previewremoved="true">https://github.com/apache/camel/blob/master/components/camel-cdi/src/main/java/org/apache/camel/cdi/CdiCamelExtension.java#L365</a><br>
</p>
<br>
<br>
<div style="color: rgb(0, 0, 0);">
<div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> cdi-dev-bounces@lists.jboss.org &lt;cdi-dev-bounces@lists.jboss.org&gt; on behalf of Martin Kouba &lt;mkouba@redhat.com&gt;<br>
<b>Sent:</b> Monday, December 12, 2016 3:19 AM<br>
<b>To:</b> Mark Struberg<br>
<b>Cc:</b> cdi-dev<br>
<b>Subject:</b> Re: [cdi-dev] Clarification of BeanManager.getReference</font>
<div>&nbsp;</div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Sure thing, bean.getBeanClass() does not have to be in the set of bean
<br>
types (producers, custom beans, bean class with @Typed, ...).<br>
<br>
M<br>
<br>
Dne 12.12.2016 v 09:15 Mark Struberg napsal(a):<br>
&gt; The main point (as mentioned over at CXF) is that one must not use bean.getBeanClass() as type parameter for getReference.<br>
&gt;<br>
&gt; LieGrue,<br>
&gt; strub<br>
&gt;<br>
&gt;<br>
&gt;&gt; Am 12.12.2016 um 09:10 schrieb Martin Kouba &lt;mkouba@redhat.com&gt;:<br>
&gt;&gt;<br>
&gt;&gt; Hi John,<br>
&gt;&gt;<br>
&gt;&gt; the &quot;beanType&quot; parameter is de facto the same as the required type of an<br>
&gt;&gt; injection point. So yes, the param must be one of the bean types and for<br>
&gt;&gt; normal scoped the returned client proxy must implement this type (&#43; all<br>
&gt;&gt; interfaces). Also note that a contextual reference (client for normal<br>
&gt;&gt; scoped) is not required to implement all bean types of the bean.<br>
&gt;&gt;<br>
&gt;&gt; Martin<br>
&gt;&gt;<br>
&gt;&gt; Dne 11.12.2016 v 18:40 John Ament napsal(a):<br>
&gt;&gt;&gt; All,<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; A discussion popped up on a recent CXF vote.&nbsp; As I understand it, per<br>
&gt;&gt;&gt; section 11.3.2 (from CDI 1.2), The Type parameter passed in to<br>
&gt;&gt;&gt; getReference is meant to be the class to proxy for the returned object,<br>
&gt;&gt;&gt; if the object requires a proxy (e.g. a normal scoped bean).&nbsp; Is that<br>
&gt;&gt;&gt; accurate? Or is the underlying type the type of the returned bean, from<br>
&gt;&gt;&gt; Bean.create(CreationalContext) ?<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; John<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; ------------------------------------------------------------------------<br>
&gt;&gt;&gt; NOTICE: This e-mail message and any attachments may contain<br>
&gt;&gt;&gt; confidential, proprietary, and/or privileged information which should be<br>
&gt;&gt;&gt; treated accordingly. If you are not the intended recipient, please<br>
&gt;&gt;&gt; notify the sender immediately by return e-mail, delete this message, and<br>
&gt;&gt;&gt; destroy all physical and electronic copies. Thank you.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; _______________________________________________<br>
&gt;&gt;&gt; cdi-dev mailing list<br>
&gt;&gt;&gt; cdi-dev@lists.jboss.org<br>
&gt;&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" id="LPlnk959484" previewremoved="true">
https://lists.jboss.org/mailman/listinfo/cdi-dev</a>
<div id="LPBorder_GT_14815430888780.6375983749605993" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815430888760.7011501373287141" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815430888770.7927630517774003" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815430888770.8405804328142288"></div>
<div id="LPTitle_14815430888770.9793973323338943" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815430888780.6709989774946834" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank" style="text-decoration: none;">cdi-dev Info Page - JBoss Developer</a></div>
<div id="LPMetadata_14815430888780.467822880220494" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.jboss.org</div>
<div id="LPDescription_14815430888780.8093155591271206" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
List to discuss the development of CDI (the specification) To see the collection of prior postings to the list, visit the cdi-dev Archives.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" id="LPlnk673380" previewremoved="true">http://www.apache.org/licenses/LICENSE-2.0.html</a>).
 For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
<div id="LPBorder_GT_14815430888630.35712512554048437" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815430888610.863285867072054" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815430888620.47886886678182194" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815430888620.005021165229164959"></div>
<div id="LPTitle_14815430888620.701989747670658" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815430888620.38020300427425036" href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank" style="text-decoration: none;">Apache License, Version 2.0</a></div>
<div id="LPMetadata_14815430888620.4579192655340054" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.apache.org</div>
<div id="LPDescription_14815430888630.497945240774738" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION. 1. Definitions.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Martin Kouba<br>
&gt;&gt; Software Engineer<br>
&gt;&gt; Red Hat, Czech Republic<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; cdi-dev mailing list<br>
&gt;&gt; cdi-dev@lists.jboss.org<br>
&gt;&gt; <a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" id="LPlnk360374" previewremoved="true">
https://lists.jboss.org/mailman/listinfo/cdi-dev</a>
<div id="LPBorder_GT_14815431491280.980916607544053" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815431491260.33234952739860835" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815431491270.3281934572348577" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815431491270.8694994018678539"></div>
<div id="LPTitle_14815431491270.6442757740316167" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815431491270.07005282561540604" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank" style="text-decoration: none;">cdi-dev Info Page - JBoss Developer</a></div>
<div id="LPMetadata_14815431491270.9821818273008067" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.jboss.org</div>
<div id="LPDescription_14815431491280.12322793082462824" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
List to discuss the development of CDI (the specification) To see the collection of prior postings to the list, visit the cdi-dev Archives.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
&gt;&gt;<br>
&gt;&gt; Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" id="LPlnk266755" previewremoved="true">http://www.apache.org/licenses/LICENSE-2.0.html</a>).
 For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
<div id="LPBorder_GT_14815431491190.23633589784948272" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815431491170.4502013188468179" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815431491180.06817316841244225" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815431491180.35881790348572684"></div>
<div id="LPTitle_14815431491180.6479070624467651" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815431491180.4515012849098954" href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank" style="text-decoration: none;">Apache License, Version 2.0</a></div>
<div id="LPMetadata_14815431491180.524566429341006" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.apache.org</div>
<div id="LPDescription_14815431491190.0005889003056733788" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION. 1. Definitions.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
&gt;<br>
<br>
-- <br>
Martin Kouba<br>
Software Engineer<br>
Red Hat, Czech Republic<br>
_______________________________________________<br>
cdi-dev mailing list<br>
cdi-dev@lists.jboss.org<br>
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" id="LPlnk377582" previewremoved="true">https://lists.jboss.org/mailman/listinfo/cdi-dev</a>
<div id="LPBorder_GT_14815431491640.12945499636683677" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815431491610.44725948222220513" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815431491630.7131149471618929" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815431491630.8506817653492527"></div>
<div id="LPTitle_14815431491630.13712251399478848" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815431491630.8147382189317476" href="https://lists.jboss.org/mailman/listinfo/cdi-dev" target="_blank" style="text-decoration: none;">cdi-dev Info Page - JBoss Developer</a></div>
<div id="LPMetadata_14815431491630.08255144734966091" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
lists.jboss.org</div>
<div id="LPDescription_14815431491640.36368583708504554" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
List to discuss the development of CDI (the specification) To see the collection of prior postings to the list, visit the cdi-dev Archives.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
<br>
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" id="LPlnk246510" previewremoved="true">http://www.apache.org/licenses/LICENSE-2.0.html</a>).
 For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.
<div id="LPBorder_GT_14815432101970.7170518647092574" style="margin-bottom: 20px; overflow: auto; width: 100%; text-indent: 0px;">
<table id="LPContainer_14815432101950.49839173976604845" cellspacing="0" style="width: 90%; background-color: rgb(255, 255, 255); position: relative; overflow: auto; padding-top: 20px; padding-bottom: 20px; margin-top: 20px; border-top: 1px dotted rgb(200, 200, 200); border-bottom: 1px dotted rgb(200, 200, 200);">
<tbody>
<tr valign="top" style="border-spacing: 0px;">
<td id="TextCell_14815432101960.21265245348251605" colspan="2" style="vertical-align: top; position: relative; padding: 0px; display: table-cell;">
<div id="LPRemovePreviewContainer_14815432101960.04827038354663182"></div>
<div id="LPTitle_14815432101960.8564904935831636" style="top: 0px; color: rgb(227, 30, 37); font-weight: normal; font-size: 21px; font-family: wf_segoe-ui_light, &quot;Segoe UI Light&quot;, &quot;Segoe WP Light&quot;, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; line-height: 21px;">
<a id="LPUrlAnchor_14815432101960.0013396961479583691" href="http://www.apache.org/licenses/LICENSE-2.0.html" target="_blank" style="text-decoration: none;">Apache License, Version 2.0</a></div>
<div id="LPMetadata_14815432101970.9879350839613592" style="margin: 10px 0px 16px; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 14px;">
www.apache.org</div>
<div id="LPDescription_14815432101970.7542803573481003" style="display: block; color: rgb(102, 102, 102); font-weight: normal; font-family: wf_segoe-ui_normal, &quot;Segoe UI&quot;, &quot;Segoe WP&quot;, Tahoma, Arial, sans-serif; font-size: 14px; line-height: 20px; max-height: 100px; overflow: hidden;">
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION. 1. Definitions.</div>
</td>
</tr>
</tbody>
</table>
</div>
<br>
<br>
</div>
</span></font></div>
</div>
<hr>
NOTICE: This e-mail message and any attachments may contain confidential, proprietary, and/or privileged information which should be treated accordingly. If you are not the intended recipient, please notify the sender immediately by return e-mail, delete this
 message, and destroy all physical and electronic copies. Thank you.
</body>
</html>