view src/main/java/alice/test/codesegment/remote/RemoteIncrement.java @ 525:30a74eee59c7 dispose

working TestRemoteAlice
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Thu, 16 Apr 2015 20:33:53 +0900
parents aefbe41fcf12
children 928907206d21
line wrap: on
line source

package alice.test.codesegment.remote;

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

public class RemoteIncrement extends CodeSegment {

    public Receiver num = ids.create(CommandType.TAKE);//true でCompressedDSMからtake

    /**
     * Increment DataSegment value up to 10
     */
    @Override
    public void run() {
        int num = this.num.asInteger();
        System.out.println("[CodeSegment] " + num++);
        if (num == 10) System.exit(0);

        RemoteIncrement cs = new RemoteIncrement();
        cs.num.setKey("remote", "num");

        ods.put("local", "num", num);
        //ods.put("remote", "num", num, true);
    }

}