Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

idea / revelation #2

Open
ORESoftware opened this issue Feb 11, 2019 · 0 comments
Open

idea / revelation #2

ORESoftware opened this issue Feb 11, 2019 · 0 comments

Comments

@ORESoftware
Copy link

ORESoftware commented Feb 11, 2019

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:

  1. You edit a file, and the file changes on disk in target/classes
  2. Send tcp message to your server, tell the server the file changed.
  3. 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant