@Override protected void after() { Collection<BQRuntime> localRuntimes = this.runtimes; if (localRuntimes != null) { localRuntimes.forEach(runtime -> { try { runtime.shutdown(); } catch (Exception e) { // ignore... } }); } }
/** * Executes Bootique runtime shutdown, allowing all interested DI services to perform cleanup. * * @since 0.12 */ public void shutdown() { ShutdownManager shutdownManager = injector.getInstance(ShutdownManager.class); BootLogger logger = getBootLogger(); shutdown(shutdownManager, logger); }
public void stop() { runtime.shutdown(); // must interrupt execution (using "shutdown()" is not enough to stop // Jetty for instance executor.shutdownNow(); try { executor.awaitTermination(3, TimeUnit.SECONDS); logger.stderr("Daemon runtime stopped..."); } catch (InterruptedException e) { logger.stderr("Interrupted while waiting for shutdown", e); } } }
@Override public void run() { shutdown(shutdownManager, logger); } });
/** * Executes Bootique runtime shutdown, allowing all interested DI services to perform cleanup. * * @since 0.12 */ public void shutdown() { ShutdownManager shutdownManager = injector.getInstance(ShutdownManager.class); BootLogger logger = getBootLogger(); shutdown(shutdownManager, logger); }