Browse Source

CORE-76 Activator重复启动内置服务器、切换环境的支持

1、重写一下之前的内置tomcat启动,直接指定initializer,省的tomcat也要扫描一遍class
2、tomcat关闭时,关闭activator
还有一些待完善,无阻塞,先传代码方便各个模块的Activator调试
master
ju 7 years ago
parent
commit
4572645713
  1. 2
      designer-base/src/com/fr/design/DesignerEnvManager.java
  2. 2
      designer-base/src/com/fr/design/actions/file/PreferencePane.java
  3. 2
      designer-base/src/com/fr/design/utils/DesignUtils.java
  4. 4
      designer-base/src/com/fr/start/ServerStarter.java
  5. 2
      designer-base/src/com/fr/start/server/FineEmbedServer.java
  6. 2
      designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java

2
designer-base/src/com/fr/design/DesignerEnvManager.java

@ -740,7 +740,7 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter {
/**
* 返回Jetty服务器的端口号
*/
public int getInnerServerPort() {
public int getEmbedServerPort() {
return this.jettyServerPort;
}

2
designer-base/src/com/fr/design/actions/file/PreferencePane.java

@ -550,7 +550,7 @@ public class PreferencePane extends BasicPane {
this.pageLengthComboBox.setSelectedIndex(designerEnvManager.getPageLengthUnit());
this.reportLengthComboBox.setSelectedIndex(designerEnvManager.getReportLengthUnit());
this.portEditor.setValue(new Integer(designerEnvManager.getInnerServerPort()));
this.portEditor.setValue(new Integer(designerEnvManager.getEmbedServerPort()));
this.jdkHomeTextField.setText(designerEnvManager.getJdkHome());

2
designer-base/src/com/fr/design/utils/DesignUtils.java

@ -351,7 +351,7 @@ public class DesignUtils {
} else {
try {
String web = GeneralContext.getCurrentAppNameOfEnv();
String url = "http://localhost:" + DesignerEnvManager.getEnvManager().getInnerServerPort()
String url = "http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort()
+ "/" + web + "/" + ServerConfig.getInstance().getServletName() + baseRoute
+ postfixOfUri;
ServerStarter.browserURLWithLocalEnv(url);

4
designer-base/src/com/fr/start/ServerStarter.java

@ -42,7 +42,7 @@ public class ServerStarter {
}
if (ComparatorUtils.equals(StableUtils.getInstallHome(), ".")) {//august:供代码使用
String web = GeneralContext.getCurrentAppNameOfEnv();
browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getInnerServerPort() + "/" + web + "/" + ServerConfig.getInstance().getServletName());
browserURLWithLocalEnv("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + web + "/" + ServerConfig.getInstance().getServletName());
return;
}
DesignerEnvManager envManager = DesignerEnvManager.getEnvManager();
@ -75,7 +75,7 @@ public class ServerStarter {
FineEmbedServer.getInstance().start();
} finally {
//先访问Demo, 后访问报表, 不需要重置服务器.
browser("http://localhost:" + DesignerEnvManager.getEnvManager().getInnerServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName());
browser("http://localhost:" + DesignerEnvManager.getEnvManager().getEmbedServerPort() + "/" + GeneralContext.getCurrentAppNameOfEnv() + "/" + ServerConfig.getInstance().getServletName());
}
}

2
designer-base/src/com/fr/start/server/FineEmbedServer.java

@ -53,7 +53,7 @@ public class FineEmbedServer extends AbstractLifecycle {
tomcat = new Tomcat();
//覆盖tomcat的WebAppClassLoader
tomcat.setPort(DesignerEnvManager.getEnvManager().getInnerServerPort());
tomcat.setPort(DesignerEnvManager.getEnvManager().getEmbedServerPort());
String docBase = new File(FRContext.getCurrentEnv().getPath()).getParent();
String appName = "/" + FRContext.getCurrentEnv().getAppName();
Context context = tomcat.addContext(appName, docBase);

2
designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java

@ -23,7 +23,7 @@ public class ChartMapEditorAction extends UpdateAction {
}
public void actionPerformed(ActionEvent evt) {
int port = DesignerEnvManager.getEnvManager().getInnerServerPort();
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = ServerConfig.getInstance().getReportServletName();
Env env = FRContext.getCurrentEnv();

Loading…
Cancel
Save