org.mortbay.jetty.webapp.WebAppContext.start()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(87)

本文整理了Java中org.mortbay.jetty.webapp.WebAppContext.start()方法的一些代码示例,展示了WebAppContext.start()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.start()方法的具体详情如下:
包路径:org.mortbay.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:start

WebAppContext.start介绍

暂无

代码示例

代码示例来源:origin: feroult/yawp

private void restart(WebAppContext webapp) throws Exception {
  webapp.stop();
  configureClassloader();
  webapp.start();
}

代码示例来源:origin: org.springframework.osgi/spring-osgi-web

/**
 * Starts the Jetty web context class.
 * 
 * @param wac,
 * @throws Exception
 */
private void startWebAppContext(WebAppContext wac) throws Exception {
  HandlerCollection contexts = getJettyContexts();
  // set the TCCL since it's used internally by Jetty
  Thread current = Thread.currentThread();
  ClassLoader old = current.getContextClassLoader();
  try {
    current.setContextClassLoader(wac.getClassLoader());
    if (contexts != null) {
      contexts.addHandler(wac);
    }
    wac.start();
    if (contexts != null) {
      contexts.start();
    }
  }
  finally {
    current.setContextClassLoader(old);
  }
}

代码示例来源:origin: org.springframework.osgi/org.springframework.osgi.web

/**
 * Starts the Jetty web context class.
 * 
 * @param wac,
 * @throws Exception
 */
private void startWebAppContext(WebAppContext wac) throws Exception {
  HandlerCollection contexts = getJettyContexts();
  // set the TCCL since it's used internally by Jetty
  Thread current = Thread.currentThread();
  ClassLoader old = current.getContextClassLoader();
  try {
    current.setContextClassLoader(wac.getClassLoader());
    if (contexts != null) {
      contexts.addHandler(wac);
    }
    wac.start();
    if (contexts != null) {
      contexts.start();
    }
  }
  finally {
    current.setContextClassLoader(old);
  }
}

代码示例来源:origin: org.jboss.errai/errai-cdi-jetty

@Override
public void refresh() throws UnableToCompleteException {
 String msg = "Reloading web app to reflect changes in "
   + appRootDir.getAbsolutePath();
 TreeLogger branch = logger.branch(TreeLogger.INFO, msg);
 // Temporarily log Jetty on the branch.
 Log.setLog(new JettyTreeLogger(branch));
 try {
  wac.stop();
  server.stop();
  wac.start();
  server.start();
  branch.log(TreeLogger.INFO, "Reload completed successfully");
 }
 catch (Exception e) {
  branch.log(TreeLogger.ERROR, "Unable to restart embedded Jetty server",
    e);
  throw new UnableToCompleteException();
 }
 finally {
  // Reset the top-level logger.
  Log.setLog(new JettyTreeLogger(logger));
 }
}

相关文章

微信公众号

最新文章

更多

WebAppContext类方法