<div dir="ltr">Ok that make sense. Thanks for the clarification!</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Sep 6, 2013 at 4:17 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">javax.inject.Singleton was never supported in CDI 1.0 and 1.1 (final<br>
versions). So it actually cannot be abandoned by CDI :-). But yes, I<br>
think we should deprecate its usage in Weld API and remove the mentioned<br>
chapter from docs. So that only @ApplicationScoped beans should be used.<br>
<br>
Martin<br>
<br>
Dne 6.9.2013 15:40, Kristoffer Sjögren napsal(a):<br>
<div class="im">> Do you mean that Singleton should be abandoned by CDI? Or do you mean to<br>
> clarify its role and/or implement proper lifecycle support for them?<br>
><br>
><br>
> On Fri, Sep 6, 2013 at 2:31 PM, Martin Kouba <<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>>> wrote:<br>
><br>
> 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>
> > 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>
> > _______________________________________________<br>
> > weld-dev mailing list<br>
</div></div>> > <a href="mailto:weld-dev@lists.jboss.org">weld-dev@lists.jboss.org</a> <mailto:<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>
><br>
</blockquote></div><br></div>