From f885ac10414d4e16cf99564adc3451d98f4ef202 Mon Sep 17 00:00:00 2001
From: kenneth_suter <kenneth_suter@localhost>
Date: Tue, 22 May 2007 15:26:33 +0000
Subject: [PATCH] This commit:

---
 opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
index cae15a4..0bfb343 100644
--- a/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
+++ b/opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -145,6 +145,8 @@
 
     UPGRADING_COMPONENTS("summary-upgrade-upgrading-components", 60),
 
+    PREPARING_CUSTOMIZATIONS("summary-upgrade-preparing-customizations", 65),
+
     APPLYING_SCHEMA_CUSTOMIZATIONS(
             "summary-upgrade-applying-schema-customization", 70),
 
@@ -861,9 +863,15 @@
       if (schemaCustomizationPresent || configCustimizationPresent) {
         try {
           LOG.log(Level.INFO, "starting server");
+          setCurrentProgressStep(
+                  UpgradeProgressStep.PREPARING_CUSTOMIZATIONS);
           startServerWithoutConnectionHandlers();
+          notifyListeners(formatter.getFormattedDone() +
+                  formatter.getLineBreak());
           LOG.log(Level.INFO, "start server finished");
         } catch (ApplicationException e) {
+          notifyListeners(formatter.getFormattedError() +
+                  formatter.getLineBreak());
           LOG.log(Level.INFO,
                   "Error starting server in process in order to apply custom" +
                           "schema and/or configuration", e);
@@ -963,6 +971,15 @@
           try {
             LOG.log(Level.INFO, "starting server");
             setCurrentProgressStep(UpgradeProgressStep.STARTING_SERVER);
+            int port = getInstallation().getCurrentConfiguration().getPort();
+            if (port != -1 && !Utils.canUseAsPort(port)) {
+              throw new ApplicationException(
+                      ApplicationException.Type.APPLICATION,
+                      "The server can not be started as another application " +
+                              "is using port " + port + ".  Check that you " +
+                              "have access to this port before restarting " +
+                              "the server.", null);
+            }
             control.startServer(true);
             notifyListeners(formatter.getFormattedDone() +
                     formatter.getLineBreak());
@@ -1457,6 +1474,10 @@
 
   private void initialize() throws ApplicationException {
     try {
+      if (getInstallation().getStatus().isServerRunning()) {
+        new ServerController(getInstallation()).stopServer(true);
+      }
+
       BuildInformation fromVersion = getCurrentBuildInformation();
       BuildInformation toVersion = getStagedBuildInformation();
       this.historicalOperationId =

--
Gitblit v1.10.0