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>

猜你喜欢

转载自jackaney.iteye.com/blog/1233325