Browse Source

Merge pull request #6 in DESIGN/design from ~JU/design:feature/10.0 to feature/10.0

* commit 'ed61905a68d9dd15f905a5d95d68e08d79c6465d':
  无JIRA任务 删除老的集群代码
master
superman 7 years ago
parent
commit
eccdc74290
  1. 32
      designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java

32
designer_base/src/com/fr/design/style/color/ColorSelectConfigManager.java

@ -1,23 +1,19 @@
package com.fr.design.style.color; package com.fr.design.style.color;
import com.fr.file.XMLFileManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.cluster.rpc.RPC; import com.fr.file.XMLFileManager;
import com.fr.file.BaseClusterHelper;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.stable.EnvChangedListener; import com.fr.stable.EnvChangedListener;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLTools; import com.fr.stable.xml.XMLTools;
import com.fr.stable.xml.XMLableReader; 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.ArrayList;
import java.util.List; import java.util.List;
import java.io.InputStream;
/** /**
* 最近使用颜色 * 最近使用颜色
@ -130,30 +126,12 @@ public class ColorSelectConfigManager extends XMLFileManager implements ColorSel
*/ */
public synchronized static ColorSelectConfigManagerProvider getProviderInstance() { public synchronized static ColorSelectConfigManagerProvider getProviderInstance() {
if (configManager == null) { if (configManager == null) {
if (isClusterMember()) { configManager = new ColorSelectConfigManager();
return configManager;
}
configManager.readXMLFile(); configManager.readXMLFile();
} }
return configManager; 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 { public boolean writeResource() throws Exception {
return FRContext.getCurrentEnv().writeResource(ColorSelectConfigManager.getProviderInstance()); return FRContext.getCurrentEnv().writeResource(ColorSelectConfigManager.getProviderInstance());

Loading…
Cancel
Save