void awaitTermination() { tomcat.getServer().await(); } }
/** * Blocks and waits until the server shuts down. */ public void await() { Server server; synchronized (this) { server = tomcat.getServer(); } server.await(); // Can't do this with lock held }
@Override public void run() { TomcatWebServer.this.tomcat.getServer().await(); }
tomcat.getServer().await();
/** * Await and shutdown. */ public void await() { server.await(); }
/** * Await and shutdown. */ public void await() { server.await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
public void await() { // public as parts if (server == null) { throw new IllegalStateException("server has not been started."); } try { server.getServer().await(); } catch (Exception e) { throw new IllegalStateException("server join failed.", e); } }
/** * Await and shutdown. */ public void await() { getServer().await(); }
@Override public void run() { TomcatStarter.this.tomcat.getServer().await(); } };
/** * Blocks and waits until the server shuts down. */ public void await() { tomcat.getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
/** * Await and shutdown. */ public void await() { getServer().await(); }
@Override public void destroy() throws Exception { tomcat.stop(); tomcat.getServer().await(); }
public static void main(String[] args) throws LifecycleException, SQLException { Tomcat tomcat = new Tomcat(); tomcat.setPort(8080); File base = new File(System.getProperty("java.io.tmpdir")); Context rootCtx = tomcat.addContext("/", base.getAbsolutePath()); Tomcat.addServlet(rootCtx, "log", new LogService()); rootCtx.addServletMapping("/*", "log"); tomcat.start(); tomcat.getServer().await(); }
@Override public void startServer() throws Exception { tomcat.start(); String address = tomcat.getServer().getAddress(); int port = tomcat.getConnector().getPort(); log.info("local address: http://{}:{}", address, port); tomcat.getServer().await(); }