users@jersey.java.net

InjectableProvider question

From: Roytman, Alex <Roytmana_at_peacetech.com>
Date: Thu, 19 Feb 2009 16:47:42 -0500

Paul,

- Could you please clarify meaning of InjectableProvider.getScope()? Is it matched to scope of component which will receive injection? If several scopes are available, will the closest win (ie if injection receiver is PerRequest, it will first for PerRequest InjectableProvider and then Singleton? Is it prohibited to inject PerRequest injectable into Singleton? It does not seem to be that simple because we can inject say HttpContext into Providers which are singletons...

- Order of Providers. If I have InjectableProvider A and B (both of the same scope PerRequest) and B has A injected into it as field will Jersey reliably perform injection regardless of order A and B are loaded? Is there any dependency resolution protocol?
For me B is not injected. Is it where your proxying can help? Not sure it applies here because my B provider in itself can be created at any time even on web application startup so there is no need for any deferral.

I wonder if it is not better for me to register A and B in proper order via Jersey API. If so are there any samples on it?

Sorry for bugging you with my questions

Alex