<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Just my comment:<br><br>For adding the new API for this complicates the specification.<br>I think, specification provides the necessary API related with Bean creation. As I said, these concerns are left to the implementations.<br><br>Gurkan<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><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> Scott Ferguson <ferg@caucho.com><br><b><span style="font-weight: bold;">Cc:</span></b> Michael Keith <michael.keith@oracle.com>; WebBeans <webbeans-dev@lists.jboss.org>; Java Community Process JSR #299 Expert
List <JSR-299-EG@jcp.org><br><b><span style="font-weight: bold;">Sent:</span></b> Friday, January 2, 2009 7:19:20 AM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [webbeans-dev] Re: Bean.getInjectionPoints()<br></font><br>
On Fri, Jan 2, 2009 at 3:42 PM, Gavin King <<a ymailto="mailto:gavin@hibernate.org" href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>> wrote:<br><br>> Actually I think there is a better way to solve the problem, but I<br>> need to talk it over with Pete.<br><br>The alternate solution is something like:<br><br> interface CreationalContext {<br> void add(Bean<X> bean, X instance); //registers an "incomplete" instance<br> }<br><br> interface Contextual<T> {<br> public abstract T create(CreationalContext ctx);<br> ...<br> }<br><br> interface Context {<br> public <T> T get(Contextual<T> bean); //get any existing instance<br> public <T> T get(Contextual<T> bean, CreationalContext ctx);<br>//get or create an instance<br><br> public Class<?
extends Annotation> getScopeType();<br> boolean isActive();<br> }<br><br> interface Manager {<br> Object getInstanceToInject(CreationalContext ctx,<br>InjectionPoint ij, Type type, Annotation... bindings);<br> ...<br> }<br><br>And getInstanceToInject() would be smart enough to return any object<br>that had already been registered with the CreationalContext.<br><br>Note that this solution addresses the problem of circular references,<br>and also fixes a hole in how the Manager knows about the<br>InjectionPoint.<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></div></div></div><br>
</body></html>