I think it is worth considering this on a higher level as well. 
Proxies are supposed to mimic the underlying class as much as possible. 
Did anyone investigate the implication of annotating the proxy with the 
same annotations as the underlying class?

    On the one hand I agree JAX-RS should probably check out the 
superclass annotations. On the other hand, a proxy that doesn't mimic 
the underlying class is a poor proxy ;) JAX-RS just went 1.0 so I don't 
foresee them checking the superclass annotations anytime soon. It could 
be easier to just fix this in Guice (if possible).

Gili

Stuart McCulloch wrote:
> 2008/10/27 Gili <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>
>
>     Hi James,
>
>     I ran this question by the author of Jersey and he said that doing so
>     would violate the JAX-RS specification:
>     
> http://n2.nabble.com/com.sun.jersey.impl.uri.UriBuilderImpl.path()-throws-an-unexpected-exception-td1373393.html#a1381422
>     
> <http://n2.nabble.com/com.sun.jersey.impl.uri.UriBuilderImpl.path%28%29-throws-an-unexpected-exception-td1373393.html#a1381422>
>
>     I need to somehow tell Guice to not use CGLIB or to annotate the
>     subclass with the same annotations as the superclass.
>
>
> looking at the codebase it appears Guice uses CGLIB's FastClass
> to create instances of public types when doing constructor injection,
> even if there's no circular dependency or interception going on, see:
>
>   src/com/google/inject/DefaultConstructionProxyFactory.java
>
> afaik using FastClass here is just for performance, so it's technically
> possible to add some sort of switch to turn this off - but I'll leave 
> it to
> the Google devs to decide if this is worthwhile or not...
>
>     Gili
>
>     On Oct 24, 8:36 pm, "James Carman" <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>     > Can Jersey search the class hierarchy for the @Path annotation?
>     >
>     > On Fri, Oct 24, 2008 at 7:45 PM, [EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]> <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>     >
>     > > On Oct 24, 2:42 pm, Gili <[EMAIL PROTECTED]
>     <mailto:[EMAIL PROTECTED]>> wrote:
>     > >> Is it possible to tell Guice to avoid the use of CGLIB unless
>     it's
>     > >> absolutely necessary? I know Guice uses it to solve circular
>     > >> dependencies but I use the Provider<Foo> approach instead. CGLIB
>     > >> proxies sometimes break compatibility. For example, today I
>     ran into
>     >
>     > > Are you using method interceptors? We can't do them without CGLIB.
>
>
>
>
> -- 
> Cheers, Stuart
>
> >

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to