2009/2/21 Andreas Petersson <[email protected]>

>
> so, instead of blindly calling .getSuperclass(), can i find out if the
> object is wrapped by guice or not?
> does the proxy implement a kind of marker interface?


Guice generated CGLIB proxies will have "ByGuice" in their class name,
but to echo what Dhanji said you really shouldn't rely on this behaviour.

Guice may also create JDK proxies, but in these cases there is no super
class, except Object.class, because the JDK proxy only backs interfaces.
(this is typically when there's a circular reference - the real object is
then
 hidden inside the invocation handler so you won't have access to it)

BTW, serialization of proxies has been discussed before in this group:


http://groups.google.com/group/google-guice/browse_thread/thread/941dd391ccbc748f

HTH

> Guice will not always return a proxy. You should not rely on this
> behavior.
> >
> > Dhanji.
>
> >

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