From 4832989d75ac75bb8896ad4542e4a60f3e6cc053 Mon Sep 17 00:00:00 2001 From: "Destiny.Lin" Date: Fri, 12 Jul 2024 18:16:08 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-19047=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E8=AE=BE=E8=AE=A1=E9=80=82=E9=85=8D=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=BF=9E=E6=8E=A5=E9=85=8D=E7=BD=AE=E8=AF=BB=E5=86=99?= =?UTF-8?q?=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datapane/connect/ConnectionListPane.java | 5 +++-- .../fanruan/boot/env/DesignEnvComponent.java | 5 +++++ .../env/function/DesignDatasourceComponent.java | 17 +++++++++++++++++ .../boot/init/DesignWorkContextComponent.java | 5 ++--- 4 files changed, 27 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java index 18e0ff14f1..fd10c25fdf 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListPane.java @@ -1,6 +1,7 @@ package com.fr.design.data.datapane.connect; import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; +import com.fanruan.config.impl.data.ConnectionConfigWriterFactory; import com.fr.config.remote.RemoteConfigEvent; import com.fr.data.driver.DriverClassNotFoundException; import com.fr.data.impl.Connection; @@ -352,11 +353,11 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh private boolean saveByOldWay(List removedConnNames, List addedOrUpdatedConnections) { final int remaining = ConnectionConfigProviderFactory.getConfigProvider().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size()); try { - removedConnNames.forEach(n -> ConnectionConfigProviderFactory.getConfigProvider().removeConnection(n)); + removedConnNames.forEach(n -> ConnectionConfigWriterFactory.getConfigWriter().removeConnection(n)); int innerRemaining = remaining; for (ConnectionBean cb : addedOrUpdatedConnections) { if (innerRemaining > 0) { - ConnectionConfigProviderFactory.getConfigProvider().addConnectionWithoutCheck(cb.getName(), cb.getConnection()); + ConnectionConfigWriterFactory.getConfigWriter().addConnectionWithoutCheck(cb.getName(), cb.getConnection()); innerRemaining--; } else { break; diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java index 7eac572bb0..fcb50ecb49 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/DesignEnvComponent.java @@ -45,6 +45,11 @@ import com.fr.config.dao.impl.remote.RemoteXmlEntityDao; import com.fr.config.impl.ConfConfigProviderImpl; import com.fr.config.impl.ConfigInsecurityElementProviderImpl; import com.fr.decision.service.context.ServiceContext; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionPluginProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDYConnectionProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JNDIConnectionProcessor; import com.fr.design.backup.EnvBackupHelper; import com.fr.env.detect.EnvDetectorCenter; import com.fr.event.EventDispatcher; diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java index ba9d63055a..c6f277535d 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignDatasourceComponent.java @@ -1,11 +1,21 @@ package com.fanruan.boot.env.function; import com.fanruan.boot.DatasourceComponent; +import com.fanruan.carina.Carina; import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Supplemental; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; +import com.fanruan.config.impl.data.ConnectionConfigWriter; +import com.fanruan.config.impl.data.ConnectionConfigWriterFactory; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionPluginProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.ConnectionProcessorFactory; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDBCConnectionProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JDYConnectionProcessor; +import com.fr.decision.webservice.v10.datasource.connection.processor.impl.JNDIConnectionProcessor; +import com.fr.workspace.server.repository.connection.ConnectionWriterShell; /** @@ -25,6 +35,11 @@ public class DesignDatasourceComponent extends DatasourceComponent { @Supplemental public void prepare() { super.prepare(); + // 注册数据连接处理器 + ConnectionProcessorFactory.register(JDBCConnectionProcessor.KEY); + ConnectionProcessorFactory.register(JNDIConnectionProcessor.KEY); + ConnectionProcessorFactory.register(ConnectionPluginProcessor.KEY); + ConnectionProcessorFactory.register(JDYConnectionProcessor.KEY); } /** @@ -33,6 +48,8 @@ public class DesignDatasourceComponent extends DatasourceComponent { @Start public void start() { super.start(); + ConnectionConfigWriterFactory.registerConnectionConfigWriter((ConnectionConfigWriter) ConnectionConfigProviderFactory.getConfigProvider()); + Carina.getApplicationContext().singleton(ConnectionWriterShell.class).set(ConnectionConfigWriterFactory.getConfigWriter()); } /** diff --git a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java index e80a294a19..8049690aec 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/init/DesignWorkContextComponent.java @@ -23,7 +23,6 @@ import com.fr.env.operator.CommonOperatorImpl; import com.fr.esd.core.remote.ESDConfigEventOperator; import com.fr.esd.core.remote.ESDConfigEventOperatorImpl; import com.fr.file.ConnectionOperator; -import com.fr.file.ConnectionOperatorImpl; import com.fr.file.TableDataOperator; import com.fr.file.TableDataOperatorImpl; import com.fr.file.filetree.FileNodes; @@ -48,6 +47,7 @@ import com.fr.workspace.pool.WorkRPCRegister; import com.fr.workspace.pool.WorkRPCType; import com.fr.workspace.resource.WorkResource; import com.fr.workspace.server.repository.authority.RemoteAuthorityRepository; +import com.fr.workspace.server.repository.compatible.CompatibleConnectionOperator; import com.fr.workspace.server.repository.compatible.register.CompatibleRegister; import com.fanruan.workplace.network.RemoteNetworkRepository; import com.fr.workspace.server.repository.connection.ConnectionRepository; @@ -145,10 +145,9 @@ public class DesignWorkContextComponent { WorkRPCRegister.wrap(DataOperatorProvider.class, new DataOperator()), WorkRPCRegister.wrap(ESDConfigEventOperator.class, new ESDConfigEventOperatorImpl()), WorkRPCRegister.wrap(WorkRPCType.Compatible, TableDataOperator.class, TableDataOperatorImpl.getInstance()), - WorkRPCRegister.wrap(WorkRPCType.Compatible, ConnectionOperator.class, ConnectionOperatorImpl.getInstance()), WorkRPCRegister.wrap(FileAssistUtilsOperator.class, new FileAssistUtils()), WorkRPCRegister.wrap(TableDataOperator.class, TableDataOperatorImpl.getInstance()), - WorkRPCRegister.wrap(ConnectionOperator.class, ConnectionOperatorImpl.getInstance()), + WorkRPCRegister.wrap(ConnectionOperator.class, CompatibleConnectionOperator.getInstance()), WorkRPCRegister.wrap(BuildInfoOperator.class, new BuildInfoOperatorImpl()) ); }