view src/main/java/alice/topology/node/IncomingReverseKey.java @ 393:38021fceabef draft multicast

test commit
author tatsuki
date Tue, 17 Jun 2014 17:39:47 +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");
	}

}