Hi there -
I have 100+ Google Protocol Buffer classes, which are all machine generated, and all identified by a unique constant inside the class definition. (Designed by others, criticized by me of course). I need to build a run-time id-to-class map. I can do this easily walking the classloader and using reflection to look for the constants.
It all works fine in Eclipse, which I suspect is using an eager classloader for the IDE code completion and debugging. When I run my code from the command-line, I get an empty map. So I think I'm facing a lazy loading classloader in the general case.
How difficult is it to make my own eager loading classloader? Any example code?
I know there are many build-time alternatives to manage this. But the class loader seems much more slick and ultimately easier to maintain.
Thanks!