view src/alice/test/topology/aquarium/CheckLocalIndex.java @ 216:21bd8af1cf26 working

change asClass method
author one
date Wed, 27 Mar 2013 19:38:33 +0900
parents fec0726bb126
children b5c642ba998e
line wrap: on
line source

package alice.test.topology.aquarium;

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

public class CheckLocalIndex extends CodeSegment {

	private Receiver data = ids.create(CommandType.PEEK);
	private Receiver list = ids.create(CommandType.PEEK);
	
	public CheckLocalIndex(String key, int index){
		
		this.list.setKey("local", "list");
		this.data.setKey("local", key, index);
	}
	
	@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, data.key, this.data.getVal());
			}
			
		}
		new CheckLocalIndex(data.key, this.data.index);
		
	}

}