|
|
|
@ -34,6 +34,7 @@ public class StartServer {
|
|
|
|
|
// 原先的tomcatHost放在类TomcatHost里面,很不方便操作,而且因为存在多个进程的原因,
|
|
|
|
|
// 原先的getInstance()方法无多大意义
|
|
|
|
|
private static TomcatHost tomcatHost = null; |
|
|
|
|
private static Object lock = new Object(); |
|
|
|
|
|
|
|
|
|
static { |
|
|
|
|
GeneralContext.addEnvChangedListener(new EnvChangedListener() { |
|
|
|
@ -80,6 +81,7 @@ public class StartServer {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void initDemoServerAndBrowser() { |
|
|
|
|
synchronized (lock) { |
|
|
|
|
if (tomcatHost != null) { |
|
|
|
|
if (!tomcatHost.isDemoAppLoaded()) { |
|
|
|
|
tomcatHost.exit(); |
|
|
|
@ -90,6 +92,7 @@ public class StartServer {
|
|
|
|
|
tomcatHost = new TomcatHost(DesignerEnvManager.getEnvManager().getJettyServerPort()); |
|
|
|
|
tomcatHost.addAndStartInstallHomeWebApp(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (!tomcatHost.isStarted()) { |
|
|
|
|
tomcatHost.start(); |
|
|
|
@ -105,6 +108,7 @@ public class StartServer {
|
|
|
|
|
|
|
|
|
|
public static void start() { |
|
|
|
|
try { |
|
|
|
|
synchronized (lock) { |
|
|
|
|
if (tomcatHost != null) { |
|
|
|
|
if (NEED_LOAD_ENV) { |
|
|
|
|
tomcatHost.exit(); |
|
|
|
@ -117,6 +121,7 @@ public class StartServer {
|
|
|
|
|
tomcatHost.addAndStartLocalEnvHomeWebApp(); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (!tomcatHost.isStarted()) { |
|
|
|
|
tomcatHost.start(); |
|
|
|
|
} |
|
|
|
|