Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
3dd41db7
提交
3dd41db7
authored
3月 27, 2020
作者:
xuxueli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
XxlJob注解扫描方式优化,支持查找父类以及接口和基于类代理等常见情况
上级
5f6eee85
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
13 行增加
和
13 行删除
+13
-13
XXL-JOB官方文档.md
doc/XXL-JOB官方文档.md
+8
-7
XxlJobSpringExecutor.java
.../com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
+5
-6
没有找到文件。
doc/XXL-JOB官方文档.md
浏览文件 @
3dd41db7
...
...
@@ -1715,13 +1715,14 @@ public ReturnT<String> execute(String param) {
-
9、调度中心国际化完善:新增 "中文繁体" 支持。默认为 "zh_CN"/中文简体, 可选范围为 "zh_CN"/中文简体, "zh_TC"/中文繁体 and "en"/英文;
-
10、移除旧类注解JobHandler,推荐使用基于方法注解 "@XxlJob" 的方式进行任务开发;(如需保留类注解JobHandler使用方式,可以参考旧版逻辑定制开发);
-
11、修复bootstrap.min.css.map 404问题;
-
12、
[
迭代中
]
自定义失败重试时间间隔;
-
13、
[
迭代中
]
任务复制功能;点击复制是弹出新建任务弹框,并初始化被复制任务信息;
-
14、
[
迭代中
]
新增执行器描述、任务描述属性;
-
15、
[
迭代中
]
任务执行一次的时候指定IP;
-
16、
[
迭代中
]
任务日志支持单个清理和状态转移,方便触发子任务;
-
17、
[
迭代中
]
任务结果丢失处理:针对长期处于运行中的任务(设置过期时间时,运行超过"过期时间+1min";未设置超时时间时,运行超过"30min"),主动检测该执行器是否在线,如果不在线主动标记失败;
-
18、
[
迭代中
]
优雅停机回调丢失问题修复;
-
12、XxlJob注解扫描方式优化,支持查找父类以及接口和基于类代理等常见情况;
-
13、
[
迭代中
]
自定义失败重试时间间隔;
-
14、
[
迭代中
]
任务复制功能;点击复制是弹出新建任务弹框,并初始化被复制任务信息;
-
15、
[
迭代中
]
新增执行器描述、任务描述属性;
-
16、
[
迭代中
]
任务执行一次的时候指定IP;
-
17、
[
迭代中
]
任务日志支持单个清理和状态转移,方便触发子任务;
-
18、
[
迭代中
]
任务结果丢失处理:针对长期处于运行中的任务(设置过期时间时,运行超过"过期时间+1min";未设置超时时间时,运行超过"30min"),主动检测该执行器是否在线,如果不在线主动标记失败;
-
19、
[
迭代中
]
优雅停机回调丢失问题修复;
### TODO LIST
...
...
xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
浏览文件 @
3dd41db7
...
...
@@ -16,8 +16,6 @@ import org.springframework.core.MethodIntrospector;
import
org.springframework.core.annotation.AnnotatedElementUtils
;
import
java.lang.reflect.Method
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -81,12 +79,11 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
return
;
}
// init job handler from method
String
[]
beanDefinitionNames
=
applicationContext
.
getBeanNamesForType
(
Object
.
class
,
false
,
true
);
for
(
String
beanDefinitionName
:
beanDefinitionNames
)
{
Object
bean
=
applicationContext
.
getBean
(
beanDefinitionName
);
Map
<
Method
,
XxlJob
>
annotatedMethods
=
n
ew
HashMap
<>();
Map
<
Method
,
XxlJob
>
annotatedMethods
=
n
ull
;
// referred to :org.springframework.context.event.EventListenerMethodProcessor.processBean
try
{
annotatedMethods
=
MethodIntrospector
.
selectMethods
(
bean
.
getClass
(),
new
MethodIntrospector
.
MetadataLookup
<
XxlJob
>()
{
...
...
@@ -96,9 +93,10 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
}
});
}
catch
(
Throwable
ex
)
{
if
(
logger
.
isDebugEnabled
())
{
logger
.
debug
(
"Could not resolve methods for bean with name '"
+
beanDefinitionName
+
"'"
,
ex
);
logger
.
debug
(
"xxl-job method-jobhandler resolve error for bean["
+
beanDefinitionName
+
"]."
,
ex
);
}
if
(
annotatedMethods
==
null
||
annotatedMethods
.
isEmpty
())
{
continue
;
}
for
(
Map
.
Entry
<
Method
,
XxlJob
>
methodXxlJobEntry
:
annotatedMethods
.
entrySet
())
{
...
...
@@ -107,6 +105,7 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
if
(
xxlJob
==
null
)
{
continue
;
}
String
name
=
xxlJob
.
value
();
if
(
name
.
trim
().
length
()
==
0
)
{
throw
new
RuntimeException
(
"xxl-job method-jobhandler name invalid, for["
+
bean
.
getClass
()
+
"#"
+
method
.
getName
()
+
"] ."
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论