On Jan 14, 2011, at 4:56 PM, Markus Karg wrote:
> The description of "Application" doesn't contain information on the
> actual livetime of the result of "getSingletons()". I wonder whether
> it is valid to return new objects each time, or new objects for each
> instance of "Application", or whether "getSingletons()" actually
> must return the same object instances always and for all instances
> (i. e. final static)?
I think the JavaDoc should be clarified. Each call to getSingletons()
within the same web app should return a set with the same references.
It does not matter if instances are shared between web apps as that is
an implementation detail of your application. The "singleton" in this
regard means that the JAX-RS implementation can rely on the reference
being valid for the life-cycle of the web app.
FWIW Jersey will call getSingletons() once.
Paul.