[PATCH 0/2] Class- and class loader-local storage (Bug ID #6493635) (original) (raw)
Bob Lee openjdk at crazybob.org
Fri Feb 27 18:10:33 UTC 2009
- Previous message: [PATCH 2/2] Class loader local storage
- Next message: [PATCH 0/2] Class- and class loader-local storage (Bug ID #6493635)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have a simpler and more secure solution. I just need one method on ClassLoader:
public class ClassLoader { public void keepReferenceTo(Object o) { ... } ... }
The ClassLoader would keep a strong reference to the passed reference indefinitely (using some sort of minimal memory footprint, wait-free data structure internally). We could add a convenience method to Class, too, but it would just delegate to the same method on the Class's loader.
Now, my library code can just keep a weak reference to the object, and I know it won't be cleared until the class loader is reclaimed.
Bob
- Previous message: [PATCH 2/2] Class loader local storage
- Next message: [PATCH 0/2] Class- and class loader-local storage (Bug ID #6493635)
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]