<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
On 10-04-20 11:31 AM, Lincoln Baxter, III wrote:
<blockquote
 cite="mid:x2ua3f2f0581004200831u4cca3db1h5401afad9924d576@mail.gmail.com"
 type="cite">Wait -- there's no "Prototype" or "always new" scope?<br>
</blockquote>
@Dependent or @New, from case to case.<br>
<blockquote
 cite="mid:x2ua3f2f0581004200831u4cca3db1h5401afad9924d576@mail.gmail.com"
 type="cite"><br>
--Lincoln<br>
  <br>
  <div class="gmail_quote">On Tue, Apr 20, 2010 at 6:45 AM, Stuart
Douglas <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:stuart@baileyroberts.com.au">stuart@baileyroberts.com.au</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;">I
don't think I will be able to implement the injection of InjectionPoint
into the producer method, but other than that it should be possible to
implement.<br>
    <font color="#888888"><br>
Stuart<br>
    </font>
    <div>
    <div class="h5"><br>
    <br>
On 20/04/2010, at 8:15 PM, Pete Muir wrote:<br>
    <br>
&gt; Yes, I agree. I had raised this issue during spec development -
that there was no truly stateless scope in CDI, where the bean instance
was created every time.<br>
&gt;<br>
&gt; I would like to hear from the 299 EG about this as well.<br>
&gt;<br>
&gt; On 20 Apr 2010, at 04:57, Stuart Douglas wrote:<br>
&gt;<br>
&gt;&gt; I think that there is a real use case for something similar to
the @Unwrap feature of seam 2.<br>
&gt;&gt;<br>
&gt;&gt; I think that it would be possible to implement something like
this:<br>
&gt;&gt;<br>
&gt;&gt; @ConversationScoped<br>
&gt;&gt; public class ManagedPersistenceContext<br>
&gt;&gt; {<br>
&gt;&gt;<br>
&gt;&gt; EntityManager entityManager;<br>
&gt;&gt;<br>
&gt;&gt; @Unwrap<br>
&gt;&gt; @SomeQualifier<br>
&gt;&gt; public EntityManager produce(InjectionPoint injectionPoint)<br>
&gt;&gt; {<br>
&gt;&gt; &nbsp; entityManager.joinTransaction();<br>
&gt;&gt; &nbsp; return entityManager;<br>
&gt;&gt; }<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; public class MyClass<br>
&gt;&gt; {<br>
&gt;&gt; @Inject @SomeQualifier EntityManager entityManager;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; the way I envisage this working is that a proxy gets injected
into MyClass, and this proxy calls ManagedPersistenceContext.produce to
resolve the correct EntityManager to pass the call to every time a
method is invoked on the proxy.<br>
&gt;&gt;<br>
&gt;&gt; I am pretty sure I can implement this in weld-extensions using
JDK proxies, does this sound like a good idea?<br>
&gt;&gt;<br>
&gt;&gt; Stuart<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; seam-dev mailing list<br>
&gt;&gt; <a moz-do-not-send="true"
 href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
&gt;&gt; <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/seam-dev"
 target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
&gt;<br>
    <br>
    <br>
_______________________________________________<br>
seam-dev mailing list<br>
    <a moz-do-not-send="true" href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/seam-dev"
 target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
    </div>
    </div>
  </blockquote>
  </div>
  <br>
  <br clear="all">
  <br>
-- <br>
Lincoln Baxter, III<br>
  <a moz-do-not-send="true" href="http://ocpsoft.com">http://ocpsoft.com</a><br>
  <a moz-do-not-send="true" href="http://scrumshark.com">http://scrumshark.com</a><br>
"Keep it Simple"<br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
seam-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/seam-dev">https://lists.jboss.org/mailman/listinfo/seam-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>