code: private void addShutdownHook() {
      if (!running) {
        destroyProcessThread = new ProcessDestroyerImpl();
        Runtime.getRuntime().addShutdownHook(destroyProcessThread);
        added = true;
      }
    }
docs: Registers this <code>ProcessDestroyer</code> as a shutdown hook, uses
  reflection to ensure pre-JDK 1.3 compatibility.