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
acc399f3
authored
Nov 20, 2019
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update document
parent
6659ce1b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/core/config/XxlJobConfig.java
xxl-job-core/src/main/java/com/xxl/job/core/executor/impl/XxlJobSpringExecutor.java
View file @
acc399f3
...
...
@@ -5,6 +5,8 @@ import com.xxl.job.core.glue.GlueFactory;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.DisposableBean
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextAware
;
...
...
@@ -15,11 +17,12 @@ import java.util.Map;
*
* @author xuxueli 2018-11-01 09:24:52
*/
public
class
XxlJobSpringExecutor
extends
XxlJobExecutor
implements
ApplicationContextAware
{
public
class
XxlJobSpringExecutor
extends
XxlJobExecutor
implements
ApplicationContextAware
,
InitializingBean
,
DisposableBean
{
// start
@Override
public
void
star
t
()
throws
Exception
{
public
void
afterPropertiesSe
t
()
throws
Exception
{
// init JobHandler Repository
initJobHandlerRepository
(
applicationContext
);
...
...
@@ -32,6 +35,13 @@ public class XxlJobSpringExecutor extends XxlJobExecutor implements ApplicationC
super
.
start
();
}
// destroy
@Override
public
void
destroy
()
{
super
.
destroy
();
}
private
void
initJobHandlerRepository
(
ApplicationContext
applicationContext
){
if
(
applicationContext
==
null
)
{
return
;
...
...
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/core/config/XxlJobConfig.java
View file @
acc399f3
...
...
@@ -38,7 +38,7 @@ public class XxlJobConfig {
private
int
logRetentionDays
;
@Bean
(
initMethod
=
"start"
,
destroyMethod
=
"destroy"
)
@Bean
public
XxlJobSpringExecutor
xxlJobExecutor
()
{
logger
.
info
(
">>>>>>>>>>> xxl-job config init."
);
XxlJobSpringExecutor
xxlJobSpringExecutor
=
new
XxlJobSpringExecutor
();
...
...
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