zoukankan      html  css  js  c++  java
  • Spring定时

    <!-- Spring的ScheduledTimerTimerTask定义了一个定时器任务的运行周期。应该如下装配一个ScheduledTimerTask
    timerTask告诉ScheduledTimerTask运行哪个TimerTask, 这里该装配属性指向reportTimerTask的一个引用。
    属性period告诉ScheduledTimerTask以怎样的频率调用TimerTask的run()方法。 这个属性以毫秒作为单位, 86400000指定该任务每24小时运行一次
    10X1000 属性scheduledTimerTasks 要求一个需要启动的定时器任务列表。 ScheduledTimerTask有一个delay属性,
    允许你指定当任务第一次运行之前应该等多久。 如,EmailReportTask的第一次运行延迟5毫秒 -->
    <bean id="scheduledReportTask" class="org.springframework.scheduling.timer.ScheduledTimerTask">
    <property name="timerTask">
    <ref bean="autoFlushSoftPatchStatusImpl" />
    </property>
    <!-- 10分钟轮询一次 -->
    <property name="period">
    <value>600000</value>
    </property>
    <!--5秒后开始进行轮询任务 -->
    <property name="delay">
    <value>5000</value>
    </property>
    </bean>

    <!--Spring 的TimerFactoryBean负责启动定时任务 -->
    <bean class="org.springframework.scheduling.timer.TimerFactoryBean" destroy-method="destroy">
    <property name="beanName" value="ecm-websvrswm-patchTask-timer"/>
    <property name="scheduledTimerTasks">
    <list>
    <ref bean="scheduledReportTask" />
    </list>
    </property>
    </bean>

  • 相关阅读:
    非线性数据结构——树
    排序算法之插入排序
    web框架之environment处理
    web开发之http和wsgi
    python os模块和shutil模块
    python路径操作
    stringIO和bytesIO
    python文件操作
    设计模式
    设计模式
  • 原文地址:https://www.cnblogs.com/qq1988627/p/6606875.html
Copyright © 2011-2022 走看看