users@jsr311.java.net

Singeltons

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Tue, 1 Jul 2008 17:38:43 +0100

Hi

JAX-RS specification referes to singletons a number of time, that is, a singleton life cycle is given some prominent
attention in the specification. Yet, there's no related annotation availbale in the API - different JAX-RS implementations use
private techniques to mark a given root resource class as a singleton.

My concern is that given that root resources are likely be singletons more often than not, it won't be possible to write even a
basic resource implementation which will work reliably (as a singleton) across multiple implementations. As such I'd like to suggest
that a common @Singleton annotation is introduced in the API. This way, the (singleton) resource class, injected as a singleton bean
by a IOC framework, or instantiated by the runtime (in which case @Singleton will be noticed), will be a true singleton across
multiple implementations...

Cheers, Sergey

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland