Browse Source

Merge pull request #945 in DESIGN/design from ~JU/design:feature/10.0 to feature/10.0

* commit '8114a3bc642c05d1dc86d83308b56c57c434fb6a':
  REPORT-17988 设计器启动速度&闪退 1、提供并行activator 2、打印启动时长信息用于后面调试
research/10.0
ju 5 years ago
parent
commit
ccc12a3901
  1. 11
      designer-realize/src/main/java/com/fr/start/Designer.java
  2. 7
      designer-realize/src/main/java/com/fr/start/module/DesignerStartup.java

11
designer-realize/src/main/java/com/fr/start/Designer.java

@ -21,6 +21,7 @@ import com.fr.design.gui.ibutton.UIPreviewButton;
import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.gui.itoolbar.UILargeToolbar;
import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.InformationCollector;
@ -49,6 +50,7 @@ import com.fr.stable.lifecycle.LifecycleFatalError;
import com.fr.stable.xml.XMLTools;
import com.fr.start.module.StartupArgs;
import com.fr.start.server.ServerTray;
import com.fr.third.org.apache.commons.lang3.time.StopWatch;
import com.fr.workspace.WorkContext;
import javax.swing.JComponent;
@ -92,7 +94,9 @@ public class Designer extends BaseDesigner {
* @param args 参数
*/
public static void main(String[] args) {
StopWatch watch = new StopWatch();
watch.start();
//启动运行时
FineRuntime.start();
Module designerRoot = ModuleContext.parseRoot("designer-startup.xml");
@ -102,7 +106,7 @@ public class Designer extends BaseDesigner {
designerRoot.start();
} catch (LifecycleFatalError fatal) {
SplashContext.getInstance().hide();
JOptionPane.showMessageDialog(null, fatal.getMessage(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
JOptionPane.showMessageDialog(null, fatal.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE);
FineLoggerFactory.getLogger().error(fatal.getMessage(), fatal);
System.exit(0);
}
@ -111,7 +115,8 @@ public class Designer extends BaseDesigner {
//初始化一下serverTray
ServerTray.init();
}
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", watch.getTime());
watch.stop();
}
/**

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

@ -5,6 +5,7 @@ import com.fr.design.file.HistoryTemplateListCache;
import com.fr.design.mainframe.DesignerContext;
import com.fr.event.Event;
import com.fr.event.Listener;
import com.fr.log.FineLoggerFactory;
import com.fr.module.Activator;
import com.fr.record.analyzer.EnableMetrics;
import com.fr.record.analyzer.Metrics;
@ -14,6 +15,7 @@ import com.fr.start.ServerStarter;
import com.fr.start.SplashContext;
import com.fr.start.server.FineEmbedServer;
import com.fr.startup.activators.BasicActivator;
import com.fr.third.org.apache.commons.lang3.time.StopWatch;
import com.fr.workspace.Workspace;
import com.fr.workspace.WorkspaceEvent;
@ -49,14 +51,19 @@ public class DesignerStartup extends Activator {
FineEmbedServer.start();
}
});
final StopWatch watch = new StopWatch();
service.submit(new Runnable() {
@Override
public void run() {
try {
watch.start();
designer.show(args);
} finally {
DesignerContext.getDesignerFrame().getProgressDialog().dispose();
FineLoggerFactory.getLogger().info("Designer showed.Time used {} ms", watch.getTime());
watch.stop();
}
}
});

Loading…
Cancel
Save