1. in setLoader of ContainerBase, loader. setContainer (this); 2. call setContainer () if (this. container! Null) & amp; (this. containerinstanceofContext) {// if it is 1. in setLoader of ContainerBase, loader. setContainer (this );
2. the setContainer () of WepappLoader is called ()
If (this. container! = Null) & (this. container instanceof Context) {// if it is a Context container
SetReloadable (Context) this. container). getReloadable ());
(Context) this. container). addPropertyChangeListener (this );
}
3. start the thread in setReloadable (boolean reloadable) to continuously check the timestamp threadStart () of the class files and JAR files under the WEB-INF directory ();
4. threadStart start similar start () method: generate a new thread, call run () reload class, and generate threadStart ()
5. policycontext (); WebappContextNotifier notifier = new WebappContextNotifier ();
(New Thread (notifier). start ();
6. WebappContextNotifier is an internal class, and only run () is a method. execute (Context) container). reload (); call the reload () method of StandardContext
7. business logic of the reload () method of StandardContext:
7.1 Shut down our session manager
7.2 Shut down the current version of all active servlets
7.3 Shut down application event listeners
7.4 Clear all application-originated servlet context attributes
7.5 Shut down filters
7.6 Shut down our application class loader
7.7 Restart our application class loader
7.8 Restart our application event listeners and filters
7.9 Restore the "Welcome Files" and "Resources" context attributes
7.10 Restart our currently defined servlets :( (Lifecycle) wrapper). start ();
7.11 Reinitialize all load on startup servlets: loadOnStartup (children );
7.12 Restart our session manager
8. loadOnStartup (Container children []) --> wrapper. load () --> StandardWarpper loadServlet ();
From the code point of view, servlet is dynamic, all are first uninstalled, and then all are loaded.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service