Hi All,
I want to enforce the reload of class file, and not to use the already loaded class from the classloader cache, how can I do it without rewrite the loadclass() of the classloader ?
It depends on why you want to reload a class. Are you dealing with an applet? If it is the case, you could have some problems writing a new classloader in netscape, but if you have the plugin installed you can manage its properties to clear the classloader:
If you are dealing with an application you must write your own classloader. It is not as difficult as it sounds, check this url for more information on writing a classloader:
Try to use the default classloader if you doesn't want to rewrite the loadclass method.
Once you have it, you can load again your class with your custom classloader. Each new version of a class needs a new class loader. And of course anything that is using the old class has to discard those instances and get a new instance of the new version.
Feel free to postback if you have any other question.
Hope it helps.
Pedro Andrés Solorzano
Pontificia Universidad Javeriana
Bogotá, Colombia, SurAmérica.
I'm just curious as to when would someone want to rewrite a classloader? I've heard some discussion about it and I wonder why this is an issue. Could someone please explain this.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.