Commit d2d5b896 by huangfusuper

任务扫描线程重构

parent 3c2cf5f5
package com.byit.conf;
import com.byit.factory.DaemonScanThreadRunHelper;
import com.byit.thread.*;
import com.byit.util.SpringUtil;
import com.byit.thread.BaseThreadRunHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
......@@ -22,48 +21,39 @@ import java.util.Map;
@Slf4j
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 FlowScanHelper flowScanHelper
* private final LogScanHelper logScanHelper
* private final RunRecordingScanHelper runRecordingScanHelper
*/
private final ApplicationContext applicationContext;
@Autowired
public MythJobScheduler(JobScheduleHelper jobScheduleHelper, LogScanHelper logScanHelper, RunRecordingScanHelper runRecordingScanHelper, ApplicationContext applicationContext) {
this.jobScheduleHelper = jobScheduleHelper;
this.logScanHelper = logScanHelper;
this.runRecordingScanHelper = runRecordingScanHelper;
public MythJobScheduler(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
}
/**
* 销毁方法
* @throws Exception
*/
@Override
public void destroy() throws Exception {
public void destroy() {
DaemonScanThreadRunHelper.logoutThreadGroup();
this.jobScheduleHelper.doStop();
this.logScanHelper.doStop();
this.runRecordingScanHelper.doStop();
}
/**
* 初始化方法
* @throws Exception
*/
@Override
public void afterPropertiesSet() throws Exception {
public void afterPropertiesSet() {
helperAutoAdd();
//启用扫描线程
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