Mercurial > hg > Database > Alice
annotate src/main/java/alice/test/codesegment/remote/RemoteIncrement1.java @ 654:2fbd6ac705df
fix
author | suruga |
---|---|
date | Fri, 09 Feb 2018 19:48:43 +0900 |
parents | e321c5ec9b58 |
children |
rev | line source |
---|---|
345 | 1 package alice.test.codesegment.remote; |
2 | |
3 import alice.codesegment.CodeSegment; | |
4 import alice.datasegment.CommandType; | |
5 import alice.datasegment.Receiver; | |
647 | 6 import org.msgpack.type.ValueFactory; |
345 | 7 |
641 | 8 public class RemoteIncrement1 extends CodeSegment { |
9 | |
10 public Receiver num = ids.create(CommandType.TAKE); | |
647 | 11 public Receiver nullValue = ids.create(CommandType.TAKE); |
345 | 12 |
641 | 13 RemoteIncrement1() { |
14 num.setKey("remote","num2"); | |
647 | 15 nullValue.setKey("remote","remote-null-value"); |
641 | 16 } |
345 | 17 |
419 | 18 /** |
19 * Increment DataSegment value up to 10 | |
20 */ | |
21 @Override | |
22 public void run() { | |
641 | 23 |
419 | 24 int num = this.num.asInteger(); |
641 | 25 System.out.println("remote " + num++); |
654 | 26 if (num == 5) { |
27 ods.finish("remote"); | |
28 ods.finish("local"); | |
29 return; | |
30 } | |
647 | 31 if ( nullValue.getVal() == null ) { |
32 System.out.println("get remote null value"); | |
33 } | |
34 | |
35 ods.put("remote","remote-null-value", ValueFactory.createNilValue()); | |
419 | 36 |
641 | 37 new RemoteIncrement1(); |
38 ods.put("remote", "num2", num); | |
419 | 39 } |
345 | 40 |
525
30a74eee59c7
working TestRemoteAlice
Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
parents:
419
diff
changeset
|
41 } |