<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>In the spec says that;<br><br>5.4 Client Proxies<br><br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">*&nbsp; (WebBeans with scope @Dependent never have circular dependencies.)<br><br>This means that, developer can not write circular referenced @Dependent beans or RI has to do something to prevent them?<br><br>Thanks;<br><br>Gurkan<br><br><div style="font-family: arial,helvetica,sans-serif; font-size: 13px;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Gavin King &lt;gavin@hibernate.org&gt;<br><b><span style="font-weight: bold;">To:</span></b> Gurkan Erdogdu &lt;gurkanerdogdu@yahoo.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> webbeans-dev@lists.jboss.org; Scott Ferguson &lt;ferg@caucho.com&gt;<br><b><span
 style="font-weight: bold;">Sent:</span></b> Friday, January 2, 2009 11:39:14 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [webbeans-dev] Re: Bean.getInjectionPoints()<br></font><br>
@Dependent scoped objects can't all be proxied.<br><br>On Fri, Jan 2, 2009 at 5:54 PM, Gurkan Erdogdu &lt;<a ymailto="mailto:gurkanerdogdu@yahoo.com" href="mailto:gurkanerdogdu@yahoo.com">gurkanerdogdu@yahoo.com</a>&gt; wrote:<br>&gt; Hi;<br>&gt;<br>&gt; Actually the spec requires to return Proxy objects from the<br>&gt; Manager.getInstance(). So the dependency injection does not occur until Bean<br>&gt; method is called, i.o.w Context.get() is not called before the any method<br>&gt; calls on the Bean.<br>&gt;<br>&gt; So, circular reference may not be happened with Proxy usage.<br>&gt;<br>&gt; Gurkan<br>&gt;<br>&gt; ________________________________<br>&gt; From: Gavin King &lt;<a ymailto="mailto:gavin@hibernate.org" href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>&gt;<br>&gt; To: Scott Ferguson &lt;<a ymailto="mailto:ferg@caucho.com" href="mailto:ferg@caucho.com">ferg@caucho.com</a>&gt;<br>&gt; Cc: Michael Keith &lt;<a
 ymailto="mailto:michael.keith@oracle.com" href="mailto:michael.keith@oracle.com">michael.keith@oracle.com</a>&gt;; WebBeans<br>&gt; &lt;<a ymailto="mailto:webbeans-dev@lists.jboss.org" href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a>&gt;; Java Community Process JSR #299 Expert List<br>&gt; &lt;<a ymailto="mailto:JSR-299-EG@jcp.org" href="mailto:JSR-299-EG@jcp.org">JSR-299-EG@jcp.org</a>&gt;<br>&gt; Sent: Friday, January 2, 2009 6:29:46 AM<br>&gt; Subject: Re: [webbeans-dev] Re: Bean.getInjectionPoints()<br>&gt;<br>&gt; On Fri, Jan 2, 2009 at 2:37 PM, Scott Ferguson &lt;<a ymailto="mailto:ferg@caucho.com" href="mailto:ferg@caucho.com">ferg@caucho.com</a>&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; On Dec 30, 2008, at 1:35 PM, Gavin King wrote:<br>&gt;&gt;<br>&gt;&gt;&gt; The spec requires that injection points be validated at init time for<br>&gt;&gt;&gt; any Bean (for XxxxxDependencyException).<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Nick from
 the RI team has noticed that for this to be implementable,<br>&gt;&gt;&gt; we need to add metadata about the injection points of a bean to the<br>&gt;&gt;&gt; Bean interface.<br>&gt;&gt;<br>&gt;&gt; It shouldn't be necessary, since "SimpleBean implements Bean" should be<br>&gt;&gt; responsible for its own validation.&nbsp; It doesn't make sense for the Manager<br>&gt;&gt; implementation to validate the Bean, since that breaks the encapsulation<br>&gt;&gt; model of both Manager and Bean.&nbsp; It's cleaner for Manager to assume the<br>&gt;&gt; Bean<br>&gt;&gt; is valid.<br>&gt;<br>&gt; That only works for Bean implementations provided in the<br>&gt; specification. It does not work for Bean implementations provided by<br>&gt; 3rd-party extensions. We need the dependency validation stuff to work<br>&gt; in the second case also.<br>&gt;<br>&gt;&gt; On a related note, it would be cleaner if the Bean.create() method was<br>&gt;&gt; changed to
 Bean.create(Context) in order to handle circular references.<br>&gt;&gt;<br>&gt;&gt; The logic of Bean.create(Context) would be<br>&gt;&gt;&nbsp; 1. check if Bean is in Context (for circular ref), if so return the bean.<br>&gt;&gt;&nbsp; 2. instantiate the Bean (do not inject/initialize) and put it in Context<br>&gt;&gt; (so we have a ref)<br>&gt;&gt;&nbsp; 3. inject/initialize the bean as usual (this may trigger the circular<br>&gt;&gt; reference, which would be resolved by #1 on a second call).<br>&gt;<br>&gt; Bean already has a reference to the Manager and can call<br>&gt; Manager.getContext(myScope). So the extra parameter would not be<br>&gt; necessary.<br>&gt;<br>&gt; But what you're really saying is that it's better to handle circular<br>&gt; references from Bean.create() than from Manager.getInstance(). OK,<br>&gt; that's really interesting, let me chat to Pete Muir about that and get<br>&gt; back to you.<br>&gt;<br>&gt; --<br>&gt; Gavin
 King<br>&gt; <a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br>&gt; <a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br>&gt; <a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br>&gt; <a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br>&gt; _______________________________________________<br>&gt; webbeans-dev mailing list<br>&gt; <a ymailto="mailto:webbeans-dev@lists.jboss.org" href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; webbeans-dev mailing list<br>&gt; <a ymailto="mailto:webbeans-dev@lists.jboss.org"
 href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>&gt; <a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>&gt;<br>&gt;<br><br><br><br>-- <br>Gavin King<br><a ymailto="mailto:gavin.king@gmail.com" href="mailto:gavin.king@gmail.com">gavin.king@gmail.com</a><br><a href="http://in.relation.to/Bloggers/Gavin" target="_blank">http://in.relation.to/Bloggers/Gavin</a><br><a href="http://hibernate.org" target="_blank">http://hibernate.org</a><br><a href="http://seamframework.org" target="_blank">http://seamframework.org</a><br></div></div></div><br>

      </body></html>