private void waitForDown() { while (process != null && process.isAlive()) { try { process.waitFor(); } catch (InterruptedException ignored) { // ignore, waiting for process to stop Thread.currentThread().interrupt(); } } }
@Override public void run() { try { process.waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); // stop watching process } stopForcibly(); } }
private void stopGracefully(long timeout, TimeUnit timeoutUnit) { if (process == null) { return; } try { // request graceful stop process.askForStop(); process.waitFor(timeout, timeoutUnit); } catch (InterruptedException e) { // can't wait for the termination of process. Let's assume it's down. LOG.warn("Interrupted while stopping process {}", processId, e); Thread.currentThread().interrupt(); } catch (Throwable e) { LOG.error("Can not ask for graceful stop of process {}", processId, e); } }
@Override public void run() { try { process.waitFor(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); // stop watching process } stopForcibly(); } }
private void waitForDown() { while (process != null && process.isAlive()) { try { process.waitFor(); } catch (InterruptedException ignored) { // ignore, waiting for process to stop Thread.currentThread().interrupt(); } } }
private void stopGracefully(long timeout, TimeUnit timeoutUnit) { if (process == null) { return; } try { // request graceful stop process.askForStop(); process.waitFor(timeout, timeoutUnit); } catch (InterruptedException e) { // can't wait for the termination of process. Let's assume it's down. LOG.warn("Interrupted while stopping process {}", processId, e); Thread.currentThread().interrupt(); } catch (Throwable e) { LOG.error("Can not ask for graceful stop of process {}", processId, e); } }