Browse Source

Merge remote-tracking branch 'origin/feature/x' into feature/x

feature/x
Yuan.Wang 3 years ago
parent
commit
4cecda060c
  1. 3
      designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java
  2. 12
      designer-base/src/main/java/com/fr/start/server/FineEmbedServer.java
  3. 2
      designer-form/src/main/java/com/fr/design/fit/NewJForm.java
  4. 2
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java
  5. 6
      designer-realize/src/main/java/com/fr/start/module/optimized/TenantDBAdapter4Designer.java

3
designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java

@ -1,5 +1,6 @@
package com.fr.design.data.datapane.connect; package com.fr.design.data.datapane.connect;
import com.fr.base.TemplateUtils;
import com.fr.config.RemoteConfigEvent; import com.fr.config.RemoteConfigEvent;
import com.fr.data.core.db.JDBCSecurityChecker; import com.fr.data.core.db.JDBCSecurityChecker;
import com.fr.data.impl.Connection; import com.fr.data.impl.Connection;
@ -201,7 +202,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh
Connection connection = connectionBean.getConnection(); Connection connection = connectionBean.getConnection();
if (connection instanceof JDBCDatabaseConnection) { if (connection instanceof JDBCDatabaseConnection) {
try { try {
JDBCSecurityChecker.checkURL(((JDBCDatabaseConnection) connection).getURL()); JDBCSecurityChecker.checkURL(TemplateUtils.render(((JDBCDatabaseConnection) connection).getURL()));
JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery()); JDBCSecurityChecker.checkValidationQuery(((JDBCDatabaseConnection) connection).getDbcpAttr().getValidationQuery());
} catch (SQLException e) { } catch (SQLException e) {
throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause()); throw new SQLException(Toolkit.i18nText("Fine-Design_Basic_Database_Connection_Invalid_Config", connectionBean.getName()) + ", " + e.getMessage(), e.getCause());

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

@ -8,10 +8,16 @@ import com.fr.module.ModuleContext;
*/ */
public abstract class FineEmbedServer { public abstract class FineEmbedServer {
public synchronized static void start() { /**
* 是否正在启动中
*/
private static volatile boolean onStarting = false;
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-form/src/main/java/com/fr/design/fit/NewJForm.java

@ -55,7 +55,7 @@ public class NewJForm extends JForm {
public NewJForm(Form form) { public NewJForm(Form form) {
super(form); super(form);
//新建的模板都要加上新表单标志attr //新建的模板都要加上新表单标志attr
form.addAttrMark(NewFormMarkAttr.createNewFormAttr()); getTarget().addAttrMark(NewFormMarkAttr.createNewFormAttr());
init(); init();
} }

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