view src/main/java/christie/test/RemoteTake/RemoteTakeTest.java @ 28:d1fc3ebb269e

minor change
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Tue, 30 Jan 2018 19:55:14 +0900
parents bf8ac57409af
children e29900328fff
line wrap: on
line source

package christie.test.RemoteTake;

import christie.annotation.RemoteTake;
import christie.codegear.CodeGear;
import christie.codegear.CodeGearManager;
import christie.datagear.dg.DataGear;

public class RemoteTakeTest extends CodeGear{

    @RemoteTake(dgmName = "remote",key = "hoge")
    public DataGear<Integer> hoge = new DataGear<>();

    @RemoteTake(dgmName = "remote",key = "cgmID")
    public DataGear<Integer> cgmID = new DataGear<>();

    @Override
    protected void run(CodeGearManager cgm) {
        if (hoge.getData() != 10){
            System.out.println(cgmID.getData() + " : " +hoge.getData());
            cgm.setup(new RemoteTakeTest());
            getLocalDGM().put("hoge", hoge.getData() + 1);
            getLocalDGM().put("cgmID", cgm.cgmID);
        }
    }
}