Hi Mark,<br><br>so if the Logger is not serializable, but insteads gets reinjected (and therefore recreated?) after deserialization of the owning bean, what lifecycle has the Logger bean? IMHO it would only make sense to destroy the logger, if it is not serialized with the owning bean. Currently the @Dependent scoped bean inherits the lifespan of the owning bean.<br>
<br>In addition... do you have any clue if there is a CDI counterpart for EJB&#39;s @PrePassivate and @PostActivate handles?<br><br>br, Sven<br><br><br><div class="gmail_quote">2010/2/16 Mark Struberg <span dir="ltr">&lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;</span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">&gt; I think you must use a proxy.<br>
<br>
</div>But &#39;you&#39; means the programmer of the application has to do this manually and not the container, isn&#39;t?<br>
<br>
Supporting static injection would really be cool in this case!<br>
Or supporting re-injection after re-activation (would be more difficult I guess).<br>
<br>
LieGrue,<br>
strub<br>
<br>
<br>
--- Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt; schrieb am Di, 16.2.2010:<br>
<br>
&gt; Von: Pete Muir &lt;<a href="mailto:pmuir@redhat.com">pmuir@redhat.com</a>&gt;<br>
&gt; Betreff: Re: [weld-dev] Passivating Capabilities check.<br>
<div class="im">&gt; An: &quot;Mark Struberg&quot; &lt;<a href="mailto:struberg@yahoo.de">struberg@yahoo.de</a>&gt;<br>
</div>&gt; CC: <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; Datum: Dienstag, 16. Februar, 2010 12:40 Uhr<br>
<div><div></div><div class="h5">&gt;<br>
&gt; On 16 Feb 2010, at 10:11, Mark Struberg wrote:<br>
&gt;<br>
&gt; &gt; Hi!<br>
&gt; &gt;<br>
&gt; &gt; I&#39;m just curious how Weld manages to inject a Logger<br>
&gt; into a @SessionScoped (passivating!) bean.<br>
&gt; &gt;<br>
&gt; &gt; In your example in 1.3.5 you wrote:<br>
&gt; &gt;<br>
&gt; &gt;&gt; class Loggers {<br>
&gt; &gt;&gt;   @Produces Logger<br>
&gt; getLogger(InjectionPoint injectionPoint) {<br>
&gt; &gt;&gt;       return<br>
&gt; Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getSimpleName()<br>
&gt; );<br>
&gt; &gt;&gt;   }<br>
&gt; &gt;&gt; }<br>
&gt; &gt;<br>
&gt; &gt; and<br>
&gt; &gt;&gt; @SessionScoped<br>
&gt; &gt;&gt; public class Permissions implements Serializable<br>
&gt; {<br>
&gt; &gt;&gt;   @Inject Logger log;<br>
&gt; &gt;&gt; ...<br>
&gt; &gt;<br>
&gt; &gt; but the Logger I know are actually not Serializable<br>
&gt; themselfs and since it is @Dependent scoped, we also don&#39;t<br>
&gt; use a proxy for it.<br>
&gt;<br>
&gt; I think you must use a proxy.<br>
&gt;<br>
&gt; &gt;<br>
&gt; &gt; I&#39;d expected a DeploymentException thrown at startup<br>
&gt; in this case, but Weld actually seems to only checks<br>
&gt; passivation stuff for NormalBeans. Anyway, once the session<br>
&gt; get&#39;s passivated, you&#39;ll see a fine<br>
&gt; NotSerializableException.<br>
&gt;<br>
&gt; Well, the passivation capability is checked (of<br>
&gt; Permissions), which includes checking whether the producer<br>
&gt; method is passivation capable (it is, even though Logger<br>
&gt; isn&#39;t serializable, it also isn&#39;t final, so you might return<br>
&gt; a serializable subclass).<br>
&gt;<br>
&gt; I would however expect Weld to throw an<br>
&gt; IllegalProductException - I wrote this test which shows it<br>
&gt; does :-)<br>
&gt;<br>
&gt; <a href="http://fisheye.jboss.org/browse/weld/core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java?r=5841#l45" target="_blank">http://fisheye.jboss.org/browse/weld/core/trunk/tests/src/test/java/org/jboss/weld/tests/serialization/SerializationTest.java?r=5841#l45</a><br>

<br>
</div></div><div class="im">__________________________________________________<br>
Do You Yahoo!?<br>
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails.<br>
<a href="http://mail.yahoo.com" target="_blank">http://mail.yahoo.com</a><br>
<br>
_______________________________________________<br>
</div><div><div></div><div class="h5">weld-dev mailing list<br>
<a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
</div></div></blockquote></div><br>