<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;">* (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 <gavin@hibernate.org><br><b><span style="font-weight: bold;">To:</span></b> Gurkan Erdogdu <gurkanerdogdu@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> webbeans-dev@lists.jboss.org; Scott Ferguson <ferg@caucho.com><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 <<a ymailto="mailto:gurkanerdogdu@yahoo.com" href="mailto:gurkanerdogdu@yahoo.com">gurkanerdogdu@yahoo.com</a>> wrote:<br>> Hi;<br>><br>> Actually the spec requires to return Proxy objects from the<br>> Manager.getInstance(). So the dependency injection does not occur until Bean<br>> method is called, i.o.w Context.get() is not called before the any method<br>> calls on the Bean.<br>><br>> So, circular reference may not be happened with Proxy usage.<br>><br>> Gurkan<br>><br>> ________________________________<br>> From: Gavin King <<a ymailto="mailto:gavin@hibernate.org" href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>><br>> To: Scott Ferguson <<a ymailto="mailto:ferg@caucho.com" href="mailto:ferg@caucho.com">ferg@caucho.com</a>><br>> Cc: Michael Keith <<a
ymailto="mailto:michael.keith@oracle.com" href="mailto:michael.keith@oracle.com">michael.keith@oracle.com</a>>; WebBeans<br>> <<a ymailto="mailto:webbeans-dev@lists.jboss.org" href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a>>; Java Community Process JSR #299 Expert List<br>> <<a ymailto="mailto:JSR-299-EG@jcp.org" href="mailto:JSR-299-EG@jcp.org">JSR-299-EG@jcp.org</a>><br>> Sent: Friday, January 2, 2009 6:29:46 AM<br>> Subject: Re: [webbeans-dev] Re: Bean.getInjectionPoints()<br>><br>> On Fri, Jan 2, 2009 at 2:37 PM, Scott Ferguson <<a ymailto="mailto:ferg@caucho.com" href="mailto:ferg@caucho.com">ferg@caucho.com</a>> wrote:<br>>><br>>> On Dec 30, 2008, at 1:35 PM, Gavin King wrote:<br>>><br>>>> The spec requires that injection points be validated at init time for<br>>>> any Bean (for XxxxxDependencyException).<br>>>><br>>>> Nick from
the RI team has noticed that for this to be implementable,<br>>>> we need to add metadata about the injection points of a bean to the<br>>>> Bean interface.<br>>><br>>> It shouldn't be necessary, since "SimpleBean implements Bean" should be<br>>> responsible for its own validation. It doesn't make sense for the Manager<br>>> implementation to validate the Bean, since that breaks the encapsulation<br>>> model of both Manager and Bean. It's cleaner for Manager to assume the<br>>> Bean<br>>> is valid.<br>><br>> That only works for Bean implementations provided in the<br>> specification. It does not work for Bean implementations provided by<br>> 3rd-party extensions. We need the dependency validation stuff to work<br>> in the second case also.<br>><br>>> On a related note, it would be cleaner if the Bean.create() method was<br>>> changed to
Bean.create(Context) in order to handle circular references.<br>>><br>>> The logic of Bean.create(Context) would be<br>>> 1. check if Bean is in Context (for circular ref), if so return the bean.<br>>> 2. instantiate the Bean (do not inject/initialize) and put it in Context<br>>> (so we have a ref)<br>>> 3. inject/initialize the bean as usual (this may trigger the circular<br>>> reference, which would be resolved by #1 on a second call).<br>><br>> Bean already has a reference to the Manager and can call<br>> Manager.getContext(myScope). So the extra parameter would not be<br>> necessary.<br>><br>> But what you're really saying is that it's better to handle circular<br>> references from Bean.create() than from Manager.getInstance(). OK,<br>> that's really interesting, let me chat to Pete Muir about that and get<br>> back to you.<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>> _______________________________________________<br>> webbeans-dev mailing list<br>> <a ymailto="mailto:webbeans-dev@lists.jboss.org" href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>><br>><br>> _______________________________________________<br>> webbeans-dev mailing list<br>> <a ymailto="mailto:webbeans-dev@lists.jboss.org"
href="mailto:webbeans-dev@lists.jboss.org">webbeans-dev@lists.jboss.org</a><br>> <a href="https://lists.jboss.org/mailman/listinfo/webbeans-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/webbeans-dev</a><br>><br>><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>