51
|
1 package christie.test.topology.localTestTopology;
|
|
2
|
|
3
|
|
4 import christie.codegear.CodeGearManager;
|
|
5 import christie.codegear.StartCodeGear;
|
|
6 import christie.topology.manager.StartTopologyManager;
|
|
7 import christie.topology.manager.TopologyManagerConfig;
|
|
8 import christie.topology.node.StartTopologyNode;
|
|
9 import christie.topology.node.TopologyNodeConfig;
|
|
10
|
|
11 import java.util.LinkedList;
|
|
12
|
69
|
13 public class StartLocalTestTopology extends StartCodeGear{
|
51
|
14
|
|
15
|
69
|
16 public StartLocalTestTopology(CodeGearManager cgm) {
|
51
|
17 super(cgm);
|
|
18 }
|
|
19
|
|
20 public static void main(String[] args) {
|
|
21 LinkedList<LocalTestTopologyConfig> configs = new LinkedList<LocalTestTopologyConfig>();
|
|
22 configs.add(new LocalTestTopologyConfig(args, 10001, "node0"));
|
|
23 configs.add(new LocalTestTopologyConfig(args, 10002, "node1"));
|
|
24 configs.add(new LocalTestTopologyConfig(args, 10003, "node2"));
|
|
25
|
72
|
26 TopologyManagerConfig topologyManagerConfig = new TopologyManagerConfig(new String[]{"--confFile", "scripts/ring.dot", "--showTime"});
|
69
|
27 CodeGearManager topologyManagerCGM = createCGM(10000);
|
|
28 new StartTopologyManager(topologyManagerCGM, topologyManagerConfig);
|
51
|
29
|
|
30 for (LocalTestTopologyConfig conf: configs ) {
|
|
31 CodeGearManager nodeCGM = createCGM(conf.connectPort);
|
|
32 String[] csarg = {"--host","localhost","--localKey",conf.key };
|
|
33 TopologyNodeConfig cs = new TopologyNodeConfig(csarg);
|
|
34
|
|
35 new StartTopologyNode(nodeCGM, cs, new LTRemoteIncrement(conf));
|
|
36 }
|
69
|
37 topologyManagerCGM.setup(new StartLTCodeGear());
|
51
|
38 }
|
|
39
|
|
40 }
|