`

Spring Job配置

 
阅读更多
<bean id="weatherQuartz" class="com.WeatherQuartz"></bean>
<!-- weather job -->
<bean id="weatherJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject">
<ref local="weatherQuartz"/>
</property>
<property name="targetMethod">
<value>weatherJob</value>
</property>
<property name="concurrent">
<value>false</value>
</property>
</bean>


<bean id="weatherJobCron" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail">
<ref bean="weatherJob" />
</property>  
<property name="cronExpression">
<value>0 0/1 * * * ?</value>
</property>
</bean>


<bean autowire="no"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="weatherJobCron"/>
</list>
</property>
</bean>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics