<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    我的漫漫程序之旅

    專注于JavaWeb開發
    隨筆 - 39, 文章 - 310, 評論 - 411, 引用 - 0
    數據加載中……

    Quartz 關于CronTrigger 的 深入

    CronTrigger是比SimpleTrigger更為有用的.如果你想啟動一個工作任務,像日歷進程一樣.
    這個時候CronTrigger是比SimpleTrigger更為精確的.

    比如你可以指定: "每個星期五的下午","每個周末的上午9:30","每周一,周三的上午9點到10點,每5分鐘一次"

    這都需要Cron Excepressions 來描述.

    Cron-Excepressions是用來配置CronTrigger實例的.它有7個精確的子表達式,其中年是可選的.順序如下:

    1. Seconds
    2. Minutes
    3. Hours
    4. Day-of-Month
    5. Month
    6. Day-of-Week
    7. Year (optional field)
    讓我們來看看這個表達式的意思:

    "0 0 12 ? * WED"

    表示每個星期三的中午12點

    個別的子表達式是允許包含集合的,比如"MON, WED, FRI", 或  "MON-WED,SAT"
    中間用,號隔開.

    其中 * 號是代碼 "每" 的意思,就是此屬性的每一個可能值.
    在這里表示every Wednesday.

    ?號用在 day-of-month 和 day-of-week  屬性上.

    L代表Last,W代表Weekend

    #號指定每月的第幾個星期幾.如:FRI#3 意思是每月的第三個星期五.

    這有一些例子大家參考一下:

    Expression   Meaning 
    "0 0 12 * * ?"    Fire at 12pm (noon) every day 
    "0 15 10 ? * *"    Fire at 10:15am every day 
    "0 15 10 * * ?"    Fire at 10:15am every day 
    "0 15 10 * * ? *"    Fire at 10:15am every day 
    "0 15 10 * * ? 2005"    Fire at 10:15am every day during the year 2005  
    "0 * 14 * * ?"    Fire every minute starting at 2pm and ending at 2:59pm, every day  
    "0 0/5 14 * * ?"    Fire every 5 minutes starting at 2pm and ending at 2:55pm, every day  
    "0 0/5 14,18 * * ?"    Fire every 5 minutes starting at 2pm and ending at 2:55pm, AND fire every 5 minutes starting at 6pm and ending at 6:55pm, every day  
    "0 0-5 14 * * ?"    Fire every minute starting at 2pm and ending at 2:05pm, every day  
    "0 10,44 14 ? 3 WED"    Fire at 2:10pm and at 2:44pm every Wednesday in the month of March.  
    "0 15 10 ? * MON-FRI"    Fire at 10:15am every Monday, Tuesday, Wednesday, Thursday and Friday  
    "0 15 10 15 * ?"    Fire at 10:15am on the 15th day of every month  
    "0 15 10 L * ?"    Fire at 10:15am on the last day of every month  
    "0 15 10 ? * 6L"    Fire at 10:15am on the last Friday of every month  
    "0 15 10 ? * 6L"    Fire at 10:15am on the last Friday of every month  
    "0 15 10 ? * 6L 2002-2005"    Fire at 10:15am on every last friday of every month during the years 200220032004 and 2005  
    "0 15 10 ? * 6#3"    Fire at 10:15am on the third Friday of every month 
    使用此類也是很簡單的,比如你可以用如下代碼來替換SimpleTrigger部分:
    CronTrigger cronTrigger = new CronTrigger("myTrigger","myGroup","你的表達式");

    對于此部分大家沒必要全部記住,需要的時候去查API就行了.



    posted on 2008-05-08 17:44 々上善若水々 閱讀(4417) 評論(0)  編輯  收藏 所屬分類: opensource

    主站蜘蛛池模板: 精选影视免费在线 | 亚洲欧洲日产国码无码久久99 | 麻豆成人久久精品二区三区免费| 国产一级婬片A视频免费观看| 爱丫爱丫影院在线观看免费| 成人久久免费网站| 国产一精品一AV一免费孕妇| 国产精品va无码免费麻豆| 亚洲国产日韩一区高清在线 | 国产精品极品美女免费观看| 亚洲国产成人久久综合一区77| 亚洲人色婷婷成人网站在线观看| 久久久无码精品亚洲日韩蜜臀浪潮| 天堂亚洲国产中文在线| 免费视频精品一区二区| 久久国产色AV免费看| 国产极品粉嫩泬免费观看 | 国产在线观看xxxx免费| 国产成人午夜精品免费视频| 亚洲精品人成无码中文毛片| 亚洲成人黄色网址| a高清免费毛片久久| 毛片网站免费在线观看| 五月天网站亚洲小说| 久99久无码精品视频免费播放| 扒开双腿猛进入爽爽免费视频 | 亚洲国产成人精品无码区在线秒播| 精品国产日韩亚洲一区91| 成人免费毛片内射美女-百度| 亚洲中文字幕久久精品无码APP| 久久乐国产综合亚洲精品| 最近中文字幕2019高清免费 | 看全色黄大色大片免费久久| 亚洲欧洲春色校园另类小说| 51午夜精品免费视频| 免费a级毛片在线观看| 国产亚洲综合一区二区三区| 免费观看男人免费桶女人视频| 亚洲一区中文字幕在线观看| 人妻视频一区二区三区免费| 精品丝袜国产自在线拍亚洲|