Ahh ok - We're talking about lookups on invocation, not injection -- got it. That could definitely be useful.<br><br><div class="gmail_quote">On Tue, Apr 20, 2010 at 12:55 PM, Pete Muir <span dir="ltr"><<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>></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;">No, that is not the same as a fully stateless scope where the object is looked up everytime it is invoked, not everytime it is injected.<br>
<div><div></div><div class="h5"><br>
On 20 Apr 2010, at 17:07, Lincoln Baxter, III wrote:<br>
<br>
> Ok yeah, thats what I thought.<br>
><br>
> @Produces @New -- would that not work?<br>
><br>
> On Tue, Apr 20, 2010 at 12:06 PM, Marius Bogoevici <<a href="mailto:marius.bogoevici@gmail.com">marius.bogoevici@gmail.com</a>> wrote:<br>
> On 10-04-20 11:31 AM, Lincoln Baxter, III wrote:<br>
>> Wait -- there's no "Prototype" or "always new" scope?<br>
> @Dependent or @New, from case to case.<br>
><br>
>><br>
>> --Lincoln<br>
>><br>
>> On Tue, Apr 20, 2010 at 6:45 AM, Stuart Douglas <<a href="mailto:stuart@baileyroberts.com.au">stuart@baileyroberts.com.au</a>> wrote:<br>
>> 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>
>><br>
>> Stuart<br>
>><br>
>><br>
>> On 20/04/2010, at 8:15 PM, Pete Muir wrote:<br>
>><br>
>> > 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>
>> ><br>
>> > I would like to hear from the 299 EG about this as well.<br>
>> ><br>
>> > On 20 Apr 2010, at 04:57, Stuart Douglas wrote:<br>
>> ><br>
>> >> I think that there is a real use case for something similar to the @Unwrap feature of seam 2.<br>
>> >><br>
>> >> I think that it would be possible to implement something like this:<br>
>> >><br>
>> >> @ConversationScoped<br>
>> >> public class ManagedPersistenceContext<br>
>> >> {<br>
>> >><br>
>> >> EntityManager entityManager;<br>
>> >><br>
>> >> @Unwrap<br>
>> >> @SomeQualifier<br>
>> >> public EntityManager produce(InjectionPoint injectionPoint)<br>
>> >> {<br>
>> >> entityManager.joinTransaction();<br>
>> >> return entityManager;<br>
>> >> }<br>
>> >> }<br>
>> >><br>
>> >> public class MyClass<br>
>> >> {<br>
>> >> @Inject @SomeQualifier EntityManager entityManager;<br>
>> >> }<br>
>> >><br>
>> >> 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>
>> >><br>
>> >> I am pretty sure I can implement this in weld-extensions using JDK proxies, does this sound like a good idea?<br>
>> >><br>
>> >> Stuart<br>
>> >> _______________________________________________<br>
>> >> seam-dev mailing list<br>
>> >> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
>> >> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>> ><br>
>><br>
>><br>
>> _______________________________________________<br>
>> seam-dev mailing list<br>
>> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>><br>
>><br>
>><br>
>> --<br>
>> Lincoln Baxter, III<br>
>> <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
>> <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
>> "Keep it Simple"<br>
>><br>
>> _______________________________________________<br>
>> seam-dev mailing list<br>
>><br>
>> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
>> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
>><br>
>><br>
>><br>
><br>
><br>
><br>
><br>
> --<br>
> Lincoln Baxter, III<br>
> <a href="http://ocpsoft.com" target="_blank">http://ocpsoft.com</a><br>
> <a href="http://scrumshark.com" target="_blank">http://scrumshark.com</a><br>
> "Keep it Simple"<br>
> _______________________________________________<br>
> seam-dev mailing list<br>
> <a href="mailto:seam-dev@lists.jboss.org">seam-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/seam-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/seam-dev</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Lincoln Baxter, III<br><a href="http://ocpsoft.com">http://ocpsoft.com</a><br><a href="http://scrumshark.com">http://scrumshark.com</a><br>"Keep it Simple"<br>