users@jersey.java.net

Re: [Jersey] Resource life cycle and injections

From: Erdinc Yilmazel <erdinc_at_yilmazel.com>
Date: Tue, 10 Mar 2009 10:26:04 +0000

> I see in the source code you are always returning an instance of
> IoCManagedComponentProvider, if the injector contains the class. This
> signals to Jersey that the life-cycle of the components is managed by the
> IoC container, Guice, but Jersey can inject it's own stuff onto the
> component (hence the getScope method, so that Jersey knows what it can
> inject).

OK, so what I need to return is GuiceInstantiatedComponentProvider instead.


> Thanks. I am glad that the integration is flexible and does not require much
> code such that developers can support what they require without too much
> trouble (although i realize this area could do with more documentation).
>
> Perhaps we need to be a bit more flexible with the Guice configuration set
> up?
>
> Paul.

Well I am new to both jersey and guice, however imho supplying example
source code rather then writing
a dedicated module for guice integration may suffice, since as you
said it may require a much more flexible setup.

Erdinc