view src/alice/topology/manager/reconnection/ReceiveReconnectData.java @ 270:23e53aaa8720

reconnect manager worked.
author sugi
date Wed, 21 Aug 2013 15:33:49 +0900
parents 9982e1c4f099
children 3667ab045530
line wrap: on
line source

package alice.topology.manager.reconnection;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.DataSegment;
import alice.datasegment.Receiver;
import alice.topology.HostMessage;

public class ReceiveReconnectData extends CodeSegment{
	private Receiver hostData = ids.create(CommandType.TAKE);

	public ReceiveReconnectData(){
		hostData.setKey("_RECODATA");
	}
	
	@Override
	public void run() {
		System.out.println("ReceiveReconnectData");
		HostMessage host = hostData.asClass(HostMessage.class);
		DataSegment.remove(host.connectionName);
		DataSegment.connect(host.connectionName, host.reverseName, host.name, host.port);
		ods.put(host.connectionName, "reverseKey", host.reverseName);
		new ReceiveReconnectData();
	}
	

}