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
fa1ed59b
authored
Dec 25, 2017
by
xuxueli
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
clean code; 升级依赖版本;
parent
7a8937dd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
25 deletions
xxl-job-executor-samples/xxl-job-executor-sample-jfinal/pom.xml
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/mvc/controller/IndexController.java
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/DemoJobHandler.java
xxl-job-executor-samples/xxl-job-executor-sample-jfinal/pom.xml
View file @
fa1ed59b
...
...
@@ -16,7 +16,7 @@
<dependency>
<groupId>
com.jfinal
</groupId>
<artifactId>
jfinal
</artifactId>
<version>
2.
0
</version>
<version>
2.
2
</version>
</dependency>
<!-- slf4j -->
...
...
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/mvc/controller/IndexController.java
View file @
fa1ed59b
package
com
.
xxl
.
job
.
executor
.
mvc
.
controller
;
import
org.springframework.boot.autoconfigure.EnableAutoConfiguration
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@EnableAutoConfiguration
public
class
IndexController
{
@RequestMapping
(
"/"
)
@ResponseBody
String
index
()
{
return
"xxl job executor running."
;
}
}
\ No newline at end of file
//package com.xxl.job.executor.mvc.controller;
//
//import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.ResponseBody;
//
//@Controller
//@EnableAutoConfiguration
//public class IndexController {
//
// @RequestMapping("/")
// @ResponseBody
// String index() {
// return "xxl job executor running.";
// }
//
//}
\ No newline at end of file
xxl-job-executor-samples/xxl-job-executor-sample-springboot/src/main/java/com/xxl/job/executor/service/jobhandler/DemoJobHandler.java
View file @
fa1ed59b
...
...
@@ -4,7 +4,7 @@ import com.xxl.job.core.biz.model.ReturnT;
import
com.xxl.job.core.handler.IJobHandler
;
import
com.xxl.job.core.handler.annotation.JobHandler
;
import
com.xxl.job.core.log.XxlJobLogger
;
import
org.springframework.stereotype.
Service
;
import
org.springframework.stereotype.
Component
;
import
java.util.concurrent.TimeUnit
;
...
...
@@ -13,15 +13,15 @@ import java.util.concurrent.TimeUnit;
* 任务Handler的一个Demo(Bean模式)
*
* 开发步骤:
* 1、
继承 “IJobHandler”
;
* 2、
装配到Spring,例如加 “@Service”
注解;
* 3、
加 “@JobHandler” 注解,注解value值为新增任务生成的JobKey的值;多个JobKey用逗号分割;
* 1、
新建一个继承com.xxl.job.core.handler.IJobHandler的Java类
;
* 2、
该类被Spring容器扫描为Bean实例,如加“@Component”
注解;
* 3、
添加 “@JobHandler(value="自定义jobhandler名称")”注解,注解的value值为自定义的JobHandler名称,该名称对应的是调度中心新建任务的JobHandler属性的值。
* 4、执行日志:需要通过 "XxlJobLogger.log" 打印执行日志;
*
* @author xuxueli 2015-12-19 19:43:36
*/
@JobHandler
(
value
=
"demoJobHandler"
)
@
Service
@
Component
public
class
DemoJobHandler
extends
IJobHandler
{
@Override
...
...
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