Mercurial > hg > Database > Alice
view src/main/java/alice/test/codesegment/local/TestCodeSegment.java @ 549:9f577ff4f7ea dispose
resolve TopologyManager NullPointerException
author | Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 06 Oct 2015 17:50:53 +0900 |
parents | b44a2bf16eb3 |
children |
line wrap: on
line source
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; public class TestCodeSegment extends CodeSegment { // create input datasegment arg1 Receiver arg1 = ids.create(CommandType.PEEK);//peek用Receiverを生成 @Override public void run() { System.out.println("type = " + arg1.type); int num = arg1.asInteger(); System.out.println("data = " + num); if (num++ == 10) { System.exit(0); return; } TestCodeSegment cs = new TestCodeSegment(); cs.arg1.setKey("key1", this);//Receiverに値をpeekしてくる // DataSegment.get("local").update ods.update("local", "key1", num); } }