vipx / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Pull out CGLib and reexport in in OSGi #400

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

would it be possible to pull out the CGlib from where it is now (internal.*), 
put it in it's own 
bundle and reexport the dependency from Guice?
At least making it a dependency and not swallowing it up?

As matters stand now for OSGi I need to break open many implementation details 
for my 
interfaces due to that FastClass issue. (Cannot access Package-Private types)
This is quite ugly because it clutters my public interfaces. Importing a 
CGLib-Bundle to my code 
doesn't help the issue either since the package names differ.

Could we have CGLib moved out of Guice and potentially reexported?

Thanks

Original issue reported on code.google.com by kristoff...@gmail.com on 6 Jul 2009 at 4:31

GoogleCodeExporter commented 9 years ago
My latest round of changes to the classloading/proxying code means that you'll 
only
need to make classes public or protected if you are using method-interception. 
This
should drastically cut down on the number of classes that you need to expose. 
I'm
also improving the error message to identify exactly which class is involved.

Often it's just the implementation class and its constructor that you need to 
make
protected or public, and only when running in strict containers like OSGi. Also 
if
you're using OSGi, you could keep these hidden in a non-exported package to 
avoid
leaking details.

BTW the reason CGLIB is internalized is because it's an implementation detail 
that we
don't want clients to rely on. Similarly it's repackaged to avoid clashes with 
other
versions of CGLIB on the classpath when running in standard Java containers.

So in summary: I very much doubt we'll be extracting CGLIB as a public 
dependency,
but the 2.1 release should allow you to keep classes package-private unless 
using
method-interception.

Original comment by mccu...@gmail.com on 31 Oct 2009 at 4:23

GoogleCodeExporter commented 9 years ago
Stuart summarized the resolution very well in comment #1.

Original comment by sberlin on 2 May 2010 at 12:36