/** Start a new server instance. */
  public void start() {

    if (getServer() == null) {
      load();
    }

    if (getServer() == null) {
      log.fatal("Cannot start server. Server instance is not configured.");
      return;
    }

    long t1 = System.nanoTime();

    // Start the new server
    if (getServer() instanceof Lifecycle) {
      try {
        ((Lifecycle) getServer()).start();
      } catch (LifecycleException e) {
        log.error("Catalina.start: ", e);
      }
    }

    long t2 = System.nanoTime();
    if (log.isInfoEnabled()) log.info("Server startup in " + ((t2 - t1) / 1000000) + " ms");

    try {
      // Register shutdown hook
      if (useShutdownHook) {
        if (shutdownHook == null) {
          shutdownHook = new CatalinaShutdownHook();
        }
        Runtime.getRuntime().addShutdownHook(shutdownHook);

        // If JULI is being used, disable JULI's shutdown hook since
        // shutdown hooks run in parallel and log messages may be lost
        // if JULI's hook completes before the CatalinaShutdownHook()
        LogManager logManager = LogManager.getLogManager();
        if (logManager instanceof ClassLoaderLogManager) {
          ((ClassLoaderLogManager) logManager).setUseShutdownHook(false);
        }
      }
    } catch (Throwable t) {
      // This will fail on JDK 1.2. Ignoring, as Tomcat can run
      // fine without the shutdown hook.
    }

    if (await) {
      await();
      stop();
    }
  }