diff --git a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java index add9cd750..01146a1e6 100644 --- a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java +++ b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java @@ -189,11 +189,24 @@ public synchronized ListenableFuture shutdown() { return shutdownFuture; } + /** + * Invoke blocking shutdown after blocking start + * Release CountDownLatch locking this thread and shutdown. + * @param duration duration to wait for shutdown to complete + * @param unit {@link TimeUnit} of {@code duration} + * @return {@code boolean} indicating shutdown sucess + * @deprecated Use {@code shutdown()} or {@code shutdown(duration, unit)} instead in case you want blocking shutdown. + */ + @Deprecated(forRemoval = true) + public final boolean shutdownBlocking(final long duration, final TimeUnit unit) { + shutdownLatch.countDown(); + return shutdown(duration, unit); + } + @SuppressWarnings("IllegalCatch") @Override public final boolean shutdown(final long duration, final TimeUnit unit) { try { - shutdownLatch.countDown(); final var stopSuccess = shutdown().get(duration, unit); if (stopSuccess) { LOG.info("LightyModule {} stopped successfully!", getClass().getSimpleName());