From de406e1e0b0db12c1a097876f52d4a5451c68291 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Thu, 26 Apr 2007 14:45:34 +0000
Subject: [PATCH] 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

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
index 97522b4..6cdaa37 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/CurrentInstallStatus.java
+++ b/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 =

--
Gitblit v1.10.0