view src/alice/test/topology/aquarium/Update.java @ 134:53aff28cde6b working

change package
author sugi
date Wed, 15 Aug 2012 17:11:57 +0900
parents src/alice/test/topology/fishmodel/beta/Update.java@aa9fc077c286
children 87f1a30a8c82
line wrap: on
line source

package alice.test.topology.aquarium;

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

public class Update extends CodeSegment {
	
	private Receiver list = ids.create(CommandType.PEEK);
	private Receiver data;
	String key;
	
	public Update(String key,Receiver data){
		this.key = key;
		this.data = data;
		this.list.setKey("local", "list");
	}

	@Override
	public void run() {
		RoutingTable RT = this.list.asClass(RoutingTable.class);
		for (Routing r : RT.table) {
			if (!r.name.equals(this.data.from)){
				ods.update(r.name, this.key, this.data.val);
			}
			
		}
		
		new CheckLocalIndex(this.key,this.data.index);
		
	}

}