<div class="gmail_quote">On Tue, Jul 21, 2009 at 10:50 AM, Peter Royle <span dir="ltr">&lt;<a href="mailto:howardmoon@screamingcoder.com">howardmoon@screamingcoder.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sorry to drag this up again, but this has changed now that<br>
manager.getReference(...) requires a CreationalContext, about which I<br>
know very little. I&#39;ll try reading the latest spec soon, but in the<br>
meantime if anyone has any silver bullets please let me know.<br>
<br>
I&#39;m currently using this utility method:<br>
<br>
     public static &lt;T&gt; T getInstanceByType(BeanManager manager,<br>
Class&lt;T&gt; type, Annotation... bindings) {<br>
         return (T)manager.getReference(<br>
                 manager.getBeans(type).iterator().next(), type, null);<br>
     }<br>
<br>
Obviously it&#39;s that null at the end (where CreationalContext should<br>
be) that&#39;s causing the problem.</blockquote><div><br>You just use the manager to create a CreationalContext for the bean.<br><br>beanManager.createCreationalContext(bean)<br><br>If an instance already exists, the CreationalContext is not used. Someone correct me if I am wrong.<br>
 <br>-Dan</div></div><br>-- <br>Dan Allen<br>Senior Software Engineer, Red Hat | Author of Seam in Action<br>Registered Linux User #231597<br><br><a href="http://mojavelinux.com">http://mojavelinux.com</a><br><a href="http://mojavelinux.com/seaminaction">http://mojavelinux.com/seaminaction</a><br>
<a href="http://in.relation.to/Bloggers/Dan">http://in.relation.to/Bloggers/Dan</a><br>