Mercurial > hg > Members > tatsuki > Alice
view src/main/java/alice/topology/node/IncomingReverseKey.java @ 402:dbfeb353a78d draft multicast tip
refs #3 test commit
author | tatsuki |
---|---|
date | Tue, 24 Jun 2014 19:06:41 +0900 |
parents | 8f71c3e6f11d |
children |
line wrap: on
line source
package alice.topology.node; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; import org.msgpack.type.Value; public class IncomingReverseKey extends CodeSegment { public Receiver reverseKey = ids.create(CommandType.TAKE); public Receiver reverseCount = ids.create(CommandType.PEEK); @Override public void run() { String reverseKey = ((Value)this.reverseKey.getVal()).asRawValue().getString(); String from = this.reverseKey.from; DataSegment.getAccept(from).reverseKey = reverseKey; int reverseCount = this.reverseCount.asInteger(); reverseCount++; ods.update("local", "reverseCount", reverseCount); IncomingReverseKey cs = new IncomingReverseKey(); cs.reverseKey.setKey("local", "reverseKey"); cs.reverseCount.setKey("local", "reverseCount"); } }