Mercurial > hg > Database > Alice
changeset 565:fbf3a994071e dispose
add MultiTopologyNodeCongingFactory to TopologyNodeConfig for over NAT
author | Nozomi |
---|---|
date | Thu, 26 Nov 2015 19:11:35 +0900 |
parents | e8280077c2f9 |
children | 6cc42645f05c |
files | Alice.iml src/main/java/alice/topology/node/TopologyNodeConfig.java |
diffstat | 2 files changed, 172 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/Alice.iml Thu Nov 26 03:09:14 2015 +0900 +++ b/Alice.iml Thu Nov 26 19:11:35 2015 +0900 @@ -1,6 +1,152 @@ <?xml version="1.0" encoding="UTF-8"?> -<module version="4"> +<module external.linked.project.id="Alice" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="cr.ie.u_ryukyu.ac.jp" external.system.module.version="1.1" type="JAVA_MODULE" version="4"> <component name="NewModuleRootManager" inherit-compiler-output="false"> + <output url="file://$MODULE_DIR$/build/classes/main" /> + <output-test url="file://$MODULE_DIR$/build/classes/test" /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> + <sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> + <sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> + <excludeFolder url="file://$MODULE_DIR$/.gradle" /> + <excludeFolder url="file://$MODULE_DIR$/build" /> + </content> + <orderEntry type="inheritedJdk" /> <orderEntry type="sourceFolder" forTests="false" /> + <orderEntry type="module-library" exported=""> + <library name="Gradle: com.alexmerz.graphviz"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/com.alexmerz.graphviz.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: commons-lang3-3.3.2"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/commons-lang3-3.3.2.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: j3dcore"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/j3dcore.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: j3dutils"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/j3dutils.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: javassist"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/javassist.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: jimColModelImporterJFX"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jimColModelImporterJFX.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: jimObjModelImporterJFX"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/jimObjModelImporterJFX.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: log4j-1.2.16"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/log4j-1.2.16.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: msgpack-0.6.13-SNAPSHOT-sources"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/msgpack-0.6.13-SNAPSHOT-sources.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: msgpack-0.6.13-SNAPSHOT"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/msgpack-0.6.13-SNAPSHOT.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: slf4j-api-1.6.1-sources"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/slf4j-api-1.6.1-sources.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: slf4j-api-1.6.1"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/slf4j-api-1.6.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: slf4j-log4j12-1.6.1-sources"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/slf4j-log4j12-1.6.1-sources.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: slf4j-log4j12-1.6.1"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/slf4j-log4j12-1.6.1.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> + <orderEntry type="module-library" exported=""> + <library name="Gradle: vecmath"> + <CLASSES> + <root url="jar://$MODULE_DIR$/lib/vecmath.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> + </orderEntry> </component> </module> \ No newline at end of file
--- a/src/main/java/alice/topology/node/TopologyNodeConfig.java Thu Nov 26 03:09:14 2015 +0900 +++ b/src/main/java/alice/topology/node/TopologyNodeConfig.java Thu Nov 26 19:11:35 2015 +0900 @@ -1,6 +1,8 @@ package alice.topology.node; import java.util.ArrayList; +import java.util.LinkedList; + import alice.daemon.Config; public class TopologyNodeConfig extends Config { @@ -10,7 +12,6 @@ public String cookie; private ArrayList<Class> eventList = new ArrayList<Class>(); - public TopologyNodeConfig(String[] args) { super(args); for (int i = 0; i< args.length; i++) { @@ -24,6 +25,29 @@ } } + public static LinkedList<TopologyNodeConfig> MultiTopologyNodeCongingFactory(String[] args) { + LinkedList<TopologyNodeConfig> configList = new LinkedList<TopologyNodeConfig>(); + LinkedList<String> nodeConfigArgs = new LinkedList<String>(); + + for(int i = 0; i < args.length; ++i) { + if("-host".equals(args[i])) { + if(!nodeConfigArgs.isEmpty()){ + configList.add(new TopologyNodeConfig((String[]) nodeConfigArgs.toArray()); + nodeConfigArgs = new LinkedList<String>(); + } + ++i; + nodeConfigArgs.add(args[i]); + } else if("-port".equals(args[i])) { + ++i; + nodeConfigArgs.add(args[i]); + } else if("-cookie".equals(args[i])) { + ++i; + nodeConfigArgs.add(args[i]); + } + } + + } + public String getManagerHostName() { return managerHostName; }