spring定时任务

<bean id="TaskAuto" class="cn.com.opendata.util.timer.TaskAuto">
	<property name="cateringTaskManager">
		<ref bean="CateringTaskManager"/>
	</property>
</bean>
	<bean id="jobDetail"
		class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
		<property name="targetObject">
			<ref bean="TaskAuto" />
		</property>
		<property name="targetMethod">
			<value>run</value>
		</property>
	</bean>
	<bean id="cronTrigger"
		class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail">
			<ref bean="jobDetail"/>
		</property>
		<property name="cronExpression">
			<!-- run time five minute -->
			<value>0 30 23 * * ?</value>
		</property>
	</bean>
	<bean
		class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="triggers">
			<list>
				<ref local="cronTrigger" />
			</list>
		</property>
	</bean>

 

你可能感兴趣的:(spring,bean,quartz)