From 8f6186619f588cdb446ba7207851ac206548ae16 Mon Sep 17 00:00:00 2001 From: xuxueli <931591021@qq.com> Date: Thu, 26 Mar 2020 19:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=97=A7=E7=B1=BB=E6=B3=A8?= =?UTF-8?q?=E8=A7=A3JobHandler=EF=BC=8C=E6=8E=A8=E8=8D=90=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=9F=BA=E4=BA=8E=E6=96=B9=E6=B3=95=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=20"@XxlJob"=20=E7=9A=84=E6=96=B9=E5=BC=8F=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E5=BC=80=E5=8F=91=EF=BC=9B(=E5=A6=82?= =?UTF-8?q?=E9=9C=80=E4=BF=9D=E7=95=99=E7=B1=BB=E6=B3=A8=E8=A7=A3JobHandle?= =?UTF-8?q?r=E4=BD=BF=E7=94=A8=E6=96=B9=E5=BC=8F=EF=BC=8C=E5=8F=AF?= =?UTF-8?q?=E4=BB=A5=E5=8F=82=E8=80=83=E6=97=A7=E7=89=88=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E5=AE=9A=E5=88=B6=E5=BC=80=E5=8F=91);?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/XXL-JOB官方文档.md | 10 ++-- .../executor/impl/XxlJobSpringExecutor.java | 9 ++-- .../core/handler/annotation/JobHandler.java | 48 +++++++++---------- 3 files changed, 32 insertions(+), 35 deletions(-) diff --git a/doc/XXL-JOB官方文档.md b/doc/XXL-JOB官方文档.md index d4d33b84..693a9b8b 100644 --- a/doc/XXL-JOB官方文档.md +++ b/doc/XXL-JOB官方文档.md @@ -1713,11 +1713,11 @@ public ReturnT execute(String param) { - 7、执行器XxlJob注解扫描逻辑优化,修复任务为空时小概率NPE问题; - 8、Web IDE交互问题修复:输入源码备注之后按回车跳转error问题处理; - 9、调度中心国际化完善:新增 "中文繁体" 支持。默认为 "zh_CN"/中文简体, 可选范围为 "zh_CN"/中文简体, "zh_TC"/中文繁体 and "en"/英文; -- 10、[迭代中]自定义失败重试时间间隔; -- 11、[迭代中]任务复制功能;点击复制是弹出新建任务弹框,并初始化被复制任务信息; -- 12、[迭代中]新增执行器描述、任务描述属性; -- 13、[迭代中]任务执行一次的时候指定IP; -- 14、[迭代中]移除旧类注解JobHandler,推荐使用基于方法注解 "@XxlJob" 的方式进行任务开发; +- 10、移除旧类注解JobHandler,推荐使用基于方法注解 "@XxlJob" 的方式进行任务开发;(如需保留类注解JobHandler使用方式,可以参考旧版逻辑定制开发); +- 11、[迭代中]自定义失败重试时间间隔; +- 12、[迭代中]任务复制功能;点击复制是弹出新建任务弹框,并初始化被复制任务信息; +- 13、[迭代中]新增执行器描述、任务描述属性; +- 14、[迭代中]任务执行一次的时候指定IP; - 15、[迭代中]任务日志支持单个清理和状态转移,方便触发子任务; - 16、[迭代中]任务结果丢失处理:针对长期处于运行中的任务(设置过期时间时,运行超过"过期时间+1min";未设置超时时间时,运行超过"30min"),主动检测该执行器是否在线,如果不在线主动标记失败; - 17、[迭代中]优雅停机回调丢失问题修复; diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java b/xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java index 205b4879..466deba4 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java @@ -3,8 +3,6 @@ package com.xxl.job.core.executor.impl; import com.xxl.job.core.biz.model.ReturnT; import com.xxl.job.core.executor.XxlJobExecutor; import com.xxl.job.core.glue.GlueFactory; -import com.xxl.job.core.handler.IJobHandler; -import com.xxl.job.core.handler.annotation.JobHandler; import com.xxl.job.core.handler.annotation.XxlJob; import com.xxl.job.core.handler.impl.MethodJobHandler; import org.springframework.beans.BeansException; @@ -15,7 +13,6 @@ import org.springframework.context.ApplicationContextAware; import org.springframework.core.annotation.AnnotationUtils; import java.lang.reflect.Method; -import java.util.Map; /** * xxl-job executor (for spring) @@ -30,7 +27,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC public void afterPropertiesSet() throws Exception { // init JobHandler Repository - initJobHandlerRepository(applicationContext); + /*initJobHandlerRepository(applicationContext);*/ // init JobHandler Repository (for method) initJobHandlerMethodRepository(applicationContext); @@ -49,7 +46,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC } - private void initJobHandlerRepository(ApplicationContext applicationContext) { + /*private void initJobHandlerRepository(ApplicationContext applicationContext) { if (applicationContext == null) { return; } @@ -69,7 +66,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC } } } - } + }*/ private void initJobHandlerMethodRepository(ApplicationContext applicationContext) { if (applicationContext == null) { diff --git a/xxl-job-core/src/main/java/com/xxl/job/core/handler/annotation/JobHandler.java b/xxl-job-core/src/main/java/com/xxl/job/core/handler/annotation/JobHandler.java index 5fdef697..dbdd4dc0 100644 --- a/xxl-job-core/src/main/java/com/xxl/job/core/handler/annotation/JobHandler.java +++ b/xxl-job-core/src/main/java/com/xxl/job/core/handler/annotation/JobHandler.java @@ -1,24 +1,24 @@ -package com.xxl.job.core.handler.annotation; - -import java.lang.annotation.ElementType; -import java.lang.annotation.Inherited; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - -/** - * annotation for job handler - * - * will be replaced by {@link com.xxl.job.core.handler.annotation.XxlJob} - * - * @author 2016-5-17 21:06:49 - */ -@Target({ElementType.TYPE}) -@Retention(RetentionPolicy.RUNTIME) -@Inherited -@Deprecated -public @interface JobHandler { - - String value(); - -} +//package com.xxl.job.core.handler.annotation; +// +//import java.lang.annotation.ElementType; +//import java.lang.annotation.Inherited; +//import java.lang.annotation.Retention; +//import java.lang.annotation.RetentionPolicy; +//import java.lang.annotation.Target; +// +///** +// * annotation for job handler +// * +// * will be replaced by {@link com.xxl.job.core.handler.annotation.XxlJob} +// * +// * @author 2016-5-17 21:06:49 +// */ +//@Target({ElementType.TYPE}) +//@Retention(RetentionPolicy.RUNTIME) +//@Inherited +//@Deprecated +//public @interface JobHandler { +// +// String value(); +// +//}