本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.stop()
方法的一些代码示例,展示了WebAppContext.stop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.stop()
方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:stop
暂无
代码示例来源:origin: Dreampie/Resty
public void stop() throws Exception {
if (Constant.devEnable) {
if (!watchThread.isInterrupted()) {
watchThread.interrupt();
}
}
webAppContext.stop();
server.stop();
}
代码示例来源:origin: apache/geode
public void stop() {
if (this.httpServer == null) {
return;
}
logger.debug("Stopping the HTTP service...");
try {
for (WebAppContext webapp : webApps) {
webapp.stop();
}
this.httpServer.stop();
} catch (Exception e) {
logger.warn("Failed to stop the HTTP service because: {}", e.getMessage(), e);
} finally {
try {
this.httpServer.destroy();
} catch (Exception ignore) {
logger.info("Failed to properly release resources held by the HTTP service: {}",
ignore.getMessage(), ignore);
} finally {
this.httpServer = null;
System.clearProperty("catalina.base");
System.clearProperty("catalina.home");
}
}
}
}
代码示例来源:origin: Dreampie/Resty
public void restartWebApp() throws Exception {
webAppContext.stop();
logger.info("JettyServer restart...");
webAppContext.start();
}
}
代码示例来源:origin: apache/hbase
webAppContext.stop();
} catch (Exception e) {
LOG.error("Error while stopping web app context for webapp "
代码示例来源:origin: apache/geode
managementWebapp.stop();
} catch (Exception e) {
logger.error("unable to stop the management webapp.", e);
代码示例来源:origin: org.apache.hadoop/hadoop-common
webAppContext.stop();
} catch (Exception e) {
LOG.error("Error while stopping web app context for webapp "
代码示例来源:origin: mifos/head
public void stopServer() throws Exception {
webAppContext.stop();
webAppContext = null;
server.stop();
server = null;
}
代码示例来源:origin: org.fabric3/fabric3-container-web-jetty
@ManagementOperation(description = "Stop the web app")
public void stopWebApp() throws Exception {
super.stop();
}
代码示例来源:origin: com.carecon.fabric3/fabric3-container-web-jetty
@ManagementOperation(description = "Stop the web app")
public void stopWebApp() throws Exception {
super.stop();
}
代码示例来源:origin: stackoverflow.com
String webroot = getWarRootPath();
WebAppContext webapp = new WebAppContext(webroot, "/");
server.setHandler(webapp);
scanner.setMonitorDirectory(webroot);
scanner.addListener(this);
...
public void onScannerEvent(ScannerEvent evt) {
if(!evt.path.isFile()) {
return; // no point restarting on directory only event
}
webapp.stop();
if(evt.isNew() || evt.wasDeleted()) {
reconfigureScanner();
}
webapp.start();
}
代码示例来源:origin: com.github.sogyf/goja-jfinal
public void onChange() {
try {
System.err.println("\nLoading changes ......");
webApp.stop();
JFinalClassLoader loader = new JFinalClassLoader(webApp, getClassPath());
webApp.setClassLoader(loader);
webApp.start();
System.err.println("Loading complete.");
} catch (Exception e) {
System.err.println("Error reconfiguring/restarting webapp after change in watched files");
e.printStackTrace();
}
}
};
代码示例来源:origin: T-baby/ICERest
public void onChange() {
try {
System.err.println("\nLoading changes ......");
webApp.stop();
IceRestClassLoader loader = new IceRestClassLoader(webApp, getClassPath());
webApp.setClassLoader(loader);
webApp.start();
System.err.println("Loading complete.");
} catch (Exception e) {
System.err.println("Error reconfiguring/restarting webapp after change in watched files");
logger.error(e.getMessage(), e);
}
}
};
代码示例来源:origin: com.cybermkd/ICEREST
public void onChange() {
try {
System.err.println("\nLoading changes ......");
webApp.stop();
IceRestClassLoader loader = new IceRestClassLoader(webApp, getClassPath());
webApp.setClassLoader(loader);
webApp.start();
System.err.println("Loading complete.");
} catch (Exception e) {
System.err.println("Error reconfiguring/restarting webapp after change in watched files");
logger.error(e.getMessage(), e);
}
}
};
代码示例来源:origin: com.jfinal/jetty-server
public void onChange() {
try {
System.err.println("\nLoading changes ......");
webApp.stop();
JFinalClassLoader loader = new JFinalClassLoader(webApp, getClassPath());
webApp.setClassLoader(loader);
webApp.start();
System.err.println("Loading complete (^_^)");
} catch (Exception e) {
System.err.println("Error reconfiguring/restarting webapp after change in watched files");
LogKit.error(e.getMessage(), e);
}
}
};
代码示例来源:origin: org.jboss.arquillian.container/arquillian-jetty-embedded-7
@Override
public void undeploy(Archive<?> archive) throws DeploymentException
{
WebAppContext wctx = webAppContextProducer.get();
if (wctx != null)
{
try
{
wctx.stop();
}
catch (Exception e)
{
e.printStackTrace();
log.severe("Could not stop context " + wctx.getContextPath() + ": " + e.getMessage());
}
contexts.removeHandler(wctx);
}
}
}
代码示例来源:origin: jenkinsci/winstone
public void reloadWebApp(String prefix) {
WebAppContext webApp = this.webapps.get(prefix);
if (webApp != null) {
try {
webApp.stop();
webApp.start();
} catch (Exception e) {
throw new WinstoneException("Failed to redeploy "+prefix,e);
}
} else {
throw new WinstoneException(Launcher.RESOURCES.getString("HostConfig.PrefixUnknown", prefix));
}
}
代码示例来源:origin: com.github.dactiv/dactiv-common
/**
* 快速重新启动application,重载target/classes与target/test-classes.
*/
public static void reloadContext(Server server) throws Exception {
WebAppContext context = (WebAppContext) server.getHandler();
System.out.println("[INFO] Application reloading");
context.stop();
WebAppClassLoader classLoader = new WebAppClassLoader(context);
classLoader.addClassPath("target/classes");
classLoader.addClassPath("target/test-classes");
context.setClassLoader(classLoader);
context.start();
System.out.println("[INFO] Application reloaded");
}
}
代码示例来源:origin: org.apache.knox/gateway-server
contexts.removeHandler( context );
try {
context.stop();
} catch( Exception e ) {
auditor.audit(Action.UNDEPLOY, topology.getName(), ResourceType.TOPOLOGY, ActionOutcome.FAILURE);
代码示例来源:origin: org.fabric3/fabric3-container-web-jetty
public void deactivate(URI uri) {
Holder holder = mappings.remove(uri);
if (holder == null) {
throw new Fabric3Exception("Mapping does not exist: " + uri.toString());
}
WebAppContext context = holder.getContext();
jettyService.getServer().removeBean(context);
try {
remove(context);
// Stop must called be after remove() as it releases servlets which are accessed by the latter to
// unregister them from the MBean server
context.stop();
} catch (Exception e) {
throw new Fabric3Exception(e);
}
context.setClassLoader(null);
jettyService.removeHandler(context);
monitor.deactivated(holder.getContextPath());
}
代码示例来源:origin: com.carecon.fabric3/fabric3-container-web-jetty
public void deactivate(URI uri) {
Holder holder = mappings.remove(uri);
if (holder == null) {
throw new Fabric3Exception("Mapping does not exist: " + uri.toString());
}
WebAppContext context = holder.getContext();
jettyService.getServer().removeBean(context);
try {
remove(context);
// Stop must called be after remove() as it releases servlets which are accessed by the latter to
// unregister them from the MBean server
context.stop();
} catch (Exception e) {
throw new Fabric3Exception(e);
}
context.setClassLoader(null);
jettyService.removeHandler(context);
monitor.deactivated(holder.getContextPath());
}
内容来源于网络,如有侵权,请联系作者删除!