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 @Take
|
|
19 TopologyDataGear topoDG;
|
|
20
|
176
|
21 int count;
|
|
22
|
66
|
23 public IncomingConnectionInfo() {
|
158
|
24 this.count = 0;
|
49
|
25 }
|
|
26
|
168
|
27 public IncomingConnectionInfo(int count) {
|
|
28 this.count = count;
|
|
29 }
|
|
30
|
158
|
31
|
49
|
32 @Override
|
|
33 protected void run(CodeGearManager cgm) {
|
94
|
34 String connectionName = remoteNodeInfo.getConnectionName();
|
61
|
35
|
168
|
36 if (remoteNodeInfo.getHostName().equals("")) { // end case
|
|
37 getLocalDGM().put("topoDG", topoDG);
|
176
|
38 // returnしないとtopoDGが使えない.
|
168
|
39 return;
|
170
|
40 }
|
158
|
41
|
168
|
42 cgm.createRemoteDGM(connectionName,
|
|
43 remoteNodeInfo.getHostName(),
|
|
44 remoteNodeInfo.getPort());
|
158
|
45
|
195
|
46
|
176
|
47 getDGM(connectionName).put("_CONNECTIONMESSAGE",new Message());
|
195
|
48 cgm.setup(new CreateConnectionList());
|
|
49 getLocalDGM().put("cMember", connectionName);
|
168
|
50
|
176
|
51 cgm.setup(new IncomingConnectionInfo(count + 1));
|
49
|
52 }
|
|
53
|
|
54 }
|