|
|
|
@ -3,7 +3,11 @@ package com.fr.start.module.optimized;
|
|
|
|
|
import com.fr.module.Activator; |
|
|
|
|
import com.fr.module.ModuleContext; |
|
|
|
|
import com.fr.plugin.PluginActivator; |
|
|
|
|
import com.fr.plugin.manage.PluginManager; |
|
|
|
|
import com.fr.start.common.DesignerStartupExecutor; |
|
|
|
|
import com.fr.workspace.WorkContext; |
|
|
|
|
import com.fr.workspace.WorkspaceSwitchHelper; |
|
|
|
|
import com.fr.workspace.WorkspaceSwitchProcess; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* created by Harrison on 2022/06/22 |
|
|
|
@ -12,13 +16,21 @@ public class DesignerPluginActivator extends Activator {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void start() { |
|
|
|
|
|
|
|
|
|
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start()); |
|
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess(); |
|
|
|
|
if (WorkspaceSwitchHelper.supportHotSwitch(process)) { |
|
|
|
|
PluginManager.getHotModule().start(); |
|
|
|
|
} else { |
|
|
|
|
DesignerStartupExecutor.getInstance().execute(() -> ModuleContext.getModule(PluginActivator.class).start()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void stop() { |
|
|
|
|
|
|
|
|
|
ModuleContext.getModule(PluginActivator.class).stop(); |
|
|
|
|
WorkspaceSwitchProcess process = WorkContext.getSwitcher().getProcess(); |
|
|
|
|
if (WorkspaceSwitchHelper.supportHotSwitch(process)) { |
|
|
|
|
PluginManager.getHotModule().stop(); |
|
|
|
|
} else { |
|
|
|
|
ModuleContext.getModule(PluginActivator.class).stop(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|