Resin启动

com.caucho.server.resin,Resin

 /**

   * The main start of the web server.

   *

   * <pre>

   * -conf resin.conf   : alternate configuration file

   * -port port         : set the server's portt

   * <pre>

   */

  public static void main(String []argv)

  {

    try {

      EnvironmentClassLoader.initializeEnvironment();

      validateEnvironment();

      final Resin resin = new Resin();

      resin.parseCommandLine(argv);

      resin.initMain();

      Server server = resin.getServer();

      DestroyThread destroyThread = new DestroyThread(resin);

      destroyThread.start();

      resin.waitForExit();

      destroyThread.shutdown();

      long stopTime = System.currentTimeMillis();

      long endTime = stopTime +15000L;

      if (server != null)

endTime = stopTime + server.getShutdownWaitMax() ;

      while (System.currentTimeMillis() < endTime && ! resin.isClosed()) {

try {

 Thread.interrupted();

 Thread.sleep(100);

} catch (Throwable e) {

}

      }

      if (! resin.isClosed())

Runtime.getRuntime().halt(1);

      System.exit(0);

    } catch (Throwable e) {

      boolean isCompile = false;

      Throwable cause;

      for (cause = e;

  cause != null && cause.getCause() != null;

  cause = cause.getCause()) {

if (cause instanceof CompileException) {

 isCompile = true;

 break;

}

      }

      if (cause instanceof BindException) {

System.err.println(e.getMessage());

  

log().severe(e.toString());

log().log(Level.FINE, e.toString(), e);

System.exit(67);

      }

      else if (e instanceof CompileException) {

System.err.println(e.getMessage());

  

log().log(Level.CONFIG, e.toString(), e);

      }

      else {

e.printStackTrace(System.err);

      }

    } finally {

      System.exit(1);

    }

  }

猜你喜欢

转载自cxmqq333.iteye.com/blog/1983574