code: @FFDCIgnore({ InterruptedException.class })
      public synchronized void waitForComplete() {
          // Don't bother waiting if the vm has been shutdown in the meanwhile...
          while (done.get() == false && !shutdownHook.vmShutdown()) {
              try {
                  // refresh packages should not take a long time..
                  wait(1000);
              } catch (InterruptedException e) {
                  /** No-op **/
              }
          }
      }
docs: Attach a shutdown hook to make sure that the thread waiting for
  the start level to change is posted if the JVM is shut down