annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
269
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
1 package alice.topology.manager.reconnection;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
2
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
3 import alice.codesegment.CodeSegment;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
4 import alice.datasegment.CommandType;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
5 import alice.datasegment.DataSegment;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
6 import alice.datasegment.Receiver;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
7 import alice.topology.HostMessage;
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
8
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
9 public class ReceiveReconnectData extends CodeSegment{
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
10 private Receiver hostData = ids.create(CommandType.TAKE);
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
11
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
12 public ReceiveReconnectData(){
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
13 hostData.setKey("_RECODATA");
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
14 }
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
15
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
16 @Override
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
17 public void run() {
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
18 System.out.println("ReceiveReconnectData");
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
19 HostMessage host = hostData.asClass(HostMessage.class);
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
20 DataSegment.remove(host.connectionName);
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
21 DataSegment.connect(host.connectionName, host.reverseName, host.name, host.port);
270
23e53aaa8720 reconnect manager worked.
sugi
parents: 269
diff changeset
22 ods.put(host.connectionName, "reverseKey", host.reverseName);
269
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
23 new ReceiveReconnectData();
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
24 }
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
25
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
26
9982e1c4f099 debugging reconnectManager
sugi
parents:
diff changeset
27 }