|
|
|
@ -18,6 +18,7 @@ import com.fr.event.EventDispatcher;
|
|
|
|
|
import com.fr.event.Listener; |
|
|
|
|
import com.fr.event.Null; |
|
|
|
|
import com.fr.start.server.EmbedServerEvent; |
|
|
|
|
import com.fr.task.Once; |
|
|
|
|
import com.fr.update.delay.DelayHelper; |
|
|
|
|
import com.fr.workspace.Workspace; |
|
|
|
|
import com.fr.workspace.WorkspaceEvent; |
|
|
|
@ -72,6 +73,14 @@ public class EnvDetectorCenter {
|
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
private final Once launchOnce = new Once(() -> { |
|
|
|
|
|
|
|
|
|
// 添加启动完成监听
|
|
|
|
|
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, START_UP_COMPLETE_LISTENER); |
|
|
|
|
// 切换完成后的监听
|
|
|
|
|
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, AFTER_SWITCH_LISTENER); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
private final AtomicReference<DetectorProcess> PROCESS = new AtomicReference<>(); |
|
|
|
|
|
|
|
|
|
public static EnvDetectorCenter getInstance() { |
|
|
|
@ -96,6 +105,7 @@ public class EnvDetectorCenter {
|
|
|
|
|
// 默认是启动
|
|
|
|
|
PROCESS.set(DetectorProcess.DESIGN_LAUNCH); |
|
|
|
|
|
|
|
|
|
launchOnce.run(); |
|
|
|
|
listen(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -189,12 +199,6 @@ public class EnvDetectorCenter {
|
|
|
|
|
|
|
|
|
|
private void listen() { |
|
|
|
|
|
|
|
|
|
// 添加启动完成监听
|
|
|
|
|
EventDispatcher.listen(DesignerLaunchStatus.STARTUP_COMPLETE, START_UP_COMPLETE_LISTENER); |
|
|
|
|
|
|
|
|
|
// 切换完成后的监听
|
|
|
|
|
EventDispatcher.listen(WorkspaceEvent.AfterSwitch, AFTER_SWITCH_LISTENER); |
|
|
|
|
|
|
|
|
|
// 内置服务器监听
|
|
|
|
|
EventDispatcher.listen(EmbedServerEvent.BeforeStart, BEFORE_START_LISTENER); |
|
|
|
|
EventDispatcher.listen(EmbedServerEvent.AfterStart, AFTER_START_LISTENER); |
|
|
|
@ -202,8 +206,6 @@ public class EnvDetectorCenter {
|
|
|
|
|
|
|
|
|
|
private void stopListen() { |
|
|
|
|
|
|
|
|
|
EventDispatcher.stopListen(START_UP_COMPLETE_LISTENER); |
|
|
|
|
EventDispatcher.stopListen(AFTER_SWITCH_LISTENER); |
|
|
|
|
EventDispatcher.stopListen(BEFORE_START_LISTENER); |
|
|
|
|
EventDispatcher.stopListen(AFTER_START_LISTENER); |
|
|
|
|
} |
|
|
|
|