<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 &lt;gavin@hibernate.org&gt;<br><b><span style="font-weight: bold;">To:</span></b> Scott Ferguson &lt;ferg@caucho.com&gt;<br><b><span style="font-weight: bold;">Cc:</span></b> Michael Keith &lt;michael.keith@oracle.com&gt;; WebBeans &lt;webbeans-dev@lists.jboss.org&gt;; Java Community Process JSR #299 Expert
 List &lt;JSR-299-EG@jcp.org&gt;<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 &lt;<a ymailto="mailto:gavin@hibernate.org" href="mailto:gavin@hibernate.org">gavin@hibernate.org</a>&gt; wrote:<br><br>&gt; Actually I think there is a better way to solve the problem, but I<br>&gt; need to talk it over with Pete.<br><br>The alternate solution is something like:<br><br>&nbsp;  interface CreationalContext {<br>&nbsp; &nbsp; &nbsp;  void add(Bean&lt;X&gt; bean, X instance); //registers an "incomplete" instance<br>&nbsp;  }<br><br>&nbsp;  interface Contextual&lt;T&gt; {<br>&nbsp; &nbsp; &nbsp;  public abstract T create(CreationalContext ctx);<br>&nbsp; &nbsp; &nbsp;  ...<br>&nbsp;  }<br><br>&nbsp;  interface Context {<br>&nbsp; &nbsp; &nbsp;  public &lt;T&gt; T get(Contextual&lt;T&gt; bean); //get any existing instance<br>&nbsp; &nbsp; &nbsp;  public &lt;T&gt; T get(Contextual&lt;T&gt; bean, CreationalContext ctx);<br>//get or create an instance<br><br>&nbsp; &nbsp; &nbsp;  public Class&lt;?
 extends Annotation&gt; getScopeType();<br>&nbsp; &nbsp; &nbsp;  boolean isActive();<br>&nbsp;  }<br><br>&nbsp;  interface Manager {<br>&nbsp; &nbsp; &nbsp;  Object getInstanceToInject(CreationalContext ctx,<br>InjectionPoint ij, Type type, Annotation... bindings);<br>&nbsp; &nbsp; &nbsp;  ...<br>&nbsp;  }<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>