annotate src/main/java/christie/topology/node/IncomingConnectionInfo.java @ 170:f9f83bb213e8

fix topology manager
author akahori
date Tue, 22 Jan 2019 18:32:39 +0900
parents c7300be0fff6
children 6eb548c188e5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
1 package christie.topology.node;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
2
fd944876257b add node and keepalive
akahori
parents:
diff changeset
3
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
4 import christie.annotation.Peek;
65
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
5 import christie.annotation.Take;
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
6 import christie.codegear.CodeGear;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
7 import christie.codegear.CodeGearManager;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
8 import christie.topology.HostMessage;
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
9 import christie.topology.TopologyDataGear;
88
e4d16deb9627 del Logger
akahori
parents: 76
diff changeset
10
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
11
fd944876257b add node and keepalive
akahori
parents:
diff changeset
12 public class IncomingConnectionInfo extends CodeGear {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
13
65
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
14 @Take
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
15 HostMessage remoteNodeInfo;
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
16
170
f9f83bb213e8 fix topology manager
akahori
parents: 168
diff changeset
17 int count;
f9f83bb213e8 fix topology manager
akahori
parents: 168
diff changeset
18
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
19 @Take
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
20 TopologyDataGear topoDG;
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
21
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
22 public IncomingConnectionInfo() {
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
23 this.count = 0;
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
24 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
26 public IncomingConnectionInfo(int count) {
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
27 this.count = count;
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
28 }
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
29
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
30
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
31 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
32 protected void run(CodeGearManager cgm) {
94
87a203c99177 update HostMessage refactor
akahori
parents: 88
diff changeset
33 String connectionName = remoteNodeInfo.getConnectionName();
61
20d4c0cce914 refactor Topology Node
akahori
parents: 59
diff changeset
34
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
35 if (remoteNodeInfo.getHostName().equals("")) { // end case
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
36 getLocalDGM().put("topoDG", topoDG);
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
37 return;
170
f9f83bb213e8 fix topology manager
akahori
parents: 168
diff changeset
38 }
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
39
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
40 cgm.createRemoteDGM(connectionName,
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
41 remoteNodeInfo.getHostName(),
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
42 remoteNodeInfo.getPort());
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
43
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
44 topoDG.addConnection(connectionName);
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
45 getLocalDGM().put("topoDG", topoDG);
170
f9f83bb213e8 fix topology manager
akahori
parents: 168
diff changeset
46 getDGM(connectionName).put("reverseNodeName",connectionName);
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
47 count++;
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
48
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
49 cgm.setup(new IncomingConnectionInfo(count));
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
50 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
51
fd944876257b add node and keepalive
akahori
parents:
diff changeset
52 }