/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
/** * It will wait the current execution (if there is one) to finish * but will not complete any further executions */ default int shutdownNow() { return shutdownNow(t -> { }); }
@Override public synchronized void stop() throws Exception { if (running) { cursorProvider.flushExecutors(); cursorProvider.stop(); final List<Runnable> pendingTasks = new ArrayList<>(); final int pendingTasksWhileShuttingDown = executor.shutdownNow(pendingTasks::add); if (pendingTasksWhileShuttingDown > 0) { logger.tracef("Try executing %d pending tasks on stop", pendingTasksWhileShuttingDown); for (Runnable pendingTask : pendingTasks) { try { pendingTask.run(); } catch (Throwable t) { logger.warn("Error while executing a pending task on shutdown", t); } } } running = false; if (currentPage != null) { currentPage.close(false); currentPage = null; } } }