Tuesday, June 26, 2007 11:31 AM
What this would mean is loading shared/dynamic libraries more than once. It is not possible, to load libraries more than once. The Java class loader that loaded the Java class will only and only once load a system library. Also its not possible to unload a system library once loaded, unless the the class loader that loaded the class goes out of scope or gets garbage collected.
However, you can hack in your own class loader that loads your classes which loads the system library. This way your class laoder can create as many instance of (multipletons) as you want and you can load libs that way. But its a bad idea. There was a reason why Sun choose not to allow this feature.
Why do you need this one to one mapping ? There are other ways to solve class and lib loading problems.