* Console, TunnelControllerGroup: Don't register shutdown hook if ClientAppManager is present

* JettyStart: Fixes for use by plugins
 * RouterAppManager: Add shutdown hook
This commit is contained in:
zzz
2013-04-24 15:45:15 +00:00
parent 57fd46d3a1
commit 813a1981d9
6 changed files with 75 additions and 14 deletions

View File

@@ -125,7 +125,9 @@ public class TunnelControllerGroup implements ClientApp {
loadControllers(_configFile);
if (_mgr != null)
_mgr.register(this);
_context.addShutdownTask(new Shutdown());
// RouterAppManager registers its own shutdown hook
else
_context.addShutdownTask(new Shutdown());
}
/**
@@ -194,7 +196,9 @@ public class TunnelControllerGroup implements ClientApp {
*
* @since 0.8.8
*/
public void shutdown() {
public synchronized void shutdown() {
if (_state != STARTING && _state != RUNNING)
return;
changeState(STOPPING);
if (_mgr != null)
_mgr.unregister(this);