345
|
1 package alice.topology.node;
|
|
2
|
|
3 import java.util.ArrayList;
|
|
4
|
|
5 import alice.codesegment.CodeSegment;
|
|
6 import alice.datasegment.CommandType;
|
|
7 import alice.datasegment.DataSegment;
|
|
8 import alice.datasegment.Receiver;
|
|
9 import alice.topology.HostMessage;
|
|
10
|
|
11 public class IncomingConnectionInfo extends CodeSegment {
|
|
12
|
419
|
13 public Receiver hostInfo = ids.create(CommandType.TAKE);
|
|
14 private String absName;
|
|
15 private int count;
|
404
|
16
|
419
|
17 public IncomingConnectionInfo(String absName, int count) {
|
|
18 this.absName = absName;
|
|
19 this.count = count;
|
|
20 }
|
404
|
21
|
345
|
22
|
419
|
23 @Override
|
|
24 public void run() {
|
|
25 if (this.hostInfo.getVal() == null) {
|
|
26 ods.put("local", "configNodeNum", count);
|
|
27 } else {
|
|
28 if (count == 0)
|
|
29 ods.put("_CLIST", new ArrayList<String>());
|
|
30
|
|
31 HostMessage hostInfo = this.hostInfo.asClass(HostMessage.class);
|
|
32 DataSegment.connect(hostInfo.connectionName, hostInfo.reverseName, hostInfo.name, hostInfo.port);
|
|
33 ods.put(hostInfo.connectionName, "reverseKey", hostInfo.reverseName);
|
|
34 ods.put("cMember", hostInfo.connectionName);
|
|
35 count++;
|
|
36
|
|
37 new CreateConnectionList();
|
|
38 }
|
|
39 IncomingConnectionInfo cs = new IncomingConnectionInfo(absName, count);
|
|
40 cs.hostInfo.setKey("manager", absName);
|
|
41 }
|
345
|
42
|
|
43 }
|