annotate src/main/java/christie/topology/node/IncomingConnectionInfo.java @ 195:a0be7c83fff8

add connectionList
author akahori
date Sat, 09 Mar 2019 10:19:03 +0900
parents 6eb548c188e5
children dd3c0ba6a0a6
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;
176
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
9 import christie.topology.Message;
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
10 import christie.topology.TopologyDataGear;
88
e4d16deb9627 del Logger
akahori
parents: 76
diff changeset
11
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
12
fd944876257b add node and keepalive
akahori
parents:
diff changeset
13 public class IncomingConnectionInfo extends CodeGear {
fd944876257b add node and keepalive
akahori
parents:
diff changeset
14
65
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
15 @Take
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
16 HostMessage remoteNodeInfo;
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
17
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
18 @Take
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
19 TopologyDataGear topoDG;
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
20
176
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
21 int count;
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
22
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
23 public IncomingConnectionInfo() {
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
24 this.count = 0;
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
26
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
27 public IncomingConnectionInfo(int count) {
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
28 this.count = count;
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
29 }
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
30
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
31
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
32 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
33 protected void run(CodeGearManager cgm) {
94
87a203c99177 update HostMessage refactor
akahori
parents: 88
diff changeset
34 String connectionName = remoteNodeInfo.getConnectionName();
61
20d4c0cce914 refactor Topology Node
akahori
parents: 59
diff changeset
35
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
36 if (remoteNodeInfo.getHostName().equals("")) { // end case
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
37 getLocalDGM().put("topoDG", topoDG);
176
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
38 // returnしないとtopoDGが使えない.
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
39 return;
170
f9f83bb213e8 fix topology manager
akahori
parents: 168
diff changeset
40 }
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
41
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
42 cgm.createRemoteDGM(connectionName,
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
43 remoteNodeInfo.getHostName(),
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
44 remoteNodeInfo.getPort());
158
e295cb59e514 update refactor topology manager
akahori
parents: 121
diff changeset
45
195
a0be7c83fff8 add connectionList
akahori
parents: 176
diff changeset
46
176
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
47 getDGM(connectionName).put("_CONNECTIONMESSAGE",new Message());
195
a0be7c83fff8 add connectionList
akahori
parents: 176
diff changeset
48 cgm.setup(new CreateConnectionList());
a0be7c83fff8 add connectionList
akahori
parents: 176
diff changeset
49 getLocalDGM().put("cMember", connectionName);
168
c7300be0fff6 fix incomingHosts end message
akahori
parents: 158
diff changeset
50
176
6eb548c188e5 update add Message
akahori
parents: 170
diff changeset
51 cgm.setup(new IncomingConnectionInfo(count + 1));
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
52 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
53
fd944876257b add node and keepalive
akahori
parents:
diff changeset
54 }