@Override public void destroy() throws Exception { server.stop(); }
/** * Stops the server returned by {@link #getServer()}. * <p> * Exceptions thrown by calling {@link RatpackServer#stop()} are suppressed and written to {@link System#err System.err}. */ @Override default void close() { try { getServer().stop(); } catch (Exception e) { LoggerFactory.getLogger(this.getClass()).error("", e); } }
/** * Stops the server if it is running. * * @see RatpackServer#stop() */ public void stop() { if (server != null) { try { server.stop(); server = null; } catch (Exception e) { throw uncheck(e); } } }
public void execute(final Closure<?> closure) throws Exception { GroovyVersionCheck.ensureRequiredVersionUsed(GroovySystem.getVersion()); lock.lock(); try { if (running != null) { running.stop(); running = null; } Path scriptFile = ClosureUtil.findScript(closure); if (scriptFile == null) { running = RatpackServer.start(new RatpackClosureConfigurer(closure, false)); } else { running = RatpackServer.start(Groovy.Script.app(scriptFile)); } } finally { lock.unlock(); } } }
ratpackServer.stop(); return null; }))