Commit d2d5b896 by huangfusuper

任务扫描线程重构

parent 3c2cf5f5
package com.byit.conf; package com.byit.conf;
import com.byit.factory.DaemonScanThreadRunHelper; import com.byit.factory.DaemonScanThreadRunHelper;
import com.byit.thread.*; import com.byit.thread.BaseThreadRunHelper;
import com.byit.util.SpringUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean; import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -22,48 +21,39 @@ import java.util.Map; ...@@ -22,48 +21,39 @@ import java.util.Map;
@Slf4j @Slf4j
public class MythJobScheduler implements InitializingBean, DisposableBean { public class MythJobScheduler implements InitializingBean, DisposableBean {
private final JobScheduleHelper jobScheduleHelper;
private final LogScanHelper logScanHelper;
private final RunRecordingScanHelper runRecordingScanHelper;
/** /**
* private final JobScheduleHelper jobScheduleHelper
* private final EmailScanHelper emailScanHelper * private final EmailScanHelper emailScanHelper
* private final FlowScanHelper flowScanHelper * private final FlowScanHelper flowScanHelper
* private final LogScanHelper logScanHelper
* private final RunRecordingScanHelper runRecordingScanHelper
*/ */
private final ApplicationContext applicationContext; private final ApplicationContext applicationContext;
@Autowired @Autowired
public MythJobScheduler(JobScheduleHelper jobScheduleHelper, LogScanHelper logScanHelper, RunRecordingScanHelper runRecordingScanHelper, ApplicationContext applicationContext) { public MythJobScheduler(ApplicationContext applicationContext) {
this.jobScheduleHelper = jobScheduleHelper;
this.logScanHelper = logScanHelper;
this.runRecordingScanHelper = runRecordingScanHelper;
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }
/** /**
* 销毁方法 * 销毁方法
* @throws Exception
*/ */
@Override @Override
public void destroy() throws Exception { public void destroy() {
DaemonScanThreadRunHelper.logoutThreadGroup(); DaemonScanThreadRunHelper.logoutThreadGroup();
this.jobScheduleHelper.doStop();
this.logScanHelper.doStop();
this.runRecordingScanHelper.doStop();
} }
/** /**
* 初始化方法 * 初始化方法
* @throws Exception
*/ */
@Override @Override
public void afterPropertiesSet() throws Exception { public void afterPropertiesSet() {
helperAutoAdd(); helperAutoAdd();
//启用扫描线程 //启用扫描线程
DaemonScanThreadRunHelper.runDaemonThreads(); DaemonScanThreadRunHelper.runDaemonThreads();
this.jobScheduleHelper.start();
this.logScanHelper.start();
this.runRecordingScanHelper.start();
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment