Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
X
XXL-JOB
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
靳帅
XXL-JOB
Commits
ecd0b24a
Unverified
提交
ecd0b24a
authored
10月 27, 2018
作者:
许雪里
提交者:
GitHub
10月 27, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #523 from gpqhl0071/master
命名规范修正
上级
d4c9eb5d
c3697559
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
8 行增加
和
8 行删除
+8
-8
XxlJobExecutor.java
...c/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
+8
-8
没有找到文件。
xxl-job-core/src/main/java/com/xxl/job/core/executor/XxlJobExecutor.java
浏览文件 @
ecd0b24a
...
...
@@ -88,12 +88,12 @@ public class XxlJobExecutor implements ApplicationContextAware {
JobLogFileCleanThread
.
getInstance
().
start
(
logRetentionDays
);
}
public
void
destroy
(){
// destory
J
obThreadRepository
if
(
J
obThreadRepository
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
Integer
,
JobThread
>
item:
J
obThreadRepository
.
entrySet
())
{
// destory
j
obThreadRepository
if
(
j
obThreadRepository
.
size
()
>
0
)
{
for
(
Map
.
Entry
<
Integer
,
JobThread
>
item:
j
obThreadRepository
.
entrySet
())
{
removeJobThread
(
item
.
getKey
(),
"web container destroy and kill the job."
);
}
J
obThreadRepository
.
clear
();
j
obThreadRepository
.
clear
();
}
// destory executor-server
...
...
@@ -174,13 +174,13 @@ public class XxlJobExecutor implements ApplicationContextAware {
// ---------------------- job thread repository ----------------------
private
static
ConcurrentHashMap
<
Integer
,
JobThread
>
J
obThreadRepository
=
new
ConcurrentHashMap
<
Integer
,
JobThread
>();
private
static
ConcurrentHashMap
<
Integer
,
JobThread
>
j
obThreadRepository
=
new
ConcurrentHashMap
<
Integer
,
JobThread
>();
public
static
JobThread
registJobThread
(
int
jobId
,
IJobHandler
handler
,
String
removeOldReason
){
JobThread
newJobThread
=
new
JobThread
(
jobId
,
handler
);
newJobThread
.
start
();
logger
.
info
(
">>>>>>>>>>> xxl-job regist JobThread success, jobId:{}, handler:{}"
,
new
Object
[]{
jobId
,
handler
});
JobThread
oldJobThread
=
J
obThreadRepository
.
put
(
jobId
,
newJobThread
);
// putIfAbsent | oh my god, map's put method return the old value!!!
JobThread
oldJobThread
=
j
obThreadRepository
.
put
(
jobId
,
newJobThread
);
// putIfAbsent | oh my god, map's put method return the old value!!!
if
(
oldJobThread
!=
null
)
{
oldJobThread
.
toStop
(
removeOldReason
);
oldJobThread
.
interrupt
();
...
...
@@ -189,14 +189,14 @@ public class XxlJobExecutor implements ApplicationContextAware {
return
newJobThread
;
}
public
static
void
removeJobThread
(
int
jobId
,
String
removeOldReason
){
JobThread
oldJobThread
=
J
obThreadRepository
.
remove
(
jobId
);
JobThread
oldJobThread
=
j
obThreadRepository
.
remove
(
jobId
);
if
(
oldJobThread
!=
null
)
{
oldJobThread
.
toStop
(
removeOldReason
);
oldJobThread
.
interrupt
();
}
}
public
static
JobThread
loadJobThread
(
int
jobId
){
JobThread
jobThread
=
J
obThreadRepository
.
get
(
jobId
);
JobThread
jobThread
=
j
obThreadRepository
.
get
(
jobId
);
return
jobThread
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论