49
|
1 package christie.topology.node;
|
|
2
|
|
3
|
66
|
4 import christie.annotation.Peek;
|
65
|
5 import christie.annotation.Take;
|
49
|
6 import christie.codegear.CodeGear;
|
|
7 import christie.codegear.CodeGearManager;
|
|
8 import christie.topology.HostMessage;
|
168
|
9 import christie.topology.TopologyDataGear;
|
88
|
10
|
49
|
11
|
|
12 public class IncomingConnectionInfo extends CodeGear {
|
|
13
|
65
|
14 @Take
|
|
15 HostMessage remoteNodeInfo;
|
49
|
16
|
170
|
17 int count;
|
|
18
|
168
|
19 @Take
|
|
20 TopologyDataGear topoDG;
|
|
21
|
66
|
22 public IncomingConnectionInfo() {
|
158
|
23 this.count = 0;
|
49
|
24 }
|
|
25
|
168
|
26 public IncomingConnectionInfo(int count) {
|
|
27 this.count = count;
|
|
28 }
|
|
29
|
158
|
30
|
49
|
31 @Override
|
|
32 protected void run(CodeGearManager cgm) {
|
94
|
33 String connectionName = remoteNodeInfo.getConnectionName();
|
61
|
34
|
168
|
35 if (remoteNodeInfo.getHostName().equals("")) { // end case
|
|
36 getLocalDGM().put("topoDG", topoDG);
|
|
37 return;
|
170
|
38 }
|
158
|
39
|
168
|
40 cgm.createRemoteDGM(connectionName,
|
|
41 remoteNodeInfo.getHostName(),
|
|
42 remoteNodeInfo.getPort());
|
158
|
43
|
168
|
44 topoDG.addConnection(connectionName);
|
|
45 getLocalDGM().put("topoDG", topoDG);
|
170
|
46 getDGM(connectionName).put("reverseNodeName",connectionName);
|
168
|
47 count++;
|
|
48
|
|
49 cgm.setup(new IncomingConnectionInfo(count));
|
49
|
50 }
|
|
51
|
|
52 }
|