code: public EngineResult waitForEngineReady(int tries, int interval) {
          EngineResult engineResult = null;
          if (tries <= 0) {
              tries = 1;
          }
          if (interval <= 99) {
              interval = 1000;
          }
          boolean bLoop = true;
          while (bLoop && tries > 0) {
              engineResult = rescanJobDirectory();
              // debug
              //System.out.println(engineResult.status + " - " + ResultStatus.OK);
              if (engineResult.status == ResultStatus.OK) {
                  bLoop = false;
              }
              --tries;
              if (bLoop && tries > 0) {
                  try {
                      Thread.sleep(interval);
                  } catch (InterruptedException e) {
                  }
              }
          }
          return engineResult;
      }
docs: TODO
  @param tries
  @param interval
  @return engine state and a list of registered jobs