private void awaitTermination() throws InterruptedException { container.awaitTermination(); System.exit(1); } }
public void stop() { this.serviceContainer.shutdown(); try { this.serviceContainer.awaitTermination(); } catch (InterruptedException e) { log.error("Interrupted before all services shutdown.", e); } }
@Override public void shutdown() { if (container != null) { container.shutdown(); try { container.awaitTermination(5, TimeUnit.SECONDS); } catch (InterruptedException e) { e.printStackTrace(); } container = null; if (legacyServices != null) { for (T legacyService: legacyServices.values()) { legacyService.shutdown(); } legacyServices.clear(); } } }
try { serviceContainer.shutdown(); serviceContainer.awaitTermination(); } catch (RuntimeException rte) { throw rte;
try { serviceContainer.shutdown(); serviceContainer.awaitTermination(); } catch (RuntimeException rte) { throw rte;
serviceContainer.shutdown(); serviceContainer.awaitTermination(); } catch (RuntimeException rte) { throw rte;
serviceContainer.shutdown(); serviceContainer.awaitTermination(); } catch (RuntimeException rte) { throw rte;