Commit d2e9ce34 by TongZuu

load XML command factory

parent 93ec0159
......@@ -16,6 +16,7 @@ import com.csc.library.session.InitialEnvironment;
public class CMDModeFactory {
private static CMDModeFactory instance;
private Map<CMDMode , AbsModeManagement> mapMode = new HashMap<CMDMode,AbsModeManagement>();
private String path = new InitialEnvironment().getValue("COMMAND_CONFIG-dir");
private CMDModeFactory(){
init();
}
......@@ -29,7 +30,7 @@ public class CMDModeFactory {
if(CMDMode.values().length == mapMode.size()){
mapMode = Collections.unmodifiableMap(mapMode);
String path = new InitialEnvironment().getValue("COMMAND_CONFIG-dir");
for(AbsModeManagement manager : mapMode.values()){
manager.load(path);
}
......@@ -51,4 +52,16 @@ public class CMDModeFactory {
public CMDModeManagement.ModeBuilder getModeBuilder(CMDMode mode){
return this.mapMode.get(mode);
}
public void load(){
for(AbsModeManagement manager : mapMode.values()){
manager.load(path);
}
}
public void load(CMDMode mode){
if(mapMode.containsKey(mode)){
mapMode.get(mode).load(path);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment