MCPcopy Create free account
hub / github.com/apache/tomcat / start

Method start

java/org/apache/catalina/startup/Catalina.java:868–924  ·  view source on GitHub ↗

Start a new server instance.

()

Source from the content-addressed store, hash-verified

866 * Start a new server instance.
867 */
868 public void start() {
869
870 if (getServer() == null) {
871 load();
872 }
873
874 if (getServer() == null) {
875 log.fatal(sm.getString("catalina.noServer"));
876 return;
877 }
878
879 long t1 = System.nanoTime();
880
881 // Start the new server
882 try {
883 getServer().start();
884 } catch (LifecycleException e) {
885 log.fatal(sm.getString("catalina.serverStartFail"), e);
886 try {
887 getServer().destroy();
888 } catch (LifecycleException e1) {
889 log.debug(sm.getString("catalina.destroyFail"), e1);
890 }
891 return;
892 }
893
894 if (log.isInfoEnabled()) {
895 log.info(sm.getString("catalina.startup",
896 Long.toString(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t1))));
897 }
898
899 if (generateCode) {
900 // Generate loader which will load all generated classes
901 generateLoader();
902 }
903
904 // Register shutdown hook
905 if (useShutdownHook) {
906 if (shutdownHook == null) {
907 shutdownHook = new CatalinaShutdownHook();
908 }
909 Runtime.getRuntime().addShutdownHook(shutdownHook);
910
911 // If JULI is being used, disable JULI's shutdown hook since
912 // shutdown hooks run in parallel and log messages may be lost
913 // if JULI's hook completes before the CatalinaShutdownHook()
914 LogManager logManager = LogManager.getLogManager();
915 if (logManager instanceof ClassLoaderLogManager) {
916 ((ClassLoaderLogManager) logManager).setUseShutdownHook(false);
917 }
918 }
919
920 if (await) {
921 await();
922 stop();
923 }
924 }
925

Callers

nothing calls this directly

Calls 14

getServerMethod · 0.95
loadMethod · 0.95
generateLoaderMethod · 0.95
awaitMethod · 0.95
stopMethod · 0.95
fatalMethod · 0.65
getStringMethod · 0.65
startMethod · 0.65
destroyMethod · 0.65
debugMethod · 0.65
isInfoEnabledMethod · 0.65
infoMethod · 0.65

Tested by

no test coverage detected