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);
            }
        }

    }
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 想說的話不能說,又絕不肯說違心的話。於是,沉默下來。 沉默的日子里,瘋狂看片,記憶深刻的兩部:一部韓國的,一部智利...
    覺紅阅读 2,948评论 0 0
  • 今天讲一讲我们单位参加的第九套广播操比赛,通过努力,我们单位得了第一名,赢得了闪闪发亮的奖杯。大家纷纷合影,作为其...
    索尼格格阅读 2,656评论 0 1
  • 家的距离有多远? 也许你常年出差在外 距离是几千公里; 也许你出国在外 距离是几万公里。 然而这都不算最远的距离 ...
    简语知秋阅读 1,397评论 0 0
  • 一,作用域 1,全局作用域 var a=10; function box(){ alert(a); } box()...
    WYX雨菱欣翼阅读 1,098评论 0 0
  • 忘不了的情 文/钟鸣 我的心 跟着你飞 飞进了你的心田 手牵着手 相互偎依 去看雪中景 安然岁月中 爱你的情愫已生...
    诗韵钟鸣阅读 747评论 0 0