users@jersey.java.net

Singletons in the javax.ws.rs API Classes

From: Michael Szalay <michael.szalay_at_trialox.ch>
Date: Thu, 31 Jul 2008 11:03:48 +0200

Hi all

I would like to mention a problem while using the RuntimeDelegate
singleton pattern in the javax.ws.rs API classes. The use of this
singleton from api classes (i.e. MediaType) causes
severe problems on "singleton-unfriendly containers" like OSGi. Its not
possible anymore to have more than one implementation or version of
implementation of jsr311 on an osgi environment because of that.

Whould it be possible to find another solution instead of using that
singleton?

Regards Michael

p.s.:

making a hard-coded fallback on the api classes to the jersey
implementation is not a nice seperation of api and reference
implementation ;-)