public void shutdown(final long gracePeriod, final TimeUnit timeUnit) { stop(); if (gracePeriod > 0) { try { awaitTermination(gracePeriod, timeUnit); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } final List<Runnable> runnables = this.workerExecutorService.shutdownNow(); for (Runnable runnable: runnables) { if (runnable instanceof Worker) { final Worker worker = (Worker) runnable; final HttpServerConnection conn = worker.getConnection(); try { conn.shutdown(); } catch (IOException ex) { this.exceptionLogger.log(ex); } } } }
public void shutdown(final long gracePeriod, final TimeUnit timeUnit) { stop(); if (gracePeriod > 0) { try { awaitTermination(gracePeriod, timeUnit); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } final List<Runnable> runnables = this.workerExecutorService.shutdownNow(); for (Runnable runnable: runnables) { if (runnable instanceof Worker) { final Worker worker = (Worker) runnable; final HttpServerConnection conn = worker.getConnection(); try { conn.shutdown(); } catch (IOException ex) { this.exceptionLogger.log(ex); } } } }
public void shutdown(final long gracePeriod, final TimeUnit timeUnit) { stop(); if (gracePeriod > 0) { try { awaitTermination(gracePeriod, timeUnit); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } } final List<Runnable> runnables = this.workerExecutorService.shutdownNow(); for (Runnable runnable: runnables) { if (runnable instanceof Worker) { final Worker worker = (Worker) runnable; final HttpServerConnection conn = worker.getConnection(); try { conn.shutdown(); } catch (IOException ex) { this.exceptionLogger.log(ex); } } } }
public void shutdown(final long gracePeriod, final TimeUnit timeUnit) { stop(); if (gracePeriod > 0) { try { awaitTermination(gracePeriod, timeUnit); } catch (final InterruptedException ex) { Thread.currentThread().interrupt(); } } final Set<Worker> workers = this.workerExecutorService.getWorkers(); for (final Worker worker: workers) { final HttpServerConnection conn = worker.getConnection(); try { conn.shutdown(); } catch (final IOException ex) { this.exceptionLogger.log(ex); } } }