[cdi-dev] how to proecess the CDI @Singleton and EJB @Singleton?

Mark Struberg struberg at yahoo.de
Tue Apr 24 04:50:31 EDT 2012


Hi!

@javax.inject.Singleton is completely underspecified in JSR-330 and thus deliberately left out in the CDI spec at all.


If I get back to Wards original Singleton definition "Singleton means to create exactly one single instance (of a certain kind) in a well specified context" then the @Singleton is exactly worth nothing. Because it doesn't say anything about in _which_ context it should behave like a singleton!

Is it 1 instance per Java VM? 1 instance per EAR? 1 instance per WAR? 
The EJB singleton is at least clear that it's 1 per EAR.

LieGrue,
strub



----- Original Message -----
> From: Hantsy Bai <hantsy at gmail.com>
> To: cdi-dev at lists.jboss.org
> Cc: 
> Sent: Tuesday, April 24, 2012 9:56 AM
> Subject: [cdi-dev] how to proecess the CDI @Singleton and EJB @Singleton?
> 
> Hi,
> 
> I know there is a @javax.inject.Singleton in the CDI, and another from 
> EJB spec, is there any discuss bwteen the two export group and has a 
> plan to deprecate one ?
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
> 


More information about the cdi-dev mailing list