Esempio n. 1
0
  @Override
  public void destroy() {
    if (timerExecutor != null) {
      timerExecutor.interrupt();
    }

    super.destroy();
  }
Esempio n. 2
0
  @Override
  public void init() {

    // 加载缓存数据
    System.out.println("init cache start....");
    FieldNameCache.getInstance().putAllDataToCache();
    TemplateCache.getInstance().putAllDataToCache();
    FlowCache.getInstance().putAllDataToCache();
    TemplateTypeCache.getInstance().putAllDataToCache();
    System.out.println("init cache end....");

    if (ConfigManager.getEnableEmail()) {
      timerExecutor = new TimerExecutor(); // 线上的话只能配置一台定时器!
      timerExecutor.start();
    }

    for (int i = 0; i < 5; i++) {
      // 每台机器开5个线程异步执行脚本
      new Thread(new ScriptExecuteThread()).start();
    }
  }