This commit is contained in:
redkale
2023-12-29 12:05:42 +08:00
parent ce94610a72
commit 62042d3aaa
2 changed files with 6 additions and 6 deletions

View File

@@ -7,9 +7,9 @@
|name|未定义|名称, 可用于第三方实现的定时任务组件的key, 比如xxl-job的任务标识|
|cron|未定义|cron表达式也可以使用常量值: <br> @yearly、@annually、@monthly、@weekly、<br> @daily、@midnight、@hourly、@minutely <br> @1m、@2m、@3m、@5m、@10m、@15m、@30m <br> @1h、@2h、@3h、@6h <br> ${env.scheduling.cron}: 读取系统配置项|
|zone|未定义|时区,```cron```有值才有效, 例如: "UTC+08"|
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.fixedDelay}: 读取系统配置项 <br> #delays: 读取宿主对象的delays字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.fixedRate}: 读取系统配置项 <br> #intervals: 读取宿主对象的intervals字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.initialDelay}: 读取系统配置项 <br> #inits: 读取宿主对象的inits字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp;字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|fixedDelay|-1|延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.fixedDelay}: 读取系统配置项 <br> #delays: 读取宿主对象的delays字段值作为值, <br> &emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleWithFixedDelay |
|fixedRate|-1|周期时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.fixedRate}: 读取系统配置项 <br> #intervals: 读取宿主对象的intervals字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 字段类型必须是int、long数值类型 <br> 值大于0且fixedRate小于0则使用 ScheduledThreadPoolExecutor.scheduleAtFixedRate |
|initialDelay|-1|起始延迟时间,负数为无效值,支持参数配置、乘法表达式和对象字段值 <br> 参数值支持方式:<br> 100: 设置数值 <br> 5*60: 乘法表达式值为30 <br> ${env.scheduling.initialDelay}: 读取系统配置项 <br> #inits: 读取宿主对象的inits字段值作为值, <br> &emsp;&emsp;&emsp;&emsp;字段类型必须是int、long数值类型 <br> 值大于0且fixedRate和fixedDelay小于0则使用 ScheduledThreadPoolExecutor.schedule |
|timeUnit|```TimeUnit.SECONDS```|时间单位TimeUnit|
|comment|未定义|备注描述|
|mode|```LoadMode.LOCAL```|作用于Service模式默认值为LOCAL<br> LOCAL: 表示远程模式的Service对象中的定时任务不起作用|

View File

@@ -1,9 +1,9 @@
# Service组件
&emsp;&emsp;Service是Redkale最核心的组件主要处理业务逻辑和操作数据层。Service实例分两种模式: <b>本地模式</b><b>远程模式</b>。其模式由```conf/application.xml```文件来配置。开发人员在调用过程中通常不需要区分Service实例是哪种模式。 <br/>
&emsp;&emsp;并不是Sevice都能进行本地和远程模式切换 以下情况的Service不能转成远程模式:
&emsp;&emsp;&emsp;&emsp; 1、Service类修饰为```final``` <br>
&emsp;&emsp;&emsp;&emsp; 2、Service类被标记```@Local``` <br>
&emsp;&emsp;&emsp;&emsp; 3、Service类被标记```@Component``` <br>
&emsp;&emsp;&emsp;&emsp; 1、类修饰为```final``` <br>
&emsp;&emsp;&emsp;&emsp; 2、类被标记```@Local``` <br>
&emsp;&emsp;&emsp;&emsp; 3、类被标记```@Component``` <br>
&emsp;&emsp;Redkale进程启动时扫描可加载的Service实现类根据配置文件配置的模式采用```ASM```技术动态生成相应的Service临时类进行实例化并注册到ResourceFactory同其他Service、Servlet依赖注入。