users@jersey.java.net

[Jersey] Re: What happened to SingletonTypeInjectableProvider?

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Thu, 31 Jan 2013 09:48:44 +0100

Hi Jan,

Jersey now uses HK2 for injections, so please see
ResourceConfig.registerInstances :
http://jersey.java.net/nonav/apidocs/snapshot/jersey/org/glassfish/jersey/server/ResourceConfig.html#registerInstances%28java.lang.Object...%29

You can put HK2 Binder there and register/bind whatever you want.

Regards,
Pavel

On 1/31/13 9:32 AM, algermissen1971 wrote:
> Hi,
>
> I am looking for a way to inject my own Singletons using @Context. In Jersey 1.x there was SingletonTypeInjectableProvider. But it seems 2.x dropped that.
>
> Or is that in a package that is not covered by the Jersey 2 API Docs and I need to look elsewhere?
>
> Jan
>
>