@Override
    public void processTerminated(ProcessEvent event) {
      LOG.warn("Watcher terminated with exit code " + event.getExitCode());

      myProcessHandler = null;

      try {
        startupProcess(true);
      } catch (IOException e) {
        shutdownProcess();
        LOG.warn(
            "Watcher terminated and attempt to restart has failed. Exiting watching thread.", e);
      }
    }