view src/main/java/alice/test/topology/share/AutoIncrement.java @ 547:e91a574b69de dispose

remove index
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Tue, 18 Aug 2015 16:15:17 +0900
parents 6e304a7a60e7
children
line wrap: on
line source

package alice.test.topology.share;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.Receiver;

public class AutoIncrement extends CodeSegment {

    public Receiver position = ids.create(CommandType.PEEK);

    public AutoIncrement(String key){
        this.position.setKey(key, this);
    }

    @Override
    public void run() {
        synchronized(this){
            try {
                wait(50);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        ods.update(position.key, new DataInfo(System.nanoTime()));
        new AutoIncrement(position.key);
    }

}