view src/test/java/alice/daemon/ReceiveInteger.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 15eeb439830c
children
line wrap: on
line source

package alice.daemon;

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

public class ReceiveInteger extends CodeSegment{

    public Receiver num = ids.create(CommandType.TAKE);

    @Override
    public void run() {
        int n = this.num.asInteger();
        System.out.println("[CodeSegment] " + n++);

        if (n == 10) {
            ods.put("multicast1", "str", "finish");
            try {
                synchronized (this) {
                    wait(2000);
                }
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            System.exit(0);
        }
        ReceiveInteger cs = new ReceiveInteger();
        cs.num.setKey("num", this);

    }

}