I was looking into dynamic classloading / hot-reloading with java
I had a mini-revelation. All the libraries loaded into memory - they can stay. Java core libraries, and 3rd party libraries remain in memory - because they haven't changed. But you can simply remove all your classes, and reload all your classes. Then you don't have to worry about old references. Just reload everything. Most server projects don't have more than 300 or so classes unique to the project. It won't take that long to reload them all.
https://stackoverflow.com/questions/54640066/hot-reload-classes-in-separate-thread-of-server
So idea is:
- You edit a file, and the file changes on disk in target/classes
- Send tcp message to your server, tell the server the file changed.
- Upon receipt of tcp message in server, reload all your project's classes in memory.
Is it possible? How to re-use library classes with new classloader but only use new classes from your project?
I was looking into dynamic classloading / hot-reloading with java
I had a mini-revelation. All the libraries loaded into memory - they can stay. Java core libraries, and 3rd party libraries remain in memory - because they haven't changed. But you can simply remove all your classes, and reload all your classes. Then you don't have to worry about old references. Just reload everything. Most server projects don't have more than 300 or so classes unique to the project. It won't take that long to reload them all.
https://stackoverflow.com/questions/54640066/hot-reload-classes-in-separate-thread-of-server
So idea is:
Is it possible? How to re-use library classes with new classloader but only use new classes from your project?