<div dir="ltr">Do you mean that Singleton should be abandoned by CDI? Or do you mean to clarify its role and/or implement proper lifecycle support for them?</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 6, 2013 at 2:31 PM, Martin Kouba <span dir="ltr">&lt;<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Actually there&#39;s no singleton scope and corresponding built-in context<br>
defined in the CDI spec. Though Weld API contains<br>
org.jboss.weld.context.SingletonContext. Also the docs are outdated<br>
(chapter 5.4. The singleton pseudo-scope). I think relevant classes<br>
should be deprecated and the docs updated.<br>
<br>
With regard to lifecycle callbacks - Weld only invalidates application<br>
context during shutdown right now [1].<br>
<br>
Martin<br>
<br>
[1]<br>
<a href="https://github.com/weld/core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java#L56" target="_blank">https://github.com/weld/core/blob/master/impl/src/main/java/org/jboss/weld/bootstrap/WeldRuntime.java#L56</a><br>

<br>
Dne 6.9.2013 14:09, Kristoffer Sjögren napsal(a):<br>
<div><div class="h5">&gt; Hi<br>
&gt;<br>
&gt; We&#39;re running Weld 2.0.3.Final in a Java SE environment and have<br>
&gt; encountered a precarious situation where it seems like Weld is not<br>
&gt; consistent in handling the lifecycle of singleton beans.<br>
&gt;<br>
&gt; We have singleton beans with @PostConstruct and @PreDestroy methods.<br>
&gt; During Weld.initialize() all @PostConstruct methods are called. But<br>
&gt; during @PreDestroy methods are never called during Weld.shutdown().<br>
&gt; @PreDestroy is only called on beans which are @ApplicationScoped.<br>
&gt;<br>
&gt; Is this according to specification or a bug?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; -Kristoffer<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; weld-dev mailing list<br>
&gt; <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/weld-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/weld-dev</a><br>
&gt;<br>
<br>
</blockquote></div><br></div>