users@jersey.java.net

Re: Adding _at_Provider via META-INF/services, injecting _at_Context Providers?

From: Tatu Saloranta <tsaloranta_at_gmail.com>
Date: Fri, 24 Apr 2009 16:45:51 -0700

On Fri, Apr 24, 2009 at 4:03 PM, Tatu Saloranta <tsaloranta_at_gmail.com> wrote:
> Quick question: I am adding MessageBodyReader and -Writer providers
> using META-INF/services instructions.
> That works well, gets plugged in and all. So far so good.
>
> But now I am trying to get Providers injected, so that I can look up
> piece of configuration provider needs (with defaulting for cases where
> no one explicitly gives it).
> I was thinking that:
>
> @Context
> protected Providers _providers;
>
> with Provider would be found & injected, but it looks as if it wasn't.

Correction: this part actually works, and Providers gets injected.

My problem seems to be the next step; ensuring that my
ContextProvider<T> matches with call. Looks like MediaType doesn't
match by default for some reason (if I pass type I get in).

-+ Tatu +-