tb启动

TBScheduleManagerFactory 持用InitialThread

核心是init方法

接下来是
InitialThread.start();

核心是 initialData()

  public void initialData() throws Exception {
        /** 递归创建永久根节点(/ttest/creditjob)并写入版本信息 */
        this.zkManager.initial();
        /** 创建永久子节点 baseTaskType */
        this.scheduleDataManager = new ScheduleDataManager4ZK(this.zkManager);
        /** 创建永久子节点 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);
            }
        }

    }

你可能感兴趣的:(tb启动)