<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>I just tried to implement this and it did not work, and after looking at the spec even if it did work I don't think it would be portable due to the following language:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><i>Suppose beans </i><span style="font: 8.0px Helvetica"><i>A</i></span><i>, </i><span style="font: 8.0px Helvetica"><i>B </i></span><i>and </i><span style="font: 8.0px Helvetica"><i>Z </i></span><i>all have normal scopes. Suppose </i><span style="font: 8.0px Helvetica"><i>A </i></span><i>has an injection point </i><span style="font: 8.0px Helvetica"><i>x</i></span><i>, and </i><span style="font: 8.0px Helvetica"><i>B </i></span><i>has an injection point </i><span style="font: 8.0px Helvetica"><i>y</i></span><i>. Suppose</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><i>further that both </i><span style="font: 8.0px Helvetica"><i>x </i></span><i>and </i><span style="font: 8.0px Helvetica"><i>y </i></span><i>resolve to bean </i><span style="font: 8.0px Helvetica"><i>Z </i></span><i>according to the rules of typesafe resolution. If </i><span style="font: 8.0px Helvetica"><i>a </i></span><i>is the current instance of</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><span style="font: 8.0px Helvetica"><i>A</i></span><i>, and </i><span style="font: 8.0px Helvetica"><i>b </i></span><i>is the current instance of </i><span style="font: 8.0px Helvetica"><i>B</i></span><i>, then both </i><span style="font: 8.0px Helvetica"><i>a.x </i></span><i>and </i><span style="font: 8.0px Helvetica"><i>b.y </i></span><i>refer to the same instance of </i><span style="font: 8.0px Helvetica"><i>Z</i></span><i>. This instance is the current instance</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><i>of </i><span style="font: 8.0px Helvetica"><i>Z</i></span><i>.</i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><i><br></i></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><i><br></i></div></div><div><br></div><div>The other way of providing this is to provide an extension that uses javassist to create @Dependent scoped proxies, these proxies could then call the producer method on every invocation, however it requires a dependency on javassist.</div><div><br></div><div><br></div><div>Stuart</div><div><br><div><div>On 08/06/2010, at 3:19 AM, Pete Muir wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div><br>On 7 Jun 2010, at 12:19, Stuart Douglas wrote:<br><br><blockquote type="cite">I have been thinking about adding a stateless scope to weld extensions, that would allow for a similar construct to @Unwrap from seam 2. Basically if you have a Stateless producer method the the producer will be called every time a method on the proxy is invoked. <br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">The main downside that I can see is that beans that have a stateless scope no longer have a well defined lifecycle, so disposal methods etc will not be called, however as long as this is documented I don't think that this is much of a problem.<br></blockquote><br>Yeah, I think there is a strong case for providing this.</div></blockquote></div><br></div></body></html>