I would like to replace the content of some methods at runtime.
I know I can use javassist for this but it does not work because the classes I would like to enhance are already loaded by the system classLoader.
How can I do, to replace the content of a method at runtime ? Should I try to unload the class ? How can I do that ? I saw it was possible but I could not figure out how to do it.
If possible, I would like to avoid using an external lib for this, I would like to code it my-self.
More information: - The class I would like to enhance is contained in a framework (in a jar file) - My code is actually a plugin of this framework - The framework in which my plugin runs has its own classLoader, but this classLoader does not load its own classes (it delegates them to the system class loader) - The framework I'm using is Play.
Thank you for your help !