code: public boolean waitForActive(long timeout)
    {
      LifecycleState state = getState();
  
      if (state.isActive()) {
        return true;
      }
      else if (state.isAfterActive()) {
        return false;
      }
      
      // server/1d2j
      long waitEnd = CurrentTime.getCurrentTimeActual() + timeout;
  
      synchronized (this) {
        while ((state = _state).isBeforeActive()
               && CurrentTime.getCurrentTimeActual() < waitEnd) {
          if (state.isActive()) {
            return true;
          }
          else if (state.isAfterActive()) {
            return false;
          }
  
          try {
            long delta = waitEnd - CurrentTime.getCurrentTimeActual();
            
            if (delta > 0) {
              wait(delta);
            }
          } catch (InterruptedException e) {
          }
        }
      }
      
      return _state.isActive();
    }
docs: Wait for a period of time until the service starts.