Browse Source

feature: REPORT-106900【远程设计性能】远程设计协议重构

- 处理 CommonOperator
- 处理残留的 DataOperator
new-design
Harrison 11 months ago
parent
commit
66731ab5ad
  1. 8
      designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java
  2. 7
      designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java
  3. 4
      designer-realize/src/main/java/com/fr/design/mainframe/app/PluginRemote.java

8
designer-base/src/main/java/com/fr/design/data/datapane/connect/DatabaseConnectionPane.java

@ -7,7 +7,6 @@ import com.fr.data.driver.util.JarFileParseUtil;
import com.fr.data.impl.Connection;
import com.fr.data.impl.JDBCDatabaseConnection;
import com.fr.data.impl.JNDIDatabaseConnection;
import com.fr.data.operator.DataOperatorProvider;
import com.fr.data.security.ssl.impl.NormalSsl;
import com.fr.data.solution.ExceptionSolutionSelector;
import com.fr.data.solution.entity.DriverPage;
@ -22,6 +21,7 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.file.ConnectionService;
import com.fr.log.FineLoggerFactory;
import com.fr.rpc.ExceptionHandler;
import com.fr.rpc.RPCInvokerExceptionInfo;
@ -429,14 +429,14 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
// 返回连接结果
DriverPage.updateCache();
final Exception[] exception = new Exception[1];
WorkContext.getCurrent().get(DataOperatorProvider.class, new ExceptionHandler() {
WorkContext.getCurrent().get(ConnectionService.class, new ExceptionHandler() {
@Override
public Object callHandler(RPCInvokerExceptionInfo exceptionInfo) {
// 正常调用发生的异常也会被捕获,因此需要对异常类型进行判断,如果是NoSuchMethodException 就要去调用 testConnection
// 如果不是 NoSuchMethodException 保存下异常上下文
// 两种情况下异常都需要抛出
if (exceptionInfo.getException() instanceof NoSuchMethodException) {
if (!WorkContext.getCurrent().get(DataOperatorProvider.class).testConnection(database)) {
if (!WorkContext.getCurrent().get(ConnectionService.class).test(database)) {
exception[0] = new Exception(Toolkit.i18nText("Fine-Design_Description_Of_Test_Connection"));
}
} else {
@ -444,7 +444,7 @@ public abstract class DatabaseConnectionPane<E extends com.fr.data.impl.Connecti
}
return null;
}
}).testConnectionWithException(database);
}).test(database);
if (exception[0] != null) {
throw exception[0];
}

7
designer-base/src/main/java/com/fr/design/versioncheck/VersionCheckUtils.java

@ -1,6 +1,6 @@
package com.fr.design.versioncheck;
import com.fr.base.FRContext;
import com.fr.base.operator.common.CommonOperator;
import com.fr.design.DesignerEnvManager;
import com.fr.design.dialog.NotificationDialog;
import com.fr.design.dialog.NotificationDialogAction;
@ -39,6 +39,8 @@ import com.fr.workspace.engine.client.utils.FunctionalHttpRequest;
import com.fr.workspace.engine.exception.WorkspaceConnectionException;
import com.fr.workspace.engine.rpc.WorkspaceProxyPool;
import com.fr.workspace.server.check.VersionInfoOperator;
import javax.swing.SwingWorker;
import java.lang.reflect.Method;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
@ -52,7 +54,6 @@ import java.util.Map;
import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import javax.swing.SwingWorker;
/**
* @author pengda
@ -282,7 +283,7 @@ public class VersionCheckUtils {
public static JSONArray checkLocalAndRemotePlugin() {
JSONArray differentPlugins = new JSONArray();
JSONArray remotePlugins = FRContext.getCommonOperator().getPluginStatus();
JSONArray remotePlugins = CommonOperator.Helper.getPluginStatus();
Map<String, PluginContext> localPluginsMap = new HashMap<>();
List<PluginContext> localPlugins = PluginManager.getContexts();
for (PluginContext pluginContext : localPlugins) {

4
designer-realize/src/main/java/com/fr/design/mainframe/app/PluginRemote.java

@ -1,6 +1,6 @@
package com.fr.design.mainframe.app;
import com.fr.base.FRContext;
import com.fr.base.operator.common.CommonOperator;
import com.fr.json.JSONArray;
import com.fr.json.JSONException;
import com.fr.json.JSONObject;
@ -57,7 +57,7 @@ public class PluginRemote {
private Map<String, PluginStatus> getRemoteStatus() {
JSONArray statusArray = FRContext.getCommonOperator().getPluginStatus();
JSONArray statusArray = CommonOperator.Helper.getPluginStatus();
JSONObject status;
String id;
String version;

Loading…
Cancel
Save