I just put up a copy at http://bbs.darktech.org/guice-jersey.zip
GuiceComponentProvider will change slightly for Guice 2.0 and
GuiceResourceProvider contains a lot of commented-out code because I
still haven't figured out how to implement it properly.
That being said, this code works perfectly out-of-the-box for me. The
design is far from perfect but it's the best I could do so far. It works
as follows: ask Guice to inject a class. If it fails (and the
constructor is not marked using @Inject) then let Jersey inject it.
As I mentioned, in the future we want to somehow merge the Jersey and
Guice configuration and have Guice inject all objects.
Gili
Richard Wallace wrote:
> Gili,
>
> Do you have your implementation posted somewhere? I was working on
> one quite a while ago (Jersey 0.6-0.7 days) and am going to be taking
> this up again soon. Would be nice to have an already working
> implementation.
>
> Thanks,
> Rich
>
> On Thu, Nov 20, 2008 at 7:55 AM, Gili Tzabari <[EMAIL PROTECTED]> wrote:
>> Sundar,
>>
>> The implementation needs to be a lot more involved than this. My own
>> implementation has the following extra pieces:
>>
>> 1) a ComponentProvider
>> 2) a InjectableProvider
>> 3) a GuiceServlet. You provide an annotation which might be a better
>> idea, but you need to allow users to link to an existing Injector
>> instead of assuming your own code will always create one. For example,
>> if I want to use warp-persist with Jersey integration I need to be able
>> to pass it an existing instance created by warp-persist.
>>
>> PS: I'm not happy with my own implementation either. It's simply not
>> clear when Guice versus Jersey should be injecting objects. I don't
>> think this will be solved until Guice can import Jersey bindings.
>>
>> Gili
>>
>> Sundar wrote:
>>> For people looking for Jersey and Guice integration,
>>>
>>> Jersey and Guice adapter availabe as part of google code.
>>>
>>> http://code.google.com/p/jerseyguice/
>>>
>>> -Sundar
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---