use of org.springframework.boot.web.server.WebServerException in project sofa-ark by alipay.
the class ArkTomcatWebServer method start.
@Override
public void start() throws WebServerException {
synchronized (this.monitor) {
if (this.started) {
return;
}
try {
addPreviouslyRemovedConnectors();
this.tomcat.getConnector();
checkThatConnectorsHaveStarted();
this.started = true;
logger.info("Tomcat started on port(s): " + getPortsDescription(true) + " with context path '" + getContextPath() + "'");
} catch (ConnectorStartFailedException ex) {
stopSilently();
throw ex;
} catch (Exception ex) {
throw new WebServerException("Unable to start embedded Tomcat server", ex);
} finally {
Context context = findContext();
ContextBindings.unbindClassLoader(context, context.getNamingToken(), getClass().getClassLoader());
}
}
}
use of org.springframework.boot.web.server.WebServerException in project sofa-ark by alipay.
the class ArkTomcatWebServer method stop.
@Override
public void stop() throws WebServerException {
synchronized (this.monitor) {
boolean wasStarted = this.started;
try {
this.started = false;
try {
stopContext();
stopTomcatIfNecessary();
} catch (Throwable ex) {
// swallow and continue
}
} catch (Exception ex) {
throw new WebServerException("Unable to stop embedded Tomcat", ex);
} finally {
if (wasStarted) {
containerCounter.decrementAndGet();
}
}
}
}
Aggregations