<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"><<a href="mailto:mkouba@redhat.com" target="_blank">mkouba@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Actually there'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">> Hi<br>
><br>
> We're running Weld 2.0.3.Final in a Java SE environment and have<br>
> encountered a precarious situation where it seems like Weld is not<br>
> consistent in handling the lifecycle of singleton beans.<br>
><br>
> We have singleton beans with @PostConstruct and @PreDestroy methods.<br>
> During Weld.initialize() all @PostConstruct methods are called. But<br>
> during @PreDestroy methods are never called during Weld.shutdown().<br>
> @PreDestroy is only called on beans which are @ApplicationScoped.<br>
><br>
> Is this according to specification or a bug?<br>
><br>
> Cheers,<br>
> -Kristoffer<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> 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>
><br>
<br>
</blockquote></div><br></div>