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

jvergara
02.00.2009 467c5105a16caa80d02cc34c13a6b8b76f9dcc79
Fix for issue 4082 (stop-ds -p ADMIN_PORT doesn't stop Windows OpenDS service)
When the server is configured as a Windows Service, use the class StopWindowsService to stop the server.
1 files modified
20 ■■■■■ changed files
opends/src/server/org/opends/server/tasks/ShutdownTask.java 20 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tasks/ShutdownTask.java
@@ -22,7 +22,7 @@
 * CDDL HEADER END
 *
 *
 *      Copyright 2006-2008 Sun Microsystems, Inc.
 *      Copyright 2006-2009 Sun Microsystems, Inc.
 */
package org.opends.server.tasks;
@@ -176,8 +176,24 @@
    // that will be responsible for really invoking the shutdown and then this
    // method will return.  We'll have to use different types of threads
    // depending on whether we're doing a restart or a shutdown.
    if (restart)
    boolean configuredAsService =
      DirectoryServer.isRunningAsWindowsService();
    if (configuredAsService && !restart)
    {
      ShutdownTaskThread shutdownThread =
        new ShutdownTaskThread(shutdownMessage)
      {
        public void run()
        {
          org.opends.server.tools.StopWindowsService.main(new String[]{});
        }
      };
      shutdownThread.start();
    }
    else if (restart)
    {
      // Since the process will not be killed, we can proceed exactly the same
      // way with or without windows service configured.
      RestartTaskThread restartThread = new RestartTaskThread(shutdownMessage);
      restartThread.start();
    }