Status: New
Owner: ----

New issue 337 by Rinsvind: AssistedInject needs class load bridging under  
OSGi
http://code.google.com/p/google-guice/issues/detail?id=337

AssistedInject implements the factory interfaces by building dynamic
proxies. Under OSGi this creates the same class loading problem as with the
proxies and interceptors that Guice itself generates. So we need the
classloader bridges implemented in com.google.inject.internal.BytecodeGen.
Luckily BytecodeGen is built more as a standalone utility and this makes it
dead simple to solve the problem. I am attaching a 2-liner patch that calls
BytecodeGen during proxy generation to obtain a bridge ClassLoader for the
new proxy.

This patch must be used with Stuart's fragments patch from issue #311 to
get a working assistedinject bundle.

Btw I tried to replace the java.lang.reflect.Proxy with the fancier
BytecodeGen.newEnhancer(). Here I hit a wall because AssistedInject is
build against both the guice-snapshot.jar that contains a JarJar-mangled
cglib and the cglib-snapshot.jar from lib\build. After some toying with the
ant scripts I gave up and settled for just BytecodeGen.getClassLoader().

Finally I propose that BytecodeGen eventually be moved to the spi package
so that all extensions that need to generate proxies can use it.

Attachments:
        assistedinject-classload.patch  1.9 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to