-
1. Re: Singleton pseudo scope
gavin.king Mar 1, 2010 10:07 PM (in response to chasetec)The @Singleton pseudo-scope is defined by javax.inject, not by CDI. The @Singleton annotation in EJB is something different (not a scope).
-
2. Re: Singleton pseudo scope
chasetec Mar 1, 2010 11:28 PM (in response to chasetec)Regardless of who defines it, should a CDI implementation support it? The Weld docs imply it is supported but the spec doesn't mention that everything from JSR330 would be available.
Where does it say (directly or indirectly) that I can use a @Singleton scope when I use CDI? Looking at the spec it seems like support for @java.inject.Singleton would fall under the category of a custom scope to be implemented by a portable extension. Wouldn't that mean that it should be a Seam3 feature and not a Weld feature?
Or is this just something that needs to be clarified in the spec? (any chance of getting a JIRA project for the spec?)
Thanks.
-
3. Re: Singleton pseudo scope
gavin.king Mar 2, 2010 2:44 AM (in response to chasetec)
Regardless of who defines it, should a CDI implementation support it?Well, there is not exactly a hard requirement in the CDI spec that all APIs defined by JSR-330 are supported by an implementation of JSR-299. However, all EE 6 containers are required by the EE spec to support both 299 and 330, and I imagine that most CDI implementations will support @Singleton out of the box. It would surprise me if an implementation did not support it.