view src/main/java/jp/ac/u_ryukyu/alicevnc/CheckMyName.java @ 55:fe627049e289

update maven added compressed to DSM name
author Nozomi Teruya <e125769@ie.u-ryukyu.ac.jp>
date Mon, 16 Nov 2015 20:06:13 +0900
parents 57ca704f86a3
children
line wrap: on
line source

package jp.ac.u_ryukyu.alicevnc;

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

public class CheckMyName extends CodeSegment {

    private Receiver info = ids.create(CommandType.PEEK);

    public CheckMyName(){
        info.setKey("compressedLocal", "host");
    }

    @Override
    public void run() {
        if ("node0".equals(info.asString())) {
            new CreateWindow("local");
            new NegotiateVNCServer();
        } else {
            new CreateWindow("parent");
        }

        new ReceiveAliceVNCMessage();
        new SendChangeRequest();
    }

}