And before there are any questions: it's not directly stated inside the CDI spec but in the TCK documentation:
"JSR-330 - CDI builds on JSR-330, and as such JSR-299 implementations must additionally pass the JSR-330 TCK."
again: I agree with Martin that you should better not use it. But it should work nontheless.
----- Original Message -----
> From: Mark Struberg <email@example.com>>T he wording is not correct.
> To: Martin Kouba <firstname.lastname@example.org>; Kristoffer Sjögren <email@example.com>
> Cc: "firstname.lastname@example.org" <email@example.com>
> Sent: Saturday, 7 September 2013, 19:22
> Subject: Re: [weld-dev] PostConstruct & PreDestroy in Java SE
> Each JSR-299 Container must _fully_ implement the JSR-330 specification and pass
> the JSR-330 TCK. Thus each CDI Container MUST support javax.inject.Singleton.
> But it's actually not really defined in detail how this scope should behave.
> And the atinject and EE specs also define that @PostConstruct and @PreDestroy
> must work for @Singleton beans. So this is imo a bug. But otoh I personally
> would suggest to not use javax.inject.Singleton because of the aforementioned
> underspecified behaviout.
> ----- Original Message -----
>> From: Martin Kouba <firstname.lastname@example.org>
>> To: Kristoffer Sjögren <email@example.com>
>> Cc: firstname.lastname@example.org
>> Sent: Friday, 6 September 2013, 14:31
>> Subject: Re: [weld-dev] PostConstruct & PreDestroy in Java SE
>> Actually there's no singleton scope and corresponding built-in context
>> defined in the CDI spec. Though Weld API contains
>> org.jboss.weld.context.SingletonContext. Also the docs are outdated
>> (chapter 5.4. The singleton pseudo-scope). I think relevant classes
>> should be deprecated and the docs updated.
>> With regard to lifecycle callbacks - Weld only invalidates application
>> context during shutdown right now .
>> Dne 6.9.2013 14:09, Kristoffer Sjögren napsal(a):
>>> We're running Weld 2.0.3.Final in a Java SE environment and have
>>> encountered a precarious situation where it seems like Weld is not
>>> consistent in handling the lifecycle of singleton beans.
>>> We have singleton beans with @PostConstruct and @PreDestroy methods.
>>> During Weld.initialize() all @PostConstruct methods are called. But
>>> during @PreDestroy methods are never called during Weld.shutdown().
>>> @PreDestroy is only called on beans which are @ApplicationScoped.
>>> Is this according to specification or a bug?
>>> weld-dev mailing list
>> weld-dev mailing list
> weld-dev mailing list