Mercurial > hg > Database > Alice
changeset 545:074c6716f906 dispose
add AliceDeamon on paramater. not working TestLocalAlice
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 04 Aug 2015 16:24:59 +0900 |
parents | 90019fe596c4 |
children | 15eeb439830c |
files | src/main/java/alice/test/codesegment/local/StartCodeSegment.java src/main/java/alice/test/codesegment/local/TestCodeSegment.java src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java src/main/java/alice/topology/manager/TopologyManager.java src/main/java/alice/topology/node/CloseRemoteDataSegment.java src/main/java/alice/topology/node/TopologyNode.java src/test/java/alice/daemon/MulticastStartCodeSegment.java src/test/java/alice/daemon/MulticastTest.java |
diffstat | 8 files changed, 14 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/src/main/java/alice/test/codesegment/local/StartCodeSegment.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/StartCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 @@ -1,6 +1,7 @@ package alice.test.codesegment.local; import alice.codesegment.CodeSegment; +import alice.daemon.AliceDaemon; public class StartCodeSegment extends CodeSegment {
--- a/src/main/java/alice/test/codesegment/local/TestCodeSegment.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/test/codesegment/local/TestCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 @@ -1,6 +1,7 @@ package alice.test.codesegment.local; import alice.codesegment.CodeSegment; +import alice.daemon.AliceDaemon; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import org.msgpack.type.Value;
--- a/src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/test/topology/aquarium/KeyInputCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 @@ -1,5 +1,7 @@ package alice.test.topology.aquarium; +import alice.daemon.AliceDaemon; + import java.awt.event.KeyEvent; import java.awt.event.KeyListener; @@ -37,6 +39,7 @@ new SendLocation(0.0f,0.0f,-0.1f); break; case 82: // "r" + AliceDaemon aliceDaemon = new AliceDaemon(); new ResetFish().execute(aliceDaemon); break; }
--- a/src/main/java/alice/topology/manager/TopologyManager.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/topology/manager/TopologyManager.java Tue Aug 04 16:24:59 2015 +0900 @@ -6,7 +6,8 @@ public static void main(String[] args) { TopologyManagerConfig conf = new TopologyManagerConfig(args); - new AliceDaemon(conf).listen(); + AliceDaemon aliceDaemon = new AliceDaemon(conf); + aliceDaemon.listen(); new StartTopologyManager(conf).execute(aliceDaemon); }
--- a/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Tue Aug 04 16:24:59 2015 +0900 @@ -28,7 +28,7 @@ if (info1.from.equals(managerKey)||info2.from.equals(managerKey)) { if (aliceDaemon.dataSegment.contains(managerKey)) aliceDaemon.dataSegment.get(managerKey).shutdown(); - manager.deleteAll(managerKey); + manager.deleteAll(managerKey, aliceDaemon); } ods.update(info3.key, manager);
--- a/src/main/java/alice/topology/node/TopologyNode.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/main/java/alice/topology/node/TopologyNode.java Tue Aug 04 16:24:59 2015 +0900 @@ -6,7 +6,8 @@ public class TopologyNode { public TopologyNode(TopologyNodeConfig conf, CodeSegment startCS) { - new AliceDaemon(conf).listen(); + AliceDaemon aliceDaemon = new AliceDaemon(conf); + aliceDaemon.listen(); new StartTopologyNode(conf, startCS).execute(aliceDaemon); }
--- a/src/test/java/alice/daemon/MulticastStartCodeSegment.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/test/java/alice/daemon/MulticastStartCodeSegment.java Tue Aug 04 16:24:59 2015 +0900 @@ -13,7 +13,7 @@ @Override public void run() { - AliceDaemon.dataSegment.connectMulticast("multicast",conf.MCSTADDR, conf.localPort, conf.nis, MulticastTest.type); + aliceDaemon.dataSegment.connectMulticast("multicast",conf.MCSTADDR, conf.localPort, conf.nis, MulticastTest.type); if (MulticastTest.type == SocketType.Both) { // in this case "multicast" key mean local. MulticastIncrement cs = new MulticastIncrement(); @@ -21,11 +21,11 @@ ods.put("multicast", "num", 0); } else if (MulticastTest.type == SocketType.Receiver){ - AliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); + aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Sender); ReceiveInteger cs = new ReceiveInteger(); cs.num.setKey("num"); } else if (MulticastTest.type == SocketType.Sender){ - AliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); + aliceDaemon.dataSegment.connectMulticast("multicast1", "224.0.0.2", conf.localPort+1, conf.nis, SocketType.Receiver); ReceiveString cs = new ReceiveString(); cs.str.setKey("str");
--- a/src/test/java/alice/daemon/MulticastTest.java Mon Aug 03 20:13:57 2015 +0900 +++ b/src/test/java/alice/daemon/MulticastTest.java Tue Aug 04 16:24:59 2015 +0900 @@ -6,6 +6,7 @@ public static SocketType type = SocketType.Both; public static void main(String[] args){ Config conf = new Config(args); + AliceDaemon aliceDaemon = new AliceDaemon(); new MulticastStartCodeSegment(conf).execute(aliceDaemon); }