本文整理了Java中org.apache.catalina.startup.Tomcat.destroy()
方法的一些代码示例,展示了Tomcat.destroy()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tomcat.destroy()
方法的具体详情如下:
包路径:org.apache.catalina.startup.Tomcat
类名称:Tomcat
方法名:destroy
[英]Destroy the server. This object cannot be used once this method has been called.
[中]摧毁服务器。一旦调用此方法,就不能使用此对象。
代码示例来源:origin: spring-projects/spring-framework
@Override
protected void stopInternal() throws Exception {
this.tomcatServer.stop();
this.tomcatServer.destroy();
}
代码示例来源:origin: OryxProject/oryx
@Override
public synchronized void close() throws IOException {
if (tomcat != null) {
try {
tomcat.stop();
tomcat.destroy();
} catch (LifecycleException le) {
log.warn("Unexpected error while stopping", le);
} finally {
tomcat = null;
}
IOUtils.deleteRecursively(noSuchBaseDir);
}
}
代码示例来源:origin: org.springframework.boot/spring-boot
@Override
public void stop() throws WebServerException {
synchronized (this.monitor) {
boolean wasStarted = this.started;
try {
this.started = false;
try {
stopTomcat();
this.tomcat.destroy();
}
catch (LifecycleException ex) {
// swallow and continue
}
}
catch (Exception ex) {
throw new WebServerException("Unable to stop embedded Tomcat", ex);
}
finally {
if (wasStarted) {
containerCounter.decrementAndGet();
}
}
}
}
代码示例来源:origin: line/armeria
@AfterClass
public static void destroyTomcat() throws Exception {
if (tomcatWithWebApp != null) {
tomcatWithWebApp.stop();
tomcatWithWebApp.destroy();
}
if (tomcatWithoutWebApp != null) {
tomcatWithoutWebApp.stop();
tomcatWithoutWebApp.destroy();
}
}
代码示例来源:origin: oblac/jodd
@Override
public void stop() throws Exception {
tomcat.stop();
tomcat.destroy();
super.stop();
}
}
代码示例来源:origin: SonarSource/sonarqube
void terminate() {
if (tomcat.getServer().getState().isAvailable()) {
try {
tomcat.stop();
tomcat.destroy();
} catch (Exception e) {
Loggers.get(EmbeddedTomcat.class).error("Fail to stop web server", e);
}
}
deleteQuietly(tomcatBasedir());
}
代码示例来源:origin: camunda/camunda-bpm-platform
public void stop() {
try {
try {
tomcat.stop();
} catch (Exception e) {
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to stop tomcat instance", e);
}
try {
tomcat.destroy();
} catch (Exception e) {
Logger.getLogger(getClass().getName()).log(Level.WARNING, "Failed to destroy instance", e);
}
tomcat = null;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: com.att.nsa/nsaServerLibrary
public void destroy() throws LifecycleException {
tomcat.destroy();
try {
waitForTomcatLifecycleState(LifecycleState.DESTROYED);
} catch(InterruptedException e) {
//Ignore
}
}
代码示例来源:origin: ws.ament.hammock/web-tomcat
@Override
public void stop() {
try {
tomcat.stop();
tomcat.destroy();
} catch (LifecycleException e) {
throw new RuntimeException("Unable to stop tomcat ",e);
}
}
}
代码示例来源:origin: hammock-project/hammock
@Override
public void stop() {
try {
tomcat.stop();
tomcat.destroy();
} catch (LifecycleException e) {
throw new RuntimeException("Unable to stop tomcat ",e);
}
}
}
代码示例来源:origin: apache/cxf
public void tearDown() throws Exception {
super.tearDown();
if (server != null) {
server.stop();
server.destroy();
server = null;
}
}
}
代码示例来源:origin: org.apache.cxf.systests/cxf-systests-cdi-base
public void tearDown() throws Exception {
super.tearDown();
if (server != null) {
server.stop();
server.destroy();
server = null;
}
}
}
代码示例来源:origin: hopshadoop/hops
protected void stopTomcat() throws Exception {
try {
tomcat.stop();
} catch (Exception e) {
}
try {
tomcat.destroy();
} catch (Exception e) {
}
}
代码示例来源:origin: io.hops/hadoop-auth
protected void stopTomcat() throws Exception {
try {
tomcat.stop();
} catch (Exception e) {
}
try {
tomcat.destroy();
} catch (Exception e) {
}
}
代码示例来源:origin: hortonworks/registry
protected void stopTomcat() throws Exception {
try {
tomcat.stop();
} catch (Exception e) {
}
try {
tomcat.destroy();
} catch (Exception e) {
}
}
代码示例来源:origin: apache/cxf
public void tearDown() throws Exception {
super.tearDown();
if (server != null) {
server.stop();
server.destroy();
server = null;
}
}
}
代码示例来源:origin: apache/eagle
public void shutdown() throws Throwable {
if (tomcat.getServer() != null && tomcat.getServer().getState() != LifecycleState.DESTROYED) {
if (tomcat.getServer().getState() != LifecycleState.STOPPED) {
tomcat.stop();
}
tomcat.destroy();
}
}
}
代码示例来源:origin: org.apache.eagle/eagle-embed-server
public void shutdown() throws Throwable {
if (tomcat.getServer() != null && tomcat.getServer().getState() != LifecycleState.DESTROYED) {
if (tomcat.getServer().getState() != LifecycleState.STOPPED) {
tomcat.stop();
}
tomcat.destroy();
}
}
}
代码示例来源:origin: org.sonarsource.sonarqube/sonar-server
void terminate() {
if (tomcat.getServer().getState().isAvailable()) {
try {
tomcat.stop();
tomcat.destroy();
} catch (Exception e) {
Loggers.get(EmbeddedTomcat.class).error("Fail to stop web server", e);
}
}
deleteQuietly(tomcatBasedir());
}
代码示例来源:origin: org.apache.tomee.patch/commons-jcs-jcache-extras
private void stop(final Tomcat tomcat) throws LifecycleException {
if (LifecycleState.STARTED.equals(tomcat.getServer().getState())) {
tomcat.stop();
tomcat.destroy();
}
}
内容来源于网络,如有侵权,请联系作者删除!