@Override
public boolean isReady() {
- System.out.println("received isReady()");
if (ready) {
return true;
}
- System.out.println("checking server.isStarted()");
if (server.isStarted()) {
- System.out.println("moving to ready");
ready = true;
writeTimeToFile("readyAt");
}
- System.out.println("ready: " + ready);
return ready;
}
public void stop() {
try {
if (!server.isStopped()) {
- System.out.println("HttpProcess stopping");
server.stop();
writeTimeToFile("terminatedAt");
}
}
void terminate() {
- LoggerFactory.getLogger(getClass()).info("--- RECEIVED TERMINATE TOMCAT");
if (tomcat.getServer().getState().isAvailable()) {
try {
- LoggerFactory.getLogger(getClass()).info("--- STOP TOMCAT");
tomcat.stop();
tomcat.destroy();
- LoggerFactory.getLogger(getClass()).info("--- TOMCAT TERMINATION - WAIT 10s");
- Thread.sleep(10000L);
- LoggerFactory.getLogger(getClass()).info("--- TOMCAT TERMINATED AFTER 10s");
} catch (Exception e) {
LoggerFactory.getLogger(EmbeddedTomcat.class).error("Fail to stop web server", e);
}