@Override protected void after() { app.stop(); } }
@Override public void contextDestroyed(final ServletContextEvent sce) { ServletContext ctx = sce.getServletContext(); Jooby app = (Jooby) ctx.getAttribute(Jooby.class.getName()); if (app != null) { app.stop(); } }
/** * Start an application. Fire the {@link #onStart(Throwing.Runnable)} event and the * {@link #onStarted(Throwing.Runnable)} events. * * @param args Application arguments. */ public void start(final String... args) { try { start(args, null); } catch (Throwable x) { stop(); String msg = "An error occurred while starting the application:"; if (throwBootstrapException) { throw new Err(Status.SERVICE_UNAVAILABLE, msg, x); } else { logger(this).error(msg, x); } } }
@Override public void evaluate() throws Throwable { List<Throwable> errors = new ArrayList<Throwable>(); try { next.evaluate(); } catch (Throwable e) { errors.add(e); } try { app.stop(); } catch (Exception ex) { errors.add(ex); } if (errors.isEmpty()) { return; } if (errors.size() == 1) { throw errors.get(0); } throw new MultipleFailureException(errors); } };
@Override protected void after() { app.stop(); } }
@Override public void contextDestroyed(final ServletContextEvent sce) { ServletContext ctx = sce.getServletContext(); Jooby app = (Jooby) ctx.getAttribute(Jooby.class.getName()); if (app != null) { app.stop(); } }
/** * Start an application. Fire the {@link #onStart(Throwing.Runnable)} event and the * {@link #onStarted(Throwing.Runnable)} events. * * @param args Application arguments. */ public void start(final String... args) { try { start(args, null); } catch (Throwable x) { stop(); String msg = "An error occurred while starting the application:"; if (throwBootstrapException) { throw new Err(Status.SERVICE_UNAVAILABLE, msg, x); } else { logger(this).error(msg, x); } } }