TBScheduleManagerFactory 持用InitialThread
核心是init方法
接下來是
InitialThread.start();
核心是 initialData()
public void initialData() throws Exception {
/** 遞歸創(chuàng)建永久根節(jié)點(/ttest/creditjob)并寫入版本信息 */
this.zkManager.initial();
/** 創(chuàng)建永久子節(jié)點 baseTaskType */
this.scheduleDataManager = new ScheduleDataManager4ZK(this.zkManager);
/** 創(chuàng)建永久子節(jié)點 strategy 和 factory */
this.scheduleStrategyManager = new ScheduleStrategyDataManager4ZK(this.zkManager);
if(this.start) {
this.scheduleStrategyManager.registerManagerFactory(this);
if(this.timer == null) {
this.timer = new Timer("TBScheduleManagerFactory-Timer");
}
if(this.timerTask == null) {
this.timerTask = new ManagerFactoryTimerTask(this);
this.timer.schedule(this.timerTask, 2000L, (long)this.timerInterval);
}
}
}