Spring container Start-up process (iii)

Source: Internet
Author: User

The Start method of Catalina

   /*** Start A new server instance. */     Public voidstart () {if(Server = =NULL) {load (); }        LongT1 =System.nanotime (); //Start the new server        if(ServerinstanceofLifecycle) {            Try{(Lifecycle) server). Start ();//Start the server}Catch(lifecycleexception e) {log.error ("Catalina.start:", E); }        }        Longt2 =System.nanotime (); if(log.isinfoenabled ()) Log.info ("Server Startup in" + ((T2-T1)/1000000) + "MS"); Try {            //Register shutdown Hook            if(useshutdownhook) {if(Shutdownhook = =NULL) {Shutdownhook=NewCatalinashutdownhook ();            } runtime.getruntime (). Addshutdownhook (Shutdownhook); }        } Catch(Throwable t) {//This is fail on JDK 1.2. Ignoring, as Tomcat can run//fine without the shutdown hook.        }    //start complete waiting for client connection        if(await) {await ();        Stop (); }    }

Start the service when you start the server.

     Public voidStart ()throwslifecycleexception {//Validate and update our current component state        if(started) {Log.debug (sm.getstring ("StandardServer.start.started")); return; }        //Notify our interested lifecyclelistenersLifecycle.firelifecycleevent (Before_start_event,NULL); Lifecycle.firelifecycleevent (Start_event,NULL); Started=true; //Start our defined Services        synchronized(services) { for(inti = 0; i < services.length; i++) {                if(Services[i]instanceofLifecycle) ((Lifecycle) services[i]). Start ();//Start Service            }        }        //Notify our interested lifecyclelistenersLifecycle.firelifecycleevent (After_start_event,NULL); }

Spring container Start-up process (iii)

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.