<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>&gt;&gt;&gt;Otherwise InjectionPoint#isDelegate() would always return false<br>No, Decorators are also beans and you can get its injection points with getInjectionPoints that one of them is @delegate therefore isDelegate returns true.<br><br>I think that "InjectionPoint injection" in the spec. has never written for that DependentScoped beans are injected into decorator delegates.<br><br>Thanks;<br><br>--Gurkan<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Sven Linstaedt &lt;sven.linstaedt@googlemail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> Pete Muir
 &lt;pmuir@redhat.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> Weld-Dev List &lt;weld-dev@lists.jboss.org&gt;<br><b><span style="font-weight: bold;">Sent:</span></b> Fri, April 9, 2010 12:16:46 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [weld-dev] Spec clarification needed<br></font><br><meta http-equiv="x-dns-prefetch-control" content="off">According to the java docs, I would also suppose your expression to be true. Otherwise InjectionPoint#isDelegate() would always return false, making this method dispensable. The interesting point imho is injecting the InjectionPoint in other cases than producer methods. I have not seen examples for this usage in the spec.<br>
<br>br, Sven<br><br><br><div class="gmail_quote">2010/4/9 Pete Muir <span dir="ltr">&lt;<a rel="nofollow" ymailto="mailto:pmuir@redhat.com" target="_blank" href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5">Given these beans and decorators (enabled)<br>
<br>
interface Animal {<br>
 &nbsp; &nbsp; &nbsp; &nbsp;String hello();<br>
}<br>
<br>
class Cat implements Animal {<br>
 &nbsp;@Inject private InjectionPoint injectionPoint;<br>
<br>
 &nbsp;public String hello() {<br>
 &nbsp; &nbsp; return "hello";<br>
 &nbsp;}<br>
<br>
 &nbsp;public InjectionPoint getInjectionPoint() {<br>
 &nbsp; &nbsp; return injectionPoint;<br>
 &nbsp;}<br>
}<br>
<br>
@Decorator<br>
class AnimalDecorator implements Animal {<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;@Inject @Delegate<br>
 &nbsp; &nbsp; &nbsp; &nbsp;private Animal bean;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;public String hello() {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;return bean.hello() + " world!";<br>
 &nbsp; &nbsp; &nbsp; &nbsp;}<br>
}<br>
<br>
class Cattery {<br>
<br>
 &nbsp;@Inject Cat cat;<br>
<br>
 &nbsp;Cat getCat() {<br>
 &nbsp; &nbsp; return cat;<br>
 &nbsp;}<br>
<br>
}<br>
<br>
Should<br>
<br>
cattery.getCat().getInjectionPoint().isDelegate() return true or false?<br>
<br>
I believe it should return true, as Cat is being decorated, and hence injected into the decorator delegate injection point.<br>
<br>
Ref is <a rel="nofollow" target="_blank" href="https://jira.jboss.org/jira/browse/CDITCK-138">https://jira.jboss.org/jira/browse/CDITCK-138</a><br>
_______________________________________________<br>
weld-dev mailing list<br>
<a rel="nofollow" ymailto="mailto:weld-dev@lists.jboss.org" target="_blank" href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a rel="nofollow" target="_blank" href="https://lists.jboss.org/mailman/listinfo/weld-dev">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div></div></blockquote></div><br>
<meta http-equiv="x-dns-prefetch-control" content="on"></div></div>
</div><br>




      <hr size="1"><FONT face=Arial size=-1>Yahoo! Türkiye açıldı!<br>
Haber, Ekonomi, Videolar, Oyunlar hepsi Yahoo! Türkiye&#39;de!<br><a href="http://tr.yahoo.com/">www.yahoo.com.tr</a></font></body></html>