本文整理了Java中org.apache.catalina.Context.destroy()
方法的一些代码示例,展示了Context.destroy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Context.destroy()
方法的具体详情如下:
包路径:org.apache.catalina.Context
类名称:Context
方法名:destroy
暂无
代码示例来源:origin: com.github.skjolber.mockito-rest-spring/tomcat
private void destroy(Context context) throws LifecycleException, InterruptedException {
context.destroy();
long deadline = System.currentTimeMillis() + 10000;
do {
switch(context.getState()) {
case DESTROYED:
case FAILED:
return;
default : {
}
}
Thread.sleep(10);
} while(deadline > System.currentTimeMillis());
}
}
代码示例来源:origin: org.apache.openejb/tomee-webservices
@Override
public HttpListener removeListener(final String completePath) {
String path = completePath;
if (path == null) {
return listeners.get(path);
}
// assure context root with a leading slash
if (!path.startsWith("/") && !path.startsWith("http://") && !path.startsWith("https://")) {
path = "/" + path;
}
if (TomcatHelper.isTomcat7() && TomcatHelper.isStopping() && listeners.containsKey(path)) {
return listeners.get(path);
}
Context context = contexts.remove(path);
try {
context.stop();
context.destroy();
} catch (Exception e) {
throw new TomEERuntimeException(e);
}
Host host = (Host) context.getParent();
host.removeChild(context);
return listeners.remove(completePath);
}
}
代码示例来源:origin: org.apache.tomcat/tomcat-catalina
if(context instanceof StandardContext)
try {
context.destroy();
} catch (Exception e) {
log.warn("Error during context [" + context.getName() + "] destroy ", e);
代码示例来源:origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core
if(context instanceof StandardContext)
try {
context.destroy();
} catch (Exception e) {
log.warn("Error during context [" + context.getName() + "] destroy ", e);
代码示例来源:origin: org.apache.openejb/tomee-webservices
public void removeWsContainer(String path) {
if (path == null) return;
// assure context root with a leading slash
if (!path.startsWith("/")) path = "/" + path;
if (TomcatHelper.isTomcat7() && TomcatHelper.isStopping()) {
return;
}
Context context = webserviceContexts.remove(path);
if (WEBSERVICE_OLDCONTEXT_ACTIVE) {
try {
context.destroy();
context.stop();
} catch (Exception e) {
throw new TomEERuntimeException(e);
}
Host host = (Host) context.getParent();
host.removeChild(context);
} // else let tomcat manages its context
}
代码示例来源:origin: com.github.mjeanroy/junit-servers-tomcat
@Override
protected void doStop() {
try {
tomcat.stop();
// Do not forget to destroy context
if (context != null) {
context.destroy();
context = null;
}
if (!configuration.isKeepBaseDir()) {
deleteDirectory(configuration.getBaseDir());
}
}
catch (Exception ex) {
throw new ServerStopException(ex);
}
}
代码示例来源:origin: org.wso2.carbon.commons/org.wso2.carbon.url.mapper.clustermessage
public static void removeVirtualHost(String hostName) {
Engine engine = DataHolder.getInstance().getCarbonTomcatService().getTomcat().getEngine();
Host host = (Host) engine.findChild(hostName);
Context context = (Context) host.findChild("/");
try {
if (host.getState().isAvailable()) {
if (context != null && context.getAvailable()) {
context.setRealm(null);
context.stop();
context.destroy();
log.info("Unloaded webapp from the host: " + host
+ " as the context of: " + context);
}
host.removeChild(context);
host.setRealm(null);
host.stop();
host.destroy();
engine.removeChild(host);
}
}catch (LifecycleException e) {
log.error("error while removing host from tomcat", e);
}
URLMappingHolder.getInstance().removeUrlMappingMap(
host.getName());
log.info("Unloaded host from the engine: " + host);
}
public static Host addHostToEngine(String hostName) {
内容来源于网络,如有侵权,请联系作者删除!