Springboot (ii)--Thermal Deployment (Springloader)
First, the issue of the proposed:
In writing the code, sometimes simply to change the printing information, you need to redeploy the Springboot project, if this is the encoding, then we estimate that a day is really a few hello world to get off work. So how to solve the problem of hot deployment? That's springloaded.
Second, the principle
Spring-boot-devtools is a module for developers, and the most important feature is the automatic application of code changes to the latest apps. The principle is to restart the application after discovering that the code has changed, but faster than manually stopping and then starting, and faster, not referring to the time saved for manual operation.
Third, the deep principle
Using two ClassLoader, one ClassLoader loads the classes that will not change (third-party jar packages), and the other ClassLoader loads the changed classes, called Restart ClassLoader, so that when there is code change, The original restart ClassLoader was discarded, re-created a restart ClassLoader, because there are fewer classes to load, so a faster restart time (less than 5 seconds) is achieved.
Iv. Development Steps
Springboot (ii)--Thermal Deployment (Springloader)