docs(quartz): 更新定时任务相关类的文档注释
This commit is contained in:
+5
-1
@@ -16,14 +16,18 @@
|
|||||||
package cn.odboy.framework.quartz.core;
|
package cn.odboy.framework.quartz.core;
|
||||||
|
|
||||||
import cn.odboy.framework.context.KitSpringBeanHolder;
|
import cn.odboy.framework.context.KitSpringBeanHolder;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行定时任务
|
* 带返回值的线程
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class QuartzRunnable implements Callable<Object> {
|
public class QuartzRunnable implements Callable<Object> {
|
||||||
|
|||||||
+6
@@ -22,8 +22,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.boot.ApplicationRunner;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用初始化完毕后,注册定时任务
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class ActiveJobRegister implements ApplicationRunner {
|
public class ActiveJobRegister implements ApplicationRunner {
|
||||||
|
|||||||
+6
@@ -35,12 +35,18 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务定义,继承QuartzJobBean是固定写法
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExecutionJobBean extends QuartzJobBean {
|
public class ExecutionJobBean extends QuartzJobBean {
|
||||||
|
|
||||||
|
|||||||
+6
@@ -32,8 +32,14 @@ import org.quartz.TriggerBuilder;
|
|||||||
import org.quartz.TriggerKey;
|
import org.quartz.TriggerKey;
|
||||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务管理工具(高耦合版)
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class QuartzManage {
|
public class QuartzManage {
|
||||||
|
|||||||
+5
-1
@@ -16,14 +16,18 @@
|
|||||||
package cn.odboy.framework.quartz.core;
|
package cn.odboy.framework.quartz.core;
|
||||||
|
|
||||||
import cn.odboy.framework.context.KitSpringBeanHolder;
|
import cn.odboy.framework.context.KitSpringBeanHolder;
|
||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.util.ReflectionUtils;
|
import org.springframework.util.ReflectionUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行定时任务
|
* 带返回值的线程
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class QuartzRunnable implements Callable<Object> {
|
public class QuartzRunnable implements Callable<Object> {
|
||||||
|
|||||||
+7
@@ -17,13 +17,20 @@ package cn.odboy.system.framework.quartz;
|
|||||||
|
|
||||||
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
|
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
|
||||||
import cn.odboy.system.service.SystemQuartzJobService;
|
import cn.odboy.system.service.SystemQuartzJobService;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.ApplicationArguments;
|
import org.springframework.boot.ApplicationArguments;
|
||||||
import org.springframework.boot.ApplicationRunner;
|
import org.springframework.boot.ApplicationRunner;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 应用初始化完毕后,注册定时任务
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class ActiveJobRegister implements ApplicationRunner {
|
public class ActiveJobRegister implements ApplicationRunner {
|
||||||
|
|||||||
+7
@@ -31,16 +31,23 @@ import cn.odboy.system.dal.mysql.SystemQuartzLogMapper;
|
|||||||
import cn.odboy.system.service.SystemEmailService;
|
import cn.odboy.system.service.SystemEmailService;
|
||||||
import cn.odboy.system.service.SystemQuartzJobService;
|
import cn.odboy.system.service.SystemQuartzJobService;
|
||||||
import cn.odboy.util.KitBeanUtil;
|
import cn.odboy.util.KitBeanUtil;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.quartz.JobExecutionContext;
|
import org.quartz.JobExecutionContext;
|
||||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 任务定义,继承QuartzJobBean是固定写法
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ExecutionJobBean extends QuartzJobBean {
|
public class ExecutionJobBean extends QuartzJobBean {
|
||||||
|
|
||||||
|
|||||||
+7
@@ -17,8 +17,10 @@ package cn.odboy.system.framework.quartz;
|
|||||||
|
|
||||||
import cn.odboy.framework.exception.BadRequestException;
|
import cn.odboy.framework.exception.BadRequestException;
|
||||||
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
|
import cn.odboy.system.dal.dataobject.SystemQuartzJobTb;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.quartz.CronScheduleBuilder;
|
import org.quartz.CronScheduleBuilder;
|
||||||
import org.quartz.CronTrigger;
|
import org.quartz.CronTrigger;
|
||||||
@@ -34,6 +36,11 @@ import org.quartz.TriggerKey;
|
|||||||
import org.quartz.impl.triggers.CronTriggerImpl;
|
import org.quartz.impl.triggers.CronTriggerImpl;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时任务管理工具(高耦合版)
|
||||||
|
*
|
||||||
|
* @author odboy
|
||||||
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
public class QuartzManage {
|
public class QuartzManage {
|
||||||
|
|||||||
Reference in New Issue
Block a user