diff --git a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java index 4742f337cd..3f09eadac4 100644 --- a/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java +++ b/designer-base/src/main/java/com/fr/design/actions/server/ConnectionListAction.java @@ -1,25 +1,19 @@ package com.fr.design.actions.server; -import com.fr.data.impl.Connection; import com.fr.design.actions.UpdateAction; -import com.fr.design.data.datapane.connect.ConnectionShowPane; import com.fr.design.data.datapane.connect.DatabaseConnectionPane; -import com.fr.design.dialog.BasicDialog; import com.fr.design.editlock.ConnectionLockChangeChecker; import com.fr.design.editlock.EditLockUtils; -import com.fr.design.gui.NameInspector; import com.fr.design.gui.imenu.UILockMenuItem; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.menu.MenuKeySet; import com.fr.stable.os.support.OSBasedAction; import com.fr.stable.os.support.OSSupportCenter; import com.fr.design.os.impl.DatabaseDialogAction; -import com.fr.file.ConnectionConfig; import com.fr.report.LockItem; import javax.swing.KeyStroke; import java.awt.event.ActionEvent; -import java.util.Map; /** * DatasourceList Action @@ -69,41 +63,6 @@ public class ConnectionListAction extends UpdateAction { } } - /** - * 更新datasourceManager - * - * @param datasourceManager datasource管理对象 - * @param connectionShowPane datasource面板 - * @param databaseListDialog datasource管理对话框 - * @return boolean 是否更新成功 - */ - public static boolean doWithDatasourceManager(ConnectionConfig datasourceManager, ConnectionShowPane connectionShowPane, BasicDialog databaseListDialog) { - boolean isFailed = false; - //存在请重命名则不能更新 - int index = isConnectionMapContainsRename(datasourceManager); - if (index != -1) { - isFailed = true; - connectionShowPane.setSelectedIndex(index); - } - databaseListDialog.setDoOKSucceed(!isFailed); - - return !isFailed; - } - - - /** - * 是否包含重命名key - * - * @return 包含则返回序列 ,若返回-1则说明不包含重命名key - */ - public static int isConnectionMapContainsRename(ConnectionConfig datasourceManager) { - Map tableDataMap = datasourceManager.getConnections(); - if (tableDataMap.containsKey(NameInspector.ILLEGAL_NAME_HOLDER)) { - return datasourceManager.getConnectionIndex(NameInspector.ILLEGAL_NAME_HOLDER); - } - return -1; - } - public void update() { this.setEnabled(true); diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java index 99a294fdde..dc819c558b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/ChoosePane.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.TableData; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.DBUtils; @@ -32,7 +33,6 @@ import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.file.ConnectionConfig; import com.fr.general.ComparatorUtils; import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; @@ -324,11 +324,10 @@ public class ChoosePane extends BasicBeanPane implements Refresha if (StringUtils.isEmpty(selectedDSName)) { return null; // peter:选中了当前的零长度的节点,直接返回. } - ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); List authConnections = getHasAuthConnections(); for (String name : authConnections) { if (ComparatorUtils.equals(selectedDSName, name)) { - return connectionConfig.getConnection(name); + return ConnectionConfigProviderFactory.getConfigProvider().getConnection(name); } } return null; @@ -336,7 +335,7 @@ public class ChoosePane extends BasicBeanPane implements Refresha private List getHasAuthConnections() { List authConnections = new ArrayList<>(); - Set allConnections = ConnectionConfig.getInstance().getConnections().keySet(); + Set allConnections = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet(); Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); if (noAuthConnections == null) { return authConnections; diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java index 76f32d6f0c..a3c12c890b 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionComboBoxPanel.java @@ -1,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.svg.IconUtils; import com.fr.data.impl.AbstractDatabaseConnection; import com.fr.data.impl.Connection; @@ -9,7 +10,6 @@ import com.fr.design.editlock.ConnectionLockChangeChecker; import com.fr.design.editlock.EditLockUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UILockButton; -import com.fr.file.ConnectionConfig; import com.fr.report.LockItem; import com.fr.stable.StringUtils; import com.fr.workspace.WorkContext; @@ -79,8 +79,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { * 刷新ComboBox.items */ protected Iterator items() { - ConnectionConfig mgr = ConnectionConfig.getInstance(); - Iterator nameIt = mgr.getConnections().keySet().iterator(); + Iterator nameIt = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet().iterator(); Collection noAuthConnections = WorkContext.getCurrent().get(DBConnectAuth.class).getNoAuthConnections(); @@ -94,7 +93,7 @@ public class ConnectionComboBoxPanel extends ItemEditableComboBoxPanel { if (noAuthConnections.contains(conName)) { continue; } - Connection connection = mgr.getConnection(conName); + Connection connection = ConnectionConfigProviderFactory.getConfigProvider().getConnection(conName); // nameList依赖items方法初始化,父类ItemEditableComboBoxPanel里异步执行item方法 filterConnection(connection, conName, nameList); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java index 947cb6e75f..7ced09baaf 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionListDialogActionAdapter.java @@ -1,15 +1,16 @@ package com.fr.design.data.datapane.connect; +import com.fr.data.impl.Connection; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.editlock.EditLockUtils; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; -import com.fr.file.ConnectionConfig; import com.fr.report.LockItem; import javax.swing.JOptionPane; +import java.util.Map; /** * @author hades @@ -20,14 +21,14 @@ public class ConnectionListDialogActionAdapter extends DialogActionAdapter { private final ConnectionManagerPane connectionManagerPane; private final BasicDialog connectionListDialog; - private final ConnectionConfig connectionConfig; + private final Map connectionMap; public ConnectionListDialogActionAdapter(ConnectionManagerPane connectionManagerPane, BasicDialog connectionListDialog, - ConnectionConfig connectionConfig) { + Map connectionMap) { this.connectionManagerPane = connectionManagerPane; this.connectionListDialog = connectionListDialog; - this.connectionConfig = connectionConfig; + this.connectionMap = connectionMap; } @Override @@ -37,7 +38,7 @@ public class ConnectionListDialogActionAdapter extends DialogActionAdapter { return; } try { - connectionManagerPane.update(connectionConfig); + connectionManagerPane.update(connectionMap); } catch (Exception e) { connectionListDialog.setDoOKSucceed(false); FineJOptionPane.showMessageDialog(connectionManagerPane, e.getMessage(), Toolkit.i18nText("Fine-Design_Basic_Error"), JOptionPane.ERROR_MESSAGE); 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 6156f7b43f..9c173a363c 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,5 +1,6 @@ package com.fr.design.data.datapane.connect; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.config.remote.RemoteConfigEvent; import com.fr.data.driver.DriverClassNotFoundException; import com.fr.data.impl.Connection; @@ -18,7 +19,6 @@ import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.ilist.ListModelElement; import com.fr.design.i18n.Toolkit; import com.fr.event.EventDispatcher; -import com.fr.file.ConnectionConfig; import com.fr.file.ConnectionOperator; import com.fr.general.NameObject; import com.fr.license.database.DBTypes; @@ -29,8 +29,6 @@ import com.fr.stable.ArrayUtils; import com.fr.stable.Nameable; import com.fr.stable.StringUtils; import com.fr.stable.core.PropertyChangeAdapter; -import com.fr.transaction.Configurations; -import com.fr.transaction.WorkerFacade; import com.fr.workspace.WorkContext; import com.fr.workspace.server.database.DataBaseTypeOperator; import org.jetbrains.annotations.NotNull; @@ -191,15 +189,12 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh return TITLE_NAME; } - /** - * Populate. - * - * @param connectionConfig the new datasourceManager. - */ - public void populate(ConnectionConfig connectionConfig) { + + //todo config invalidate + public void populate(Map connectionMap) { List nameObjectList = new ArrayList(); populatedConnectionsSnapshot.clear(); - for (Map.Entry entry : connectionConfig.getConnections().entrySet()) { + for (Map.Entry entry : ConnectionConfigProviderFactory.getConfigProvider().getConnections().entrySet()) { nameObjectList.add(new NameObject(entry.getKey(), entry.getValue())); try { populatedConnectionsSnapshot.put(entry.getKey(), (Connection) entry.getValue().clone()); @@ -213,7 +208,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh /** * Update. */ - public void update(ConnectionConfig connectionConfig) throws Exception { + public void update(Map connectionMap) throws Exception { // Nameable[]居然不能强转成NameObject[],一定要这么写... Nameable[] res = this.update(); Map updatedMap = new LinkedHashMap<>(); @@ -337,7 +332,7 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh // hades:远程环境时,由于时直接RPC调用远程修改,因此设计器本地配置需要失效 if (!WorkContext.getCurrent().isLocal()) { - EventDispatcher.fire(RemoteConfigEvent.EDIT, ConnectionConfig.getInstance().getNameSpace()); + EventDispatcher.fire(RemoteConfigEvent.EDIT, "ConnectionConfig"); } } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); @@ -345,41 +340,35 @@ public class ConnectionListPane extends JListControlPane implements ConnectionSh } private boolean saveByOldWay(List removedConnNames, List addedOrUpdatedConnections) { - final int remaining = ConnectionConfig.getInstance().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size()); + final int remaining = ConnectionConfigProviderFactory.getConfigProvider().getRemainingCon(removedConnNames.size(), addedOrUpdatedConnections.size()); try { - return Configurations.modify(new WorkerFacade(ConnectionConfig.class) { - @Override - public void run() { - removedConnNames.forEach(n -> ConnectionConfig.getInstance().removeConnection(n)); - int innerRemaining = remaining; - for (ConnectionBean cb : addedOrUpdatedConnections) { - if (innerRemaining > 0) { - ConnectionConfig.getInstance().addConnectionWithoutCheck(cb.getName(), cb.getConnection()); - innerRemaining--; - } else { - break; - } - } + removedConnNames.forEach(n -> ConnectionConfigProviderFactory.getConfigProvider().removeConnection(n)); + int innerRemaining = remaining; + for (ConnectionBean cb : addedOrUpdatedConnections) { + if (innerRemaining > 0) { + ConnectionConfigProviderFactory.getConfigProvider().addConnectionWithoutCheck(cb.getName(), cb.getConnection()); + innerRemaining--; + } else { + break; } - }); + } + return true; } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage(), e); } - return false; } public static void showDialog(Window parent) { - final ConnectionConfig connectionConfig = ConnectionConfig.getInstance(); + Map connectionMap = ConnectionConfigProviderFactory.getConfigProvider().getConnections(); final ConnectionManagerPane connectionManagerPane = new ConnectionManagerPane() { @Override public void complete() { - ConnectionConfig cloned = connectionConfig.mirror(); - populate(cloned); + populate(connectionMap); } }; final BasicDialog connectionListDialog = connectionManagerPane.showLargeWindow(parent, null); - connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionConfig)); + connectionListDialog.addDialogActionListener(new ConnectionListDialogActionAdapter(connectionManagerPane, connectionListDialog, connectionMap)); connectionListDialog.setVisible(true); } diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java index eadf456e09..10d4da6dd9 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionManagerPane.java @@ -1,12 +1,13 @@ package com.fr.design.data.datapane.connect; +import com.fr.data.impl.Connection; import com.fr.design.gui.frpane.LoadingBasicPane; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.file.ConnectionConfig; import javax.swing.JPanel; import java.awt.BorderLayout; import java.util.HashMap; +import java.util.Map; public class ConnectionManagerPane extends LoadingBasicPane implements ConnectionShowPane { @@ -32,14 +33,14 @@ public class ConnectionManagerPane extends LoadingBasicPane implements Connectio return connectionListPane.getRenameMap(); } - public void populate(ConnectionConfig datasourceManager) { + public void populate(Map connectionMap) { // this.connectionTextField.setText(WorkContext.getCurrent().getPath() + File.separator + ProjectConstants.RESOURCES_NAME // + File.separator + datasourceManager.fileName()); - this.connectionListPane.populate(datasourceManager); + this.connectionListPane.populate(connectionMap); } - public void update(ConnectionConfig datasourceManager) throws Exception { - this.connectionListPane.update(datasourceManager); + public void update(Map connectionMap) throws Exception { + this.connectionListPane.update(connectionMap); } /** diff --git a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java index 2b74ddcf9e..bf9b7e7ddb 100644 --- a/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java +++ b/designer-base/src/main/java/com/fr/design/data/datapane/connect/ConnectionShowPane.java @@ -1,15 +1,17 @@ package com.fr.design.data.datapane.connect; -import com.fr.file.ConnectionConfig; +import com.fr.data.impl.Connection; + +import java.util.Map; /** * Created by yaoh.wu on 2017/4/22. * 数据链接显示面板 */ public interface ConnectionShowPane { - void update(ConnectionConfig connectionConfig) throws Exception; + void update(Map connectionMap) throws Exception; - void populate(ConnectionConfig connectionConfig); + void populate(Map connectionMap); void setSelectedIndex(int index); } diff --git a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java index ad07f9b6fb..f52315372d 100644 --- a/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java +++ b/designer-base/src/main/java/com/fr/design/data/tabledata/tabledatapane/ProcedureDataPane.java @@ -1,5 +1,6 @@ package com.fr.design.data.tabledata.tabledatapane; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.BaseUtils; import com.fr.base.StoreProcedureParameter; import com.fr.data.core.db.TableProcedure; @@ -31,7 +32,6 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.menu.SeparatorDef; import com.fr.design.menu.ToolBarDef; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.file.ConnectionConfig; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -174,7 +174,7 @@ public class ProcedureDataPane extends AbstractTableDataPane imp } private boolean isAutoParameterDatabase() { - Connection connection = ConnectionConfig.getInstance().getConnection(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()); + Connection connection = ConnectionConfigProviderFactory.getConfigProvider().getConnection(connectionTableProcedurePane.getSelectedDatabaseConnnectonName()); return connection == null ? false : ArrayUtils.contains(DRIVERS, connection.getDriver()); } diff --git a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java index ba29288fc8..ab5c67678e 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java +++ b/designer-base/src/main/java/com/fr/design/gui/ilist/TableViewList.java @@ -1,5 +1,6 @@ package com.fr.design.gui.ilist; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.BaseUtils; import com.fr.data.core.DataCoreUtils; import com.fr.data.core.db.TableProcedure; @@ -10,7 +11,6 @@ import com.fr.data.operator.DataOperator; import com.fr.design.DesignerEnvManager; import com.fr.design.constants.UIConstants; import com.fr.design.mainframe.dnd.SerializableTransferable; -import com.fr.file.ConnectionConfig; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.stable.ArrayUtils; @@ -95,7 +95,7 @@ public class TableViewList extends UIList { @Override protected DefaultListModel doInBackground() throws Exception { - Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName); + Connection datasource = ConnectionConfigProviderFactory.getConfigProvider().getConnection(databaseName); boolean status = false; int count = 3; //总共给3次连接的机会 @@ -154,7 +154,7 @@ public class TableViewList extends UIList { */ private DefaultListModel processDataInAnotherThread(String databaseName, String searchFilter, String... typesFilter) throws Exception { DefaultListModel defaultListModel = new DefaultListModel(); - Connection datasource = ConnectionConfig.getInstance().getConnection(databaseName); + Connection datasource = ConnectionConfigProviderFactory.getConfigProvider().getConnection(databaseName); if (datasource == null) { return defaultListModel; } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java b/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java index b33f0665c9..1e69d68540 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/authority/JTemplateAuthorityChecker.java @@ -1,13 +1,13 @@ package com.fr.design.mainframe.authority; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.CloneCollector; import com.fr.design.dialog.FineJOptionPane; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.JTemplate; -import com.fr.file.ConnectionConfig; import com.fr.file.TableDataConfig; import com.fr.log.FineLoggerFactory; @@ -51,7 +51,7 @@ public class JTemplateAuthorityChecker { allDatasetNames.add(authServerDataSetName); } - allConnectionNames = ConnectionConfig.getInstance().getConnections().keySet(); + allConnectionNames = ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet(); UserAuthority templateAuthority = WorkContext.getCurrent().get(UserAuthority.class); Map> authNamesMap = templateAuthority.getAuthServerDataSetAndConnectionNames(); diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java index 676bfba9cb..859f418499 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/SettingController.java @@ -1,6 +1,7 @@ package com.fr.design.actions.replace.action.setting; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.data.TableDataSource; import com.fr.design.actions.replace.action.ShowValue; import com.fr.design.actions.replace.action.setting.action.SearchCellDSColumnAction; @@ -15,7 +16,6 @@ import com.fr.design.actions.replace.ui.ITReplaceNorthPanel; import com.fr.design.data.DesignTableDataManager; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.mainframe.JTemplate; -import com.fr.file.ConnectionConfig; import com.fr.general.data.TableDataColumn; import com.fr.report.cell.CellElement; import com.fr.report.cell.cellattr.core.group.DSColumn; @@ -266,7 +266,7 @@ public enum SettingController implements ShowValue { @Override public List getItems() { List nameList = new ArrayList<>(); - for (String name : ConnectionConfig.getInstance().getConnections().keySet()) { + for (String name : ConnectionConfigProviderFactory.getConfigProvider().getConnections().keySet()) { nameList.add(name); } return nameList; diff --git a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java index bd69a52365..e2b06fa735 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/replace/action/setting/action/SearchConnectionAction.java @@ -1,5 +1,6 @@ package com.fr.design.actions.replace.action.setting.action; +import com.fanruan.config.impl.data.ConnectionConfigProviderFactory; import com.fr.base.TableData; import com.fr.base.TableDataConnection; import com.fr.data.TableDataSource; @@ -9,7 +10,6 @@ import com.fr.design.actions.replace.action.SearchAction; import com.fr.design.actions.replace.info.DataSourceInfo; import com.fr.design.actions.replace.info.base.ITContent; import com.fr.design.mainframe.JTemplate; -import com.fr.file.ConnectionConfig; import java.util.ArrayList; import java.util.HashMap; @@ -35,7 +35,7 @@ public class SearchConnectionAction implements SearchAction { @Override public void search4Infos(JTemplate jTemplate) { List connectionInfos = new ArrayList<>(); - Map map = ConnectionConfig.getInstance().getConnections(); + Map map = ConnectionConfigProviderFactory.getConfigProvider().getConnections(); Map needMap = new HashMap<>(); TableDataSource source = (TableDataSource) jTemplate.getTarget(); Iterator dataIterator = source.getTableDataNameIterator(); diff --git a/designer-realize/src/main/java/com/fr/start/module/optimized/ConfigurationActivator4Designer.java b/designer-realize/src/main/java/com/fr/start/module/optimized/ConfigurationActivator4Designer.java index ab31113a0f..5a01fed354 100644 --- a/designer-realize/src/main/java/com/fr/start/module/optimized/ConfigurationActivator4Designer.java +++ b/designer-realize/src/main/java/com/fr/start/module/optimized/ConfigurationActivator4Designer.java @@ -6,6 +6,8 @@ import com.fr.config.dao.DaoSelectorFactory; import com.fr.config.dao.impl.remote.PropertiesClassHelperDao; import com.fr.config.dao.impl.remote.PropertiesEntityDao; import com.fr.config.dao.impl.remote.PropertiesXmlEntityDao; +import com.fr.transaction.PropertiesTransactor; +import com.fr.transaction.TransactorFactory; /** * @author hades @@ -17,6 +19,7 @@ public class ConfigurationActivator4Designer extends ConfigurationActivator { @Override protected void initLocalDao() { if (DaoSelectorFactory.getDaoSelector().useCacheDao()) { + TransactorFactory.setTransactor(new PropertiesTransactor()); DaoContext.setClassHelperDao(new PropertiesClassHelperDao()); DaoContext.setEntityDao(new PropertiesEntityDao()); DaoContext.setXmlEntityDao(new PropertiesXmlEntityDao());