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);

    }

  }

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值