MDA/MDD/TDD/DDD/DDDDDDD
          posts - 536, comments - 111, trackbacks - 0, articles - 0
            BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

          在spring中使用quartz

          Posted on 2008-07-11 23:44 leekiang 閱讀(282) 評論(0)  編輯  收藏 所屬分類: spring
          0 0-15 23 * * ? ? 每天23:00至23:15每分鐘觸發(fā)一次
          0 0/5 * * * ????? 每隔5分鐘觸發(fā)一次
          0 15 10 L * ? ? ? 每月最后一日的上午10:15觸發(fā)

          bean配置的順序:
          定時器的工廠bean-->cronbean-->具體實現的bean

          <bean
          ????????
          class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
          ????????
          <property?name="triggers">
          ????????????
          <list>
          ????????????????
          <ref?bean="cronExpReport"?/>
          ????????????
          </list>
          ????????
          </property>
          ????
          </bean>

          ????
          <!--?每天23:00至23:15每分鐘一次觸發(fā)?-->
          ????
          <bean?id="cronExpReport"
          ????????class
          ="org.springframework.scheduling.quartz.CronTriggerBean">
          ????????
          <property?name="jobDetail">
          ????????????
          <ref?bean="detailBean"?/>
          ????????
          </property>
          ????????
          <property?name="cronExpression">
          ????????????
          <value>0?0-15?23?*?*??</value>
          ????????
          </property>
          ????
          </bean>

          <bean?id="detailBean"
          ????????class
          ="org.springframework.scheduling.quartz.JobDetailBean">
          ????????
          <property?name="jobClass">
          ????????????
          <value>com.bo.detailBO</value>
          ????????
          </property>
          ????????
          <property?name="jobDataAsMap">
          ????????????
          <map>
          ?????????????????
          <entry?key="baseBO">
          ????????????????????
          <ref?bean="baseBO"?/>
          ????????????????
          </entry>
          ????????????
          </map>
          ????????
          </property>
          ?
          </bean>

          Define of cronExpression

          +------------------------------------+
          | Position | Meaning | Value Scope?? |
          +------------------------------------+
          | 1??????? | second? | 0-59? ??????? |
          +------------------------------------+
          | 2??????? | minute? | 0-59????????? |
          +------------------------------------+
          | 3??????? | hour??? | 0-23????????? |
          +------------------------------------+
          | 4??????? | day???? | 1-31????????? |
          +------------------------------------+
          | 5??????? | month?? | 1-12????????? |
          +------------------------------------+
          | 6??????? | week??? | 1-7?????????? |
          +------------------------------------+
          | 7? 可選? | year??? | 1970-2099???? |
          +------------------------------------+

          http://hi.baidu.com/tonent/blog/item/894e8b525124960a0cf3e3a1.html
          http://blog.csdn.net/changsure/archive/2007/03/27/1542194.aspx
          http://www.xici.net/b391997/d26742282.htm
          主站蜘蛛池模板: 鄂尔多斯市| 岑巩县| 梁山县| 莱州市| 宁远县| 古田县| 西藏| 石渠县| 贵港市| 金溪县| 衡东县| 库车县| 平乡县| 新民市| 扬州市| 东辽县| 双鸭山市| 庆云县| 龙岩市| 茌平县| 安阳县| 杭州市| 九台市| 叙永县| 桂阳县| 镶黄旗| 富民县| 灵宝市| 行唐县| 陆河县| 吉林省| 元氏县| 永安市| 凤冈县| 灵寿县| 襄垣县| 浠水县| 丘北县| 昔阳县| 利川市| 岳阳市|