Browse Source

Merge pull request #9370 in DESIGN/design from final/11.0 to release/11.0

* commit '9195dc5627451813e70874589f2722f0faedf8b6':
  REPORT-74500 【FVS】打开fvs的时候切换国际化并重启,设计器卡死
newui
superman 2 years ago
parent
commit
7d00b6b498
  1. 12
      designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java
  2. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  3. 6
      designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

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

@ -7,11 +7,17 @@ import com.fr.module.ModuleContext;
* Created by juhaoyu on 2018/6/6. * Created by juhaoyu on 2018/6/6.
*/ */
public abstract class FineEmbedServer { public abstract class FineEmbedServer {
/**
* 是否正在启动中
*/
private static volatile boolean onStarting = false;
public synchronized static void start() { public synchronized static void start() {
onStarting = true;
EventDispatcher.fire(EmbedServerEvent.BeforeStart); EventDispatcher.fire(EmbedServerEvent.BeforeStart);
ModuleContext.getModule(FineEmbedServerActivator.class).start(); ModuleContext.getModule(FineEmbedServerActivator.class).start();
onStarting = false;
EventDispatcher.fire(EmbedServerEvent.AfterStart); EventDispatcher.fire(EmbedServerEvent.AfterStart);
} }
@ -26,4 +32,8 @@ public abstract class FineEmbedServer {
return ModuleContext.getModule(FineEmbedServerActivator.class).isRunning(); return ModuleContext.getModule(FineEmbedServerActivator.class).isRunning();
} }
public static boolean isOnStarting() {
return onStarting;
}
} }

2
designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

@ -125,7 +125,7 @@ public class DesignerStartup extends Activator {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
// 有可能被插件之类的 强制启动了 判断下 // 有可能被插件之类的 强制启动了 判断下
if (FineEmbedServer.isRunning()) { if (FineEmbedServer.isRunning() || FineEmbedServer.isOnStarting()) {
return; return;
} }
startEmbeddedServer(); startEmbeddedServer();

6
designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

@ -4,6 +4,7 @@ import com.fr.config.dao.DaoSelectorFactory;
import com.fr.config.dao.swicter.DaoSwitcher; import com.fr.config.dao.swicter.DaoSwitcher;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.event.Event; import com.fr.event.Event;
import com.fr.event.EventDispatcher;
import com.fr.event.Listener; import com.fr.event.Listener;
import com.fr.event.Null; import com.fr.event.Null;
import com.fr.exit.ConfigToPropMigrator; import com.fr.exit.ConfigToPropMigrator;
@ -25,6 +26,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
TenantDBAdapter4Designer.super.start(); TenantDBAdapter4Designer.super.start();
afterStart();
} }
}); });
@ -32,7 +34,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
@Override @Override
public void on(Event event, Null param) { public void on(Event event, Null param) {
if (DaoSelectorFactory.getDaoSelector().useCacheDao()) { if (DaoSelectorFactory.getDaoSelector().useCacheDao()) {
beforeEmbedServerStart(); EventDispatcher.fire(LazyStartupEvent.INSTANCE);
} }
} }
}); });
@ -42,7 +44,7 @@ public class TenantDBAdapter4Designer extends TenantDBAdapter {
} }
} }
private void beforeEmbedServerStart() { private void afterStart() {
DesignerEnvManager.getEnvManager().setPropertiesUsable(false); DesignerEnvManager.getEnvManager().setPropertiesUsable(false);
DaoSwitcher.executeSwitch(); DaoSwitcher.executeSwitch();
ConfigToPropMigrator.getInstance().deletePropertiesCache(); ConfigToPropMigrator.getInstance().deletePropertiesCache();

Loading…
Cancel
Save