public static void Destroy() { if (instance_su != null && !instance_su.shutdown) { instance_su.shutdown(); } if (instance_sh != null && !instance_sh.shutdown) { instance_sh.shutdown(); } instance_su = null; instance_sh = null; }
private static VTCommandResult run_internal( String command, VirtualTerminal instance, VTCallback callback) throws Exception { try { return instance.runCommand(command, callback); } catch (BrokenPipeException bpe) { instance.shutdown(); bpe.printStackTrace(); retries++; if (retries > 5) throw new Exception("Max retries for VirtualTerminal reached!"); Thread.sleep(500); return run_internal(command, instance, callback); } catch (Exception ex) { ex.printStackTrace(); instance.shutdown(); throw new Exception("Error in VirtualTerminal", ex); } }