Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
9c44f925
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
9c44f925
编写于
1月 31, 2010
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed cron example (SPR-6772)
上级
6070a498
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
11 deletion
+12
-11
org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java
...ngframework/scheduling/support/CronSequenceGenerator.java
+12
-11
未找到文件。
org.springframework.context/src/main/java/org/springframework/scheduling/support/CronSequenceGenerator.java
浏览文件 @
9c44f925
/*
* Copyright 2002-20
09
the original author or authors.
* Copyright 2002-20
10
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -28,20 +28,19 @@ import java.util.TimeZone;
import
org.springframework.util.StringUtils
;
/**
* Date sequence generator for a <a
* href="http://www.manpagez.com/man/5/crontab/">Crontab pattern</a> allowing
* client to specify a pattern that the sequence matches. The pattern is a list
* of 6 single space separated fields representing (second, minute, hour, day,
* month, weekday). Month and weekday names can be given as the first three
* letters of the English names.<br/>
* <br/>
* Date sequence generator for a <a href="http://www.manpagez.com/man/5/crontab/">Crontab pattern</a>,
* allowing clients to specify a pattern that the sequence matches.
*
* Example patterns
* <p>The pattern is a list of six single space-separated fields: representing
* second, minute, hour, day, month, weekday. Month and weekday names can be
* given as the first three letters of the English names.
*
* <p>Example patterns:
* <ul>
* <li>"0 0 * * * *" = the top of every hour of every day.</li>
* <li>"*/10 * * * * *" = every ten seconds.</li>
* <li>"0 0 8-10 * * *" = 8, 9 and 10 o'clock of every day.</li>
* <li>"0 0
8-10/3
0 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.</li>
* <li>"0 0
/30 8-1
0 * * *" = 8:00, 8:30, 9:00, 9:30 and 10 o'clock every day.</li>
* <li>"0 0 9-17 * * MON-FRI" = on the hour nine-to-five weekdays</li>
* <li>"0 0 0 25 12 ?" = every Christmas Day at midnight</li>
* </ul>
...
...
@@ -69,6 +68,7 @@ class CronSequenceGenerator {
private
final
TimeZone
timeZone
;
/**
* Construct a {@link CronSequenceGenerator} from the pattern provided.
* @param expression a space-separated list of time fields
...
...
@@ -81,6 +81,7 @@ class CronSequenceGenerator {
parse
(
expression
);
}
/**
* Get the next {@link Date} in the sequence matching the Cron pattern and
* after the value provided. The return value will have a whole number of
...
...
@@ -127,7 +128,7 @@ class CronSequenceGenerator {
List
<
Integer
>
resets
=
new
ArrayList
<
Integer
>();
int
second
=
calendar
.
get
(
Calendar
.
SECOND
);
List
<
Integer
>
emptyList
=
Collections
.
<
Integer
>
emptyList
();
List
<
Integer
>
emptyList
=
Collections
.
emptyList
();
int
updateSecond
=
findNext
(
this
.
seconds
,
second
,
calendar
,
Calendar
.
SECOND
,
Calendar
.
MINUTE
,
emptyList
);
if
(
second
==
updateSecond
)
{
resets
.
add
(
Calendar
.
SECOND
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录