Mercurial > hg > Database > Alice
annotate 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 |
rev | line source |
---|---|
345 | 1 package alice.test.codesegment.local; |
2 | |
3 import alice.codesegment.CodeSegment; | |
545
074c6716f906
add AliceDeamon on paramater. not working TestLocalAlice
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
523
diff
changeset
|
4 import alice.daemon.AliceDaemon; |
345 | 5 import alice.datasegment.CommandType; |
6 import alice.datasegment.Receiver; | |
7 import org.msgpack.type.Value; | |
8 | |
9 public class TestCodeSegment extends CodeSegment { | |
419 | 10 |
11 // create input datasegment arg1 | |
523
145c425db88d
add CompressedLDSM
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
12 Receiver arg1 = ids.create(CommandType.PEEK);//peek用Receiverを生成 |
419 | 13 |
14 @Override | |
15 public void run() { | |
16 System.out.println("type = " + arg1.type); | |
547 | 17 int num = arg1.asInteger(); |
18 System.out.println("data = " + num); | |
419 | 19 |
547 | 20 if (num++ == 10) { |
419 | 21 System.exit(0); |
22 return; | |
23 } | |
24 | |
25 TestCodeSegment cs = new TestCodeSegment(); | |
547 | 26 cs.arg1.setKey("key1", this);//Receiverに値をpeekしてくる |
419 | 27 |
28 // DataSegment.get("local").update | |
547 | 29 ods.update("local", "key1", num); |
419 | 30 } |
345 | 31 |
32 } |