Skip to content

Commit 32cf479

Browse files
committed
ApiBoot Quartz文档更新
1 parent 66740a4 commit 32cf479

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

api-boot-project/api-boot-autoconfigure/src/main/java/org/minbox/framework/api/boot/autoconfigure/quartz/ApiBootQuartzAutoConfiguration.java

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public ApiBootQuartzSpringBeanJobFactory apiBootQuartzSpringBeanJobFactory() {
8282
/**
8383
* Quartz Factory Bean
8484
*
85+
* @param jobFactory Job Factory
8586
* @return SchedulerFactoryBean
8687
*/
8788
@Bean
@@ -103,13 +104,23 @@ public SchedulerFactoryBean quartzScheduler(ApiBootQuartzSpringBeanJobFactory jo
103104
return schedulerFactoryBean;
104105
}
105106

106-
107+
/**
108+
* Convert Properties
109+
*
110+
* @param source properties config
111+
* @return Properties
112+
*/
107113
private Properties asProperties(Map<String, String> source) {
108114
Properties properties = new Properties();
109115
properties.putAll(source);
110116
return properties;
111117
}
112118

119+
/**
120+
* 处理自定义类定义
121+
*
122+
* @param schedulerFactoryBean
123+
*/
113124
private void customize(SchedulerFactoryBean schedulerFactoryBean) {
114125
this.customizers.getIfAvailable().stream().forEach((customizer) -> customizer.customize(schedulerFactoryBean));
115126
}
@@ -118,7 +129,6 @@ private void customize(SchedulerFactoryBean schedulerFactoryBean) {
118129
* ApiBoot Quartz Bean Factory
119130
*
120131
* @author 恒宇少年
121-
* @date 2019-3-30
122132
*/
123133
protected static class ApiBootQuartzSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {
124134
/**
@@ -137,6 +147,14 @@ public void setApplicationContext(ApplicationContext applicationContext) throws
137147
this.beanFactory = applicationContext.getAutowireCapableBeanFactory();
138148
}
139149

150+
/**
151+
* 创建Job 实例时调用该方法
152+
* 把创建的Job 实例存放到SpringIOC内
153+
*
154+
* @param bundle TriggerFiredBundle
155+
* @return Job Instance
156+
* @throws Exception 系统异常
157+
*/
140158
@Override
141159
protected Object createJobInstance(TriggerFiredBundle bundle) throws Exception {
142160
Object jobInstance = super.createJobInstance(bundle);

api-boot-samples/api-boot-sample-quartz/README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,24 @@
1818
1919
### 相关配置
2020

21-
| 参数名称 | 是否必填 | 默认值 | 描述 |
22-
| ------------------------------------------------------- | -------- | --------- | ------------------------------------------ |
23-
| `api.boot.quartz.job-store-type` || memory | 任务存储源方式,默认内存方式 |
24-
| `api.boot.quartz.scheduler-name` || scheduler | 调度器名称 |
25-
| `api.boot.quartz.auto-startup` || true | 初始化后是否自动启动调度程序 |
26-
| `api.boot.quartz.startup-delay` || 0 | 初始化完成后启动调度程序的延迟。 |
27-
| `api.boot.quartz.wait-for-jobs-to-complete-on-shutdown` || false | 是否等待正在运行的作业在关闭时完成。 |
28-
| `api.boot.quartz.overwrite-existing-jobs` || false | 配置的作业是否应覆盖现有的作业定义。 |
29-
| `api.boot.quartz.properties` || | Quartz自定义的配置属性,具体参考quartz配置 |
30-
| `api.boot.quartz.jdbc` || | 配置数据库方式的Jdbc相关配置 |
21+
| 参数名称 | 是否必填 | 默认值 | 描述 |
22+
| ------------------------------------------------------------ | -------- | -------------------------------------------- | ------------------------------------------ |
23+
| `api.boot.quartz.job-store-type` || memory | 任务存储源方式,默认内存方式 |
24+
| `api.boot.quartz.scheduler-name` || scheduler | 调度器名称 |
25+
| `api.boot.quartz.auto-startup` || true | 初始化后是否自动启动调度程序 |
26+
| `api.boot.quartz.startup-delay` || 0 | 初始化完成后启动调度程序的延迟。 |
27+
| `api.boot.quartz.wait-for-jobs-to-complete-on-shutdown` || false | 是否等待正在运行的作业在关闭时完成。 |
28+
| `api.boot.quartz.overwrite-existing-jobs` || false | 配置的作业是否应覆盖现有的作业定义。 |
29+
| `api.boot.quartz.properties` || | Quartz自定义的配置属性,具体参考quartz配置 |
30+
| `api.boot.quartz.jdbc` || | 配置数据库方式的Jdbc相关配置 |
31+
| `api.boot.quartz.prop.job-store-class` || org.quartz.impl.jdbcjobstore.JobStoreTX | 任务数据源类 |
32+
| `api.boot.quartz.prop.job-store-cluster-checkin-interval` || 20000 | 集群检查时间 |
33+
| `api.boot.quartz.prop.scheduler-instance-id` || AUTO | 调度器ID |
34+
| `api.boot.quartz.prop.scheduler-instance-name` || jobScheduler | 调度器名称 |
35+
| `api.boot.quartz.prop.job-store-table-prefix` || QRTZ_ | 表结构前缀 |
36+
| `api.boot.quartz.prop.job-store-clustered` || true | 是否开启任务数据集群 |
37+
| `api.boot.quartz.prop.job-store-driver-delegate-class` || org.quartz.impl.jdbcjobstore.StdJDBCDelegate | 任务数据源驱动类 |
38+
| `api.boot.quartz.prop.thread-pool-threads-inherit-context-class-loader-of-initializing-thread` || true | 线程继承上下文类加载或定义线程 |
3139

3240
### 内存方式
3341

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
44
<modelVersion>4.0.0</modelVersion>
5-
<!--<parent>
5+
<parent>
66
<groupId>org.minbox.framework</groupId>
77
<artifactId>oss-parent</artifactId>
88
<version>0.1.0.RELEASE</version>
99
<relativePath>../oss-parent</relativePath>
10-
</parent>-->
10+
</parent>
1111
<packaging>pom</packaging>
1212
<modules>
1313
<module>api-boot-project</module>

0 commit comments

Comments
 (0)