annotate src/main/java/christie/topology/node/IncomingConnectionInfo.java @ 77:c73f4ff18cfc

refactor TopologyNode
author akahori
date Wed, 05 Sep 2018 10:26:10 +0900
parents c1626d2b4bb4
children e4d16deb9627
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;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
9 import org.apache.log4j.Logger;
fd944876257b add node and keepalive
akahori
parents:
diff changeset
10
fd944876257b add node and keepalive
akahori
parents:
diff changeset
11 public class IncomingConnectionInfo extends CodeGear {
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
12 @Peek
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
13 String nodeName;
49
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
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
18 private Logger log = Logger.getLogger(IncomingConnectionInfo.class);
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
19
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
20
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
21 public IncomingConnectionInfo() {
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
22 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
23
fd944876257b add node and keepalive
akahori
parents:
diff changeset
24 @Override
fd944876257b add node and keepalive
akahori
parents:
diff changeset
25 protected void run(CodeGearManager cgm) {
65
5deea416f980 fix variable name
akahori
parents: 61
diff changeset
26 log.info(remoteNodeInfo.toString());
76
c1626d2b4bb4 del Comment
akahori
parents: 68
diff changeset
27
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
28 log.info("topology node " + nodeName + " will connect to " + remoteNodeInfo.hostName );
68
37601b98f0da update TopologyNode
akahori
parents: 66
diff changeset
29
37601b98f0da update TopologyNode
akahori
parents: 66
diff changeset
30 cgm.createRemoteDGM(remoteNodeInfo.connectionName, remoteNodeInfo.hostName, remoteNodeInfo.port);
37601b98f0da update TopologyNode
akahori
parents: 66
diff changeset
31 getDGM(remoteNodeInfo.connectionName).put("reverseNodeName", nodeName);
61
20d4c0cce914 refactor Topology Node
akahori
parents: 59
diff changeset
32
68
37601b98f0da update TopologyNode
akahori
parents: 66
diff changeset
33 getLocalDGM().put("cMember", remoteNodeInfo.connectionName);
37601b98f0da update TopologyNode
akahori
parents: 66
diff changeset
34 cgm.setup(new CreateConnectionList());
66
4e2453333508 del IncomingAbstractHostName
akahori
parents: 65
diff changeset
35 cgm.setup(new IncomingConnectionInfo());
49
fd944876257b add node and keepalive
akahori
parents:
diff changeset
36 }
fd944876257b add node and keepalive
akahori
parents:
diff changeset
37
fd944876257b add node and keepalive
akahori
parents:
diff changeset
38 }