Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hel-developer-guide
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Spencer Chang
hel-developer-guide
Commits
04ae571a
Commit
04ae571a
authored
Aug 11, 2017
by
冯景珉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update 计划任务.md
parent
d2c339e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
计划任务.md
框架功能描述/计划任务.md
+2
-2
No files found.
框架功能描述/计划任务.md
View file @
04ae571a
...
...
@@ -40,14 +40,14 @@
#### 2.3 任务类的编写
想要自定义一个job,必须要继承一个抽象类AbstractJob,然后在
`safeExecute()`
方法中执行业务代码,示例代码如下:
想要自定义一个job,必须要继承一个抽象类AbstractJob
或者AbstractJobWithIRequest
,然后在
`safeExecute()`
方法中执行业务代码,示例代码如下:
```
java
public
class
demoJob
extends
AbstractJob
{
@Autowired
private
xxxService
service
;
//业务类
@Override
public
void
safeExecute
(
JobExecutionContext
jobExecutionContext
)
throws
Exception
{
public
void
safeExecute
WithIRequest
(
JobExecutionContext
jobExecutionContext
)
throws
Exception
{
//map中可以获取上方定义的参数,key为参数名称,value为参数值
JobDataMap
map
=
jobExecutionContext
.
getMergedJobDataMap
();
try
{
...
...
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