*) Adding additional shutdown method which is neede to run yacy als windows service

See: http://www.yacy-websuche.de/wiki/index.php/De:WinService

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1507 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
theli 19 years ago
parent 442807cb29
commit 0fbe1a4515

@ -538,6 +538,11 @@ public final class yacy {
return config;
}
static void shutdown() {
String applicationRoot = System.getProperty("user.dir").replace('\\', '/');
shutdown(applicationRoot);
}
/**
* Call the shutdown-page from yacy to tell it to shut down. This method is
* called if you start yacy with the argument -shutdown.
@ -1579,9 +1584,11 @@ class shutdownHookThread extends Thread {
serverLog.logConfig("SHUTDOWN","Shutdown via shutdown hook.");
// sending the yacy main thread a shutdown signal
serverLog.logFine("SHUTDOWN","Signaling shutdown to the switchboard.");
this.sb.terminate();
// waiting for the yacy thread to finish execution
serverLog.logFine("SHUTDOWN","Waiting for main thread to finish.");
this.mainThread.join();
}
} catch (Exception e) {

Loading…
Cancel
Save