fix scm-server stop method on windows, see issue #623

This commit is contained in:
Sebastian Sdorra
2014-08-28 09:03:43 +02:00
parent ae65fb68ae
commit cb00ed3d75
2 changed files with 10 additions and 3 deletions

View File

@@ -52,6 +52,9 @@ public class ScmServer extends Thread
/** Field description */
public static final String CONFIGURATION = "/server-config.xml";
/** Field description */
static final int GRACEFUL_TIMEOUT = 2000;
//~--- constructors ---------------------------------------------------------
/**
@@ -113,14 +116,17 @@ public class ScmServer extends Thread
}
/**
* Method description
* Stop embedded webserver. Use {@link Server#stop()} to fix windows service.
*
* @see <a href="http://goo.gl/Zfy0Ev">http://goo.gl/Zfy0Ev</a>
*/
public void stopServer()
{
try
{
server.setGracefulShutdown(GRACEFUL_TIMEOUT);
server.setStopAtShutdown(true);
server.stop();
initialized = false;
}
catch (Exception ex)