|
|
|
package com.fr.start;
|
|
|
|
|
|
|
|
import com.fanruan.LaunchType;
|
|
|
|
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.base.StateHubContext;
|
|
|
|
import com.fr.design.backup.DesignContext;
|
|
|
|
import com.fr.design.carton.SwitchForSwingChecker;
|
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory;
|
|
|
|
|
|
|
|
import com.fr.runtime.FineRuntime;
|
|
|
|
import com.fr.start.common.DesignerStartupContext;
|
|
|
|
import com.fr.start.module.StartupArgs;
|
|
|
|
import com.fr.start.server.ServletContextWrapper;
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
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();
|
|
|
|
StateHubContext.setReady(false);
|
|
|
|
CarinaApplicationContext carinaApplicationContext = new DesignContext(new ServletContextWrapper(), manager, new Properties());
|
|
|
|
Carina.setApplicationContext(carinaApplicationContext);
|
|
|
|
Carina.setPartitionManager(manager);
|
|
|
|
DesignLauncher.setContext(carinaApplicationContext);
|
|
|
|
Carina.getApplicationContext().singleton(StartupArgsShell.class).set(new StartupArgs(args));
|
|
|
|
FineLoggerFactory.getLogger().info("start args : {} ", Arrays.toString(args));
|
|
|
|
Carina.getApplicationContext().singleton(LaunchType.class).set(LaunchType.DESIGNER);
|
|
|
|
DesignLauncher launch = new DesignLauncher("/com/fr/config/starter/designer-startup-carina.xml");
|
|
|
|
FineRuntime.start();
|
|
|
|
try {
|
|
|
|
FineLoggerFactory.getLogger().debug("Designer prepared.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
|
|
|
|
|
|
|
|
launch.launch();
|
|
|
|
} catch (Exception e) {
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().info("Designer started.Time used {} ms", DesignerStartupContext.getRecorder().getTime(TimeUnit.MILLISECONDS));
|
|
|
|
|
|
|
|
SwitchForSwingChecker.initThreadMonitoring();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|