code: public void run() {
      this.runnerState = JobControl.RUNNING;
      while (true) {
        while (this.runnerState == JobControl.SUSPENDED) {
          try {
            Thread.sleep(5000);
          }
          catch (Exception e) {
  					
          }
        }
        checkRunningJobs();	
        checkWaitingJobs();		
        startReadyJobs();		
        if (this.runnerState != JobControl.RUNNING && 
            this.runnerState != JobControl.SUSPENDED) {
          break;
        }
        try {
          Thread.sleep(5000);
        }
        catch (Exception e) {
  				
        }
        if (this.runnerState != JobControl.RUNNING && 
            this.runnerState != JobControl.SUSPENDED) {
          break;
        }
      }
      this.runnerState = JobControl.STOPPED;
    }
docs: The main loop for the thread.
  The loop does the following:
  Check the states of the running jobs
  Update the states of waiting jobs
  Submit the jobs in ready state