345
|
1 package alice.test.topology.share;
|
|
2
|
|
3 import alice.codesegment.CodeSegment;
|
|
4 import alice.datasegment.CommandType;
|
|
5 import alice.datasegment.Receiver;
|
|
6
|
|
7 public class AutoIncrement extends CodeSegment {
|
|
8
|
|
9 public Receiver position = ids.create(CommandType.PEEK);
|
|
10
|
|
11 public AutoIncrement(String key,int index){
|
|
12 this.position.setKey(key, index);
|
|
13 }
|
|
14
|
|
15 @Override
|
|
16 public void run() {
|
|
17 synchronized(this){
|
|
18 try {
|
|
19 wait(50);
|
|
20 } catch (InterruptedException e) {
|
|
21 e.printStackTrace();
|
|
22 }
|
|
23 }
|
|
24 ods.update(position.key, new DataInfo(System.nanoTime()));
|
|
25 new AutoIncrement(position.key ,position.index);
|
|
26 }
|
|
27
|
|
28 }
|