wuzeyu
2023-11-27 7c98e347015e96a7683dbb08b36495c75c54bea5
pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/support/SupportUnit.java
@@ -39,36 +39,31 @@
   public void start(UnitStartedCallbackInterface callback) throws Exception {
      if(!started){
         started = true ;
         if(confVo.enableShortThreadPool) {
            TreadPoolFactory.initThreadPoolShort("短任务工作线程池",
                  this.confVo.short_maxThread,
                  this.confVo.short_minThread,
                  this.confVo.short_freeTimeout,
         if(confVo.enableThreadPool){
            TreadPoolFactory.initThreadPoolShort("短任务工作线程池",
                  this.confVo.short_maxThread,
                  this.confVo.short_minThread,
                  this.confVo.short_freeTimeout,
                  this.confVo.short_busyTimeout);
         }else{
            System.out.println("短线程池配置不启动");
         }
         if(confVo.enableLongThreadPool) {
            TreadPoolFactory.initThreadPoolLong("长任务工作线程池",
                  this.confVo.long_maxThread,
                  this.confVo.long_minThread,
                  this.confVo.long_freeTimeout,
            TreadPoolFactory.initThreadPoolLong("长任务工作线程池",
                  this.confVo.long_maxThread,
                  this.confVo.long_minThread,
                  this.confVo.long_freeTimeout,
                  this.confVo.long_busyTimeout);
         }else{
            System.out.println("长线程池配置不启动");
            if(this.confVo.showStartInfo){
               System.out.println("线程池模块成功启动");
            }
         }
         if(this.confVo.showStartInfo){
            System.out.println("线程池模块成功启动");
         }
         callback.call(null);
      }
      callback.call(null);
   }
   @Override
   public void stop(UnitStartedCallbackInterface callback) {
   public void stop(UnitStartedCallbackInterface callback) throws Exception {
   }
   
   /*
   public static void main(String[] args) throws Exception{
      SupportUnitConfigVo supVo = new SupportUnitConfigVo() ;
      //短工作时长线程池,线程负责用时较短的工作任务
@@ -87,9 +82,8 @@
         supVo.long_busyTimeout = -1 ;
      }
      
      supVo.enableShortThreadPool = true ;
      supVo.enableLongThreadPool = true ;
      supVo.enableThreadPool = true ;
      supVo.showStartInfo = true ;
      SupportUnit supUnit = SupportUnit.getInstance() ;
@@ -100,7 +94,6 @@
      supUnit.start(obj -> {
      });
   }
   private static class AdapterImp_SupportUnit implements SupportUnitAdapter {
      
      private SupportUnitConfigVo configVo = null ;
@@ -113,6 +106,7 @@
      public void setConfig(SupportUnitConfigVo configVo) {
         this.configVo = configVo;
      }
   }
   */
}