mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
08.07.2007 2415bae875ebc411a555a5dde2391d173397f547
opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -303,7 +303,6 @@
    try
    {
      String startedId = getStartedId();
      Process process = pb.start();
      BufferedReader err =
@@ -314,6 +313,7 @@
      StartReader errReader = new StartReader(err, startedId, true);
      StartReader outputReader = new StartReader(out, startedId, false);
      long finishedTime = 0;
      while (!errReader.isFinished() || !outputReader.isFinished())
      {
        try
@@ -322,6 +322,25 @@
        } catch (InterruptedException ie)
        {
        }
        if (errReader.startedIdFound() || outputReader.startedIdFound())
        {
          /* When we start the server in windows and we are not running it
           * under a windows service, the readers are kept open forever.
           * Once we find that is finished, wait at most 7 seconds.
           */
          if (finishedTime == 0)
          {
            finishedTime = System.currentTimeMillis();
          }
          else
          {
            if (System.currentTimeMillis() - finishedTime > 7000)
            {
              break;
            }
          }
        }
      }
      // Collect any messages found in the output
@@ -532,6 +551,8 @@
    private boolean isFinished;
    private boolean startedIdFound;
    private boolean isFirstLine;
    /**
@@ -577,9 +598,10 @@
                isFirstLine = false;
              }
              LOG.log(Level.INFO, "server: " + line);
              if (line.indexOf("id=" + startedId) != -1)
              if (line.toLowerCase().indexOf("=" + startedId) != -1)
              {
                isFinished = true;
                startedIdFound = true;
              }
              messages.add(line);
@@ -624,10 +646,17 @@
    {
      return isFinished;
    }
  }
  private String getMsg(String key) {
    return ResourceProvider.getInstance().getMsg(key);
    /**
     * Returns <CODE>true</CODE> if the server start Id was found and
     * <CODE>false</CODE> otherwise.
     * @return <CODE>true</CODE> if the server start Id was found and
     * <CODE>false</CODE> otherwise.
     */
    public boolean startedIdFound()
    {
      return startedIdFound;
    }
  }
  private String getMsg(String key, String... args) {