Hi Paul,
I've not looked in any great detail at the newcomponent provider but I can't see how the AOP trick can be appliedusing it. The getInstance() method in the SPI by Marc gave access to aResourceProviderContext. This allowed me to inject dependencies on theproxy's target object and then return the proxied object itself fromgetInstance(). The target object cannot be the object returned fromgetInstance().
Using the component provider, how can we do theDI on the target object? Or there there some other solution to thisthat I'm not aware of?
Many thanks,
Duncan Eley
----- Original Message ----
From: Paul Sandoz <Paul.Sandoz@Sun.COM>
To: users@jersey.dev.java.net; dunk_e@yahoo.co.uk
Sent: Friday, 7 March, 2008 4:55:04 PM
Subject: Re: Injectable fields not set on target object for proxied resource (using cglib)
Duncan Eley wrote:
> The above example uses the SPI described here:
>
http://weblogs.java.net/blog/mhadley/archive/2007/09/integrating_jer.html.
> This demonstrates how to get at the cglib proxied object using
> Spring. However, I'm aware that the Jersey SPI has changed quite a
> bit since I did this.
Yes, you should be able to do the same AOP trick with the component
provider [1].
> It would be really nice, if at some point, Jersey had an optional
> library for users wanting to integrate with Spring.
>
Very much agree. I would like to consider something like that for 0.7
(see my blog on the 0.6 release), my concern is Marc, Jakub and I are a
little maxed out so i was wondering if anyone would like to volunteer to
contribute Spring & Guice stuff to the Jersey distribution ?
Paul.
[1]
http://blogs.sun.com/sandoz/entry/integrating_jersey_and_spring_take
--
| ? + ? = To question
----------------\
Paul Sandoz
x38109
+33-4-76188109
___________________________________________________________
Rise to the challenge for Sport Relief with Yahoo! For Good
http://uk.promotions.yahoo.com/forgood/