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;
|
176
|
9 import christie.topology.Message;
|
168
|
10 import christie.topology.TopologyDataGear;
|
88
|
11
|
49
|
12
|
|
13 public class IncomingConnectionInfo extends CodeGear {
|
|
14
|
65
|
15 @Take
|
|
16 HostMessage remoteNodeInfo;
|
49
|
17
|
168
|
18
|
176
|
19 int count;
|
|
20
|
66
|
21 public IncomingConnectionInfo() {
|
158
|
22 this.count = 0;
|
49
|
23 }
|
|
24
|
168
|
25 public IncomingConnectionInfo(int count) {
|
|
26 this.count = count;
|
|
27 }
|
|
28
|
158
|
29
|
49
|
30 @Override
|
|
31 protected void run(CodeGearManager cgm) {
|
94
|
32 String connectionName = remoteNodeInfo.getConnectionName();
|
61
|
33
|
168
|
34 cgm.createRemoteDGM(connectionName,
|
|
35 remoteNodeInfo.getHostName(),
|
|
36 remoteNodeInfo.getPort());
|
158
|
37
|
195
|
38
|
176
|
39 getDGM(connectionName).put("_CONNECTIONMESSAGE",new Message());
|
195
|
40 cgm.setup(new CreateConnectionList());
|
|
41 getLocalDGM().put("cMember", connectionName);
|
168
|
42
|
176
|
43 cgm.setup(new IncomingConnectionInfo(count + 1));
|
49
|
44 }
|
|
45
|
|
46 }
|