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

kenneth_suter
26.45.2007 de406e1e0b0db12c1a097876f52d4a5451c68291
Fixed problems experience while testing upgrader on Windows:
- Launcher needs to explicitly call System.exit when the CLI returns a successful code to prevent the CLI from hanging
- CurrentInstallStatus.isServerRunning needs to be told the location of the locks directory instead of trying to discern it from the classpath for Web Start upgrader
3 files modified
34 ■■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java 26 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java 5 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
@@ -215,23 +215,37 @@
  }
  /**
   * Returns if the server is running on the given path.
   * Returns if the server is running on the given path.  The location
   * of the 'locks' directory which is required for this method is
   * determined by getting the installation path from the classpath.
   * NOTE: this method is to be called only when the OpenDS.jar class has
   * already been loaded as it uses classes in that jar.
   * @return <CODE>true</CODE> if the server is running and <CODE>false</CODE>
   * otherwise.
   */
  public static boolean isServerRunning()
  public static boolean isServerRunning() {
    File locksDir = new File(Utils.getInstallPathFromClasspath(),
            org.opends.server.util.ServerConstants.LOCKS_DIRECTORY);
    return isServerRunning(locksDir);
  }
  /**
   * Returns if the server is running on the given path.
   * NOTE: this method is to be called only when the OpenDS.jar class has
   * already been loaded as it uses classes in that jar.
   * @param locksDir File representing the location of the server's 'locks'
   * directory
   * @return <CODE>true</CODE> if the server is running and <CODE>false</CODE>
   * otherwise.
   */
  public static boolean isServerRunning(File locksDir)
  {
    boolean isServerRunning;
    if (!lockPathInitialized)
    {
      String lockDirectory = Utils.getPath(Utils.getInstallPathFromClasspath(),
      org.opends.server.util.ServerConstants.LOCKS_DIRECTORY);
      System.setProperty(
        org.opends.server.util.ServerConstants.PROPERTY_LOCK_DIRECTORY,
        lockDirectory);
        Utils.getPath(locksDir));
      lockPathInitialized = true;
    }
    String lockFile =
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/Launcher.java
@@ -239,10 +239,7 @@
    if (shouldPrintUsage()) {
      printUsage();
    } else if (isCli()) {
      int exitCode = launchCli(args, createCliApplication());
      if (exitCode != 0) {
        System.exit(exitCode);
      }
      System.exit(launchCli(args, createCliApplication()));
    } else {
      willLaunchGui();
      int exitCode = launchGui(args);
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/util/ServerController.java
@@ -126,7 +126,8 @@
          boolean stopped = false;
          for (int i = 0; i < nTries && !stopped; i++) {
            stopped = !CurrentInstallStatus.isServerRunning();
            stopped = !CurrentInstallStatus.isServerRunning(
                    installation.getLocksDirectory());
            if (!stopped) {
              String msg =
                      application.getFormattedLog(