code: public final void waitForFullService() {
          if (!m_state.isInitialized()) {
              throw new RuntimeException("Service has not been initialized");
          }
          synchronized (m_stateChangeLock) {
              // Loop until state >= RUNNING
              while (!m_state.isRunning()) {
                  try {
                      m_stateChangeLock.wait();
                  } catch (InterruptedException e) {
                  }
              }
              if (m_state.isStopping()) {
                  throw new RuntimeException("Service " + this.getClass().getSimpleName() +
                                             " failed before reaching running state");
              }
          }
      }
docs: Wait for this service to reach the running state then return. A RuntimeException
  is thrown if the service has not been initialized.
  
  @throws RuntimeException  If this service has not been initialized.