users@jersey.java.net

Re: Guice integration in 0.6

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 04 Mar 2008 12:27:46 +0100

Richard Wallace wrote:
> Alright, well I'm a bit stuck now. Apparently the annotation used in
> bind(UriInfo.class).annotatedWith(Context.class).toProvider(...) has to
> be annotated with the BindingAnnotation.

Bummer :-(


> I'll have to post to the guice
> list and see why this limitation exists and if I can work around it.
> Otherwise I'll just have to come up with my own annotations or rely on
> the parameters passed to the method (what I'm doing now). Neither is
> as appealing as Guice being able to inject the things I want, but if
> that's what I gotta do that's what I gotta do.
>

It might be worth highlighting on the Guice list the Jersey use-case of
intermixing responsibility of providing instances of constructor
parameters for @Injected constructors.

Perhaps one solution is for Guice to tell Jersey (via the
ComponentProvider) what is the constructor to use for a class. Then when
an instance is required Jersey can tell Guice the parameter instances it
knows about and Guice can do the rest.

I don't mind you CC'ing me in any discussion you have on the Guice
mailing list as i would be happy to get involved to best solve such
integration issues.

Paul.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109