From ed61905a68d9dd15f905a5d95d68e08d79c6465d Mon Sep 17 00:00:00 2001 From: ju Date: Tue, 27 Mar 2018 16:59:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=80=81=E7=9A=84=E9=9B=86=E7=BE=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/color/ColorSelectConfigManager.java | 36 ++++--------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java b/designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java index e135b17c6b..c420fe3edd 100644 --- a/designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java +++ b/designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java @@ -1,23 +1,19 @@ package com.fr.design.style.color; -import com.fr.file.XMLFileManager; - - import com.fr.base.FRContext; -import com.fr.cluster.rpc.RPC; -import com.fr.file.BaseClusterHelper; +import com.fr.file.XMLFileManager; import com.fr.general.ComparatorUtils; +import com.fr.general.FRLogger; import com.fr.general.GeneralContext; import com.fr.stable.EnvChangedListener; import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLableReader; -import com.fr.general.FRLogger; -import java.awt.Color; +import java.awt.*; +import java.io.InputStream; import java.util.ArrayList; import java.util.List; -import java.io.InputStream; /** * 最近使用颜色 @@ -130,31 +126,13 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel */ public synchronized static ColorSelectConfigManagerProvider getProviderInstance() { if (configManager == null) { - if (isClusterMember()) { - return configManager; - } + configManager = new ColorSelectConfigManager(); configManager.readXMLFile(); } return configManager; } - - private synchronized static boolean isClusterMember() { - switch (BaseClusterHelper.getClusterState()) { - case LEADER: - configManager = new ColorSelectConfigManager(); - RPC.registerSkeleton(configManager); - return false; - case MEMBER: - String ip = BaseClusterHelper.getMainServiceIP(); - configManager = (ColorSelectConfigManagerProvider) RPC.getProxy(ColorSelectConfigManager.class, ip); - return true; - default: - configManager = new ColorSelectConfigManager(); - break; - } - return false; - } - + + public boolean writeResource() throws Exception { return FRContext.getCurrentEnv().writeResource(ColorSelectConfigManager.getProviderInstance()); }