try { cmd.join(); session.join(); } catch (ConnectionException e) { LOGGER.debug("ConnectException while sending reboot command. Probably system is going down...", e);
try { cmd.join(); session.join(); } catch (ConnectionException e) { LOGGER.debug("ConnectException while sending halt command. Probably system is going down...", e);
while (true) { try { session.join(5, TimeUnit.SECONDS); } catch (ConnectionException e) { boolean isInterrupted = ExceptionUtils.indexOfType(e, InterruptedException.class) >= 0;