49
|
1 package christie.topology.node;
|
|
2
|
|
3 import christie.annotation.Peek;
|
|
4 import christie.codegear.CodeGear;
|
|
5 import christie.codegear.CodeGearManager;
|
|
6 import christie.daemon.Config;
|
|
7 import christie.topology.manager.keepalive.KeepAlive;
|
|
8 import org.msgpack.type.ValueFactory;
|
|
9
|
|
10 public class ConfigurationFinish extends CodeGear {
|
|
11
|
|
12 @Peek
|
|
13 int reverseCount;
|
|
14
|
|
15 @Peek
|
|
16 int configNodeNum;
|
|
17
|
|
18 @Peek
|
59
|
19 TopologyNodeConfig config;
|
49
|
20
|
|
21 private CodeGear startCS;
|
|
22
|
|
23 public ConfigurationFinish(CodeGear startCS) {
|
|
24 // System.err.println("config finish ...") ;
|
|
25 this.startCS = startCS;
|
|
26 }
|
|
27
|
|
28 @Override
|
|
29 protected void run(CodeGearManager cgm) {
|
|
30 // System.err.println(" rcount = " + Integer.toString(rcount) + " " + Integer.toString(ncount));
|
|
31 if (reverseCount == configNodeNum) {
|
|
32 getDGM("manager").put( "done", ValueFactory.createNilValue());
|
|
33 cgm.setup(new Start(startCS));
|
|
34
|
|
35 if (config.useKeepAlive)
|
|
36 cgm.setup(new KeepAlive());
|
|
37 cgm.setup(new PrepareToClose());
|
|
38 //ClosedEventManager.getInstance().register(DeleteConnection.class);
|
|
39 //ClosedEventManager.getInstance().setKey();*/
|
|
40 return;
|
|
41 }
|
|
42
|
|
43 new ConfigurationFinish(startCS);
|
|
44 }
|
|
45 }
|