code: public void waitForExit() {
          if (shutdownHook != null) {
              synchronized (shutdownHookMonitor) {
                  if (shutdownHook != null) {
                      synchronized (frameworkProcessMonitor) {
                          try {
                              frameworkProcess.waitFor();
                              shutdown();
                          // CHECKSTYLE:SKIP
                          } catch (Throwable e) {
                              shutdown();
                          }
                      }
                  }
              }
          }
      }
docs: Wait till the framework process exits.