Mercurial > hg > Members > nobuyasu > jungle-network
changeset 153:69b5565c4a63
no use toporogy
author | tatsuki |
---|---|
date | Sat, 05 Jul 2014 18:28:40 +0900 |
parents | bd6dbbd83445 |
children | a6bf0369f0a6 |
files | .classpath .project pom.xml src/main/java/app/bbs/DistributeApp.java src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java |
diffstat | 5 files changed, 56 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- a/.classpath Sat Jul 05 16:14:47 2014 +0900 +++ b/.classpath Sat Jul 05 18:28:40 2014 +0900 @@ -6,6 +6,7 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> + <classpathentry kind="src" path="Alice"/> <classpathentry kind="src" output="target/classes" path="src/main/java"> <attributes> <attribute name="optional" value="true"/> @@ -61,6 +62,10 @@ <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> + <attributes> + <attribute name="maven.pomderived" value="true"/> + </attributes> + </classpathentry> <classpathentry kind="output" path="target/classes"/> </classpath>
--- a/.project Sat Jul 05 16:14:47 2014 +0900 +++ b/.project Sat Jul 05 18:28:40 2014 +0900 @@ -1,21 +1,32 @@ <?xml version="1.0" encoding="UTF-8"?> <projectDescription> - <name>jungle-network</name> - <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> - <projects> - <project>jungle-core</project> - <project>bulletinboard</project> - </projects> - <buildSpec> - <buildCommand> - <name>org.eclipse.jdt.core.javabuilder</name> - </buildCommand> - <buildCommand> - <name>org.eclipse.m2e.core.maven2Builder</name> - </buildCommand> - </buildSpec> - <natures> - <nature>org.eclipse.m2e.core.maven2Nature</nature> - <nature>org.eclipse.jdt.core.javanature</nature> - </natures> -</projectDescription> \ No newline at end of file + <name>jungle-network</name> + <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment> + <projects> + <project>jungle-core</project> + <project>bulletinboard</project> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + <buildCommand> + <name>org.eclipse.m2e.core.maven2Builder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.m2e.core.maven2Nature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> + <linkedResources> + <link> + <name>Alice</name> + <type>2</type> + <location>/Users/one/hg/Database/Alice</location> + </link> + </linkedResources> +</projectDescription>
--- a/pom.xml Sat Jul 05 16:14:47 2014 +0900 +++ b/pom.xml Sat Jul 05 18:28:40 2014 +0900 @@ -11,8 +11,8 @@ <artifactId>maven-compiler-plugin</artifactId> <version>3.0</version> <configuration> - <source>1.6</source> - <target>1.6</target> + <source>1.8</source> + <target>1.8</target> </configuration> </plugin> </plugins> @@ -30,7 +30,7 @@ <dependency> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty</artifactId> - <version>9.2.1</version> + <version>6.1.26</version> </dependency> <dependency> <groupId>org.hectorclient</groupId> @@ -49,11 +49,6 @@ </dependency> <dependency> - <groupId>alice</groupId> - <artifactId>alice</artifactId> - <version>0.2</version> - </dependency> - <dependency> <groupId>org.msgpack</groupId> <artifactId>msgpack</artifactId> <version>0.6.8</version>
--- a/src/main/java/app/bbs/DistributeApp.java Sat Jul 05 16:14:47 2014 +0900 +++ b/src/main/java/app/bbs/DistributeApp.java Sat Jul 05 18:28:40 2014 +0900 @@ -1,16 +1,25 @@ package app.bbs; +import java.util.HashMap; +import java.util.LinkedList; import alice.jungle.remote.RemoteConfig; +import alice.topology.HostMessage; +import alice.topology.manager.IncomingHosts; +import alice.topology.manager.NodeInfo; import alice.topology.node.TopologyNode; import app.bbs.codesegment.StartBBSCodeSegment; - -public class DistributeApp -{ - public static void main( String[] args ) throws Exception - { - RemoteConfig conf = new RemoteConfig(args); - new TopologyNode(conf, new StartBBSCodeSegment(args, conf.bbsPort)); +public class DistributeApp { + public static void main(String[] args) throws Exception { + RemoteConfig conf = new RemoteConfig(args); + if (conf.getManagerHostName() == null) { + String localHostName ="localhost"; + HostMessage host = new HostMessage(localHostName, conf.localPort); + StartBBSCodeSegment cs1 = new StartBBSCodeSegment(args, conf.bbsPort); + cs1.ods.put("host", "node0"); + } else { + new TopologyNode(conf, new StartBBSCodeSegment(args, conf.bbsPort)); + } } }
--- a/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Sat Jul 05 16:14:47 2014 +0900 +++ b/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Sat Jul 05 18:28:40 2014 +0900 @@ -42,6 +42,7 @@ host.setKey("host"); } + @Override public void run() { String name = host.asString(); Matcher matcher = pattern.matcher(name);