users@jsr311.java.net

Re: Singletons

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

Apologies for typos...

----- Original Message -----
From: "Sergey Beryozkin" <sergey.beryozkin_at_iona.com>
To: <users_at_jsr311.dev.java.net>
Sent: Tuesday, July 01, 2008 5:38 PM
Subject: Singeltons


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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
For additional commands, e-mail: users-help_at_jsr311.dev.java.net

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