quartz

<context:component-scan base-package="com.sys..." />

<bean id="myTask" class="org.springframework.scheduling.timer.MethodInvokingTimerTaskFactoryBean">
        <property name="targetObject" ref="myService" />
        <property name="targetMethod" value="myMothod"/>
    </bean>
    <bean id="myTimer" class="org.springframework.scheduling.timer.ScheduledTimerTask">
        <property name="period" value="1000"/>
        <property name="delay" value="1000"/>
        <property name="fixedRate" value="false"/>
        <property name="timerTask" ref="myTask"/>
    </bean>
    <bean id="myRunner" class="org.springframework.scheduling.timer.TimerFactoryBean" lazy-init="false">
        <property name="scheduledTimerTasks">
            <list>
                <ref bean="myTimer"/>
            </list>
        </property>
    </bean>

你可能感兴趣的:(quartz)