49
|
1 package christie.topology.node;
|
|
2
|
61
|
3 import christie.annotation.Peek;
|
49
|
4 import christie.codegear.CodeGear;
|
|
5 import christie.codegear.CodeGearManager;
|
|
6 import christie.topology.HostMessage;
|
|
7
|
|
8 import java.net.InetAddress;
|
|
9 import java.net.UnknownHostException;
|
|
10 import java.util.ArrayList;
|
|
11
|
|
12 public class TopologyNode extends CodeGear{
|
|
13
|
61
|
14 @Peek
|
|
15 TopologyNodeConfig topologyNodeConfig;
|
49
|
16
|
61
|
17 public TopologyNode() {
|
49
|
18 }
|
|
19
|
|
20 @Override
|
|
21 protected void run(CodeGearManager cgm) {
|
61
|
22
|
|
23 cgm.createRemoteDGM(topologyNodeConfig.getManagerKey(),
|
58
|
24 topologyNodeConfig.getManagerHostName(),
|
|
25 topologyNodeConfig.getManagerPort());
|
61
|
26
|
94
|
27 HostMessage hostMessage = new HostMessage();
|
|
28 hostMessage.setLocalHostAndPort(cgm.localPort);
|
|
29 hostMessage.setCookie(topologyNodeConfig.cookie);
|
61
|
30
|
94
|
31 getDGM(topologyNodeConfig.getManagerKey()).put("hostMessage", hostMessage);
|
77
|
32
|
66
|
33 cgm.setup(new IncomingConnectionInfo());
|
71
|
34 cgm.setup(new ConfigurationFinish());
|
49
|
35
|
|
36 }
|
|
37 }
|