Mercurial > hg > Members > tatsuki > Alice
view src/alice/test/codesegment/RemoteIncrement.java @ 16:433e601a8e28
network bug fix
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 15 Jan 2012 12:17:30 +0900 |
parents | e3f1b21718b0 |
children | 72dd27d952b0 |
line wrap: on
line source
package alice.test.codesegment; import org.msgpack.type.ValueFactory; import alice.codesegment.CodeSegment; import alice.datasegment.DataSegmentValue; public class RemoteIncrement extends CodeSegment { @Override public void run() { DataSegmentValue data = ids.get("num"); int num = data.val.asIntegerValue().getInt(); System.out.println("[CodeSegment] " + num++); if (num == 10) System.exit(0); CodeSegment cs = new RemoteIncrement(); cs.ids.take("num", "remote", "num"); cs.ids.execute(); ods.put("local", "num", ValueFactory.createIntegerValue(num)); } }