Browse Source

REPORT-114392-远程设计fbp能够正常使用 完善代码

mss/2.0
Destiny.Lin 4 months ago
parent
commit
d761b74dc8
  1. 6
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java
  2. 2
      designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java
  3. 2
      designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java

6
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvChooseComponent.java vendored

@ -104,7 +104,7 @@ import org.jetbrains.annotations.NotNull;
*/ */
@FineComponent(name = "design_env_choose") @FineComponent(name = "design_env_choose")
public class DesignEnvChooseComponent extends ResourceAffiliate { public class DesignEnvChooseComponent extends ResourceAffiliate {
private Listener<Workspace> beforeSwitch4Min = new Listener<Workspace>(Integer.MIN_VALUE) { private Listener<Workspace> afterSwitch4Max = new Listener<Workspace>(Integer.MAX_VALUE) {
@Override @Override
public void on(Event event, Workspace current) { public void on(Event event, Workspace current) {
@ -147,8 +147,8 @@ public class DesignEnvChooseComponent extends ResourceAffiliate {
@Start @Start
public void start() { public void start() {
registerEnvListener();
startEnvChoose(); startEnvChoose();
registerEnvListener();
afterAllStart(); afterAllStart();
} }
@ -217,7 +217,7 @@ public class DesignEnvChooseComponent extends ResourceAffiliate {
private void registerEnvListener() { private void registerEnvListener() {
/*切换环境前,重启所有相关模块,最后执行*/ /*切换环境前,重启所有相关模块,最后执行*/
listenEvent(WorkspaceEvent.BeforeSwitch, beforeSwitch4Min); listenEvent(WorkspaceEvent.AfterSwitch, afterSwitch4Max);
/*切换环境前,存储一下打开的所有文件对象,要先于 关闭相关模块部分 被触发*/ /*切换环境前,存储一下打开的所有文件对象,要先于 关闭相关模块部分 被触发*/
listenEvent(WorkspaceEvent.BeforeSwitch, beforeSwitch4Max); listenEvent(WorkspaceEvent.BeforeSwitch, beforeSwitch4Max);

2
designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java vendored

@ -169,6 +169,7 @@ public class DesignEnvComponent {
} }
private void startScheduler() { private void startScheduler() {
if (WorkContext.getCurrent().isLocal()) {
TenantContext.doIsolatedWork(() -> { TenantContext.doIsolatedWork(() -> {
ClusterLock lock = ClusterBridge.getLockFactory().get(SchedulerCoreComponent.class); ClusterLock lock = ClusterBridge.getLockFactory().get(SchedulerCoreComponent.class);
// 多节点同时启动quartz模块可能会产生脏数据,导致报错,使用集群锁控制一下 // 多节点同时启动quartz模块可能会产生脏数据,导致报错,使用集群锁控制一下
@ -200,6 +201,7 @@ public class DesignEnvComponent {
} }
}, "default"); }, "default");
} }
}
@Stop @Stop

2
designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java

@ -50,6 +50,7 @@ import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository;
import com.fr.workspace.server.repository.compatible.CompatibleConnectionOperator; import com.fr.workspace.server.repository.compatible.CompatibleConnectionOperator;
import com.fr.workspace.server.repository.compatible.register.CompatibleRegister; import com.fr.workspace.server.repository.compatible.register.CompatibleRegister;
import com.fanruan.workplace.network.RemoteNetworkRepository; import com.fanruan.workplace.network.RemoteNetworkRepository;
import com.fr.workspace.server.repository.config.ConfigRepository;
import com.fr.workspace.server.repository.connection.ConnectionRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository;
import com.fr.workspace.server.repository.resource.PublicResourceRepository; import com.fr.workspace.server.repository.resource.PublicResourceRepository;
import com.fr.workspace.server.repository.resource.WorkResourceRepository; import com.fr.workspace.server.repository.resource.WorkResourceRepository;
@ -98,6 +99,7 @@ public class DesignWorkContextComponent {
RepositoryManager.getInstance().pureRegisterRepo4Start(ShareRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(ShareRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(WorkResourceRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(WorkResourceRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(PublicResourceRepository.getInstance()); RepositoryManager.getInstance().pureRegisterRepo4Start(PublicResourceRepository.getInstance());
RepositoryManager.getInstance().pureRegisterRepo4Start(ConfigRepository.getInstance());
RepositoryManager.getInstance().initLocalRepository(); RepositoryManager.getInstance().initLocalRepository();
CompatibleRegister.registerCompatibleEnv(); CompatibleRegister.registerCompatibleEnv();
for (WorkRPCRegister<?> workRPCRegister : ServiceContext.group(WorkspaceKey.class).getAll()) { for (WorkRPCRegister<?> workRPCRegister : ServiceContext.group(WorkspaceKey.class).getAll()) {

Loading…
Cancel
Save