You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
84 lines
2.9 KiB
84 lines
2.9 KiB
10 months ago
|
package com.fr.start;
|
||
|
|
||
|
import com.fanruan.boot.key.StartupArgsShell;
|
||
|
import com.fanruan.carina.Carina;
|
||
|
import com.fanruan.carina.context.CarinaApplicationContext;
|
||
|
import com.fanruan.carina.standard.PartitionManager;
|
||
|
import com.fanruan.carina.standard.PartitionManagerImpl;
|
||
|
import com.fr.design.DesignerEnvManager;
|
||
|
import com.fr.design.carton.SwitchForSwingChecker;
|
||
|
import com.fr.design.deeplink.DeepLinkManager;
|
||
|
import com.fr.design.monitor.DesignerLifecycleMonitorContext;
|
||
|
import com.fr.event.Event;
|
||
|
import com.fr.event.EventDispatcher;
|
||
|
import com.fr.event.Listener;
|
||
|
import com.fr.log.FineLoggerFactory;
|
||
|
import com.fr.module.engine.event.LifecycleErrorEvent;
|
||
|
import com.fr.runtime.FineRuntime;
|
||
|
import com.fr.stable.lifecycle.FineLifecycleFatalError;
|
||
|
import com.fr.start.common.DesignerStartupContext;
|
||
|
import com.fr.start.module.StartupArgs;
|
||
|
import com.fr.workspace.WorkContext;
|
||
|
|
||
|
import java.util.Properties;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
|
||
|
/**
|
||
|
* Designer
|
||
|
*
|
||
|
* @author Destiny.Lin
|
||
|
* @since 11.0
|
||
|
* Created on 2024/5/14
|
||
|
*/
|
||
|
public class CarinaDesigner extends MainDesigner{
|
||
|
|
||
|
public CarinaDesigner(String[] args) {
|
||
|
super(args);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* main
|
||
|
*/
|
||
|
public static void main(String[] args) {
|
||
|
|
||
|
DesignerStartupContext.getRecorder().start();
|
||
|
PartitionManager manager = new PartitionManagerImpl();
|
||
|
CarinaApplicationContext carinaApplicationContext = new DesignContext(new EmptyServletContext(), manager, new Properties());
|
||
|
Carina.setApplicationContext(carinaApplicationContext);
|
||
|
Carina.setPartitionManager(manager);
|
||
|
DesignLauncher.setContext(carinaApplicationContext);
|
||
|
DesignerEnvManager.getEnvManager();
|
||
|
|
||
|
startPreload0();
|
||
|
|
||
|
DesignerLifecycleMonitorContext.getMonitor().beforeStart();
|
||
|
//启动运行时
|
||
|
FineRuntime.start();
|
||
|
//等 FineRuntime 启动后启动
|
||
|
DeepLinkManager.getInstance().start(args);
|
||
|
|
||
|
startPreload1();
|
||
|
|
||
|
DesignerSubListener.getInstance().start();
|
||
|
EventDispatcher.listen(LifecycleErrorEvent.SELF, new Listener<FineLifecycleFatalError>() {
|
||
|
@Override
|
||
|
public void on(Event event, FineLifecycleFatalError param) {
|
||
|
LifecycleFatalErrorHandler.getInstance().handle(param);
|
||
|
}
|
||
|
});
|
||
|
DesignLauncher launch = new DesignLauncher("/com/fr/config/starter/designer-startup-carina.xml");
|
||
|
try {
|
||
|
FineLoggerFactory.getLogger().debug("Designer prepared.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
|
||
|
Carina.getApplicationContext().singleton(StartupArgsShell.class).set(new StartupArgs(args));
|
||
|
launch.launch();
|
||
|
} catch (Exception e) {
|
||
|
throw new RuntimeException(e);
|
||
|
}
|
||
|
|
||
|
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
|
||
|
|
||
|
SwitchForSwingChecker.initThreadMonitoring();
|
||
|
}
|
||
|
|
||
|
}
|