643
|
1 package alice.test.topology.localTestTopology;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 import java.util.List;
|
|
8
|
|
9 public class LTRemoteIncrement extends CodeSegment {
|
|
10
|
|
11 private final LocalTestTopologyConfig conf;
|
|
12 public Receiver num = ids.create(CommandType.TAKE);
|
|
13 public Receiver clist = ids.create(CommandType.TAKE);
|
|
14
|
|
15 public LTRemoteIncrement(LocalTestTopologyConfig conf) {
|
|
16 this.conf = conf;
|
|
17 num.setKey(conf.key,"num");
|
|
18 clist.setKey(conf.key,"_CLIST");
|
|
19 }
|
|
20
|
|
21 @Override
|
|
22 public void run() {
|
|
23 int num = this.num.asInteger();
|
|
24 System.out.println("node: " + conf.key + " num = " + num);
|
|
25 num++;
|
|
26 @SuppressWarnings("unchecked")
|
|
27 List<String> list = clist.asClass(List.class);
|
|
28 for( String node : list) {
|
|
29 ods.put(node, "num", num ++);
|
|
30 }
|
|
31 }
|
|
32
|
|
33 } |