Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
熊鹏飞
/
xxljob220
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3dd41db7
authored
Mar 27, 2020
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
XxlJob注解扫描方式优化,支持查找父类以及接口和基于类代理等常见情况
parent
5f6eee85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
doc/XXL-JOB官方文档.md
xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
doc/XXL-JOB官方文档.md
View file @
3dd41db7
## 《分
布式任务调度平台XXL-JOB》
## 《分
布式任务调度平台XXL-JOB》
...
...
@@ -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
View file @
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
()
+
"] ."
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment