Spring Quartz

https://www.cnblogs.com/SpaceAnt/p/6354446.html

<bean id="Scheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
		<property name="triggers">
			<list>
				<ref bean="HangJVMDetectorCronTrigger"/>
			</list>
		</property>
	</bean>
	
	<bean id="HangJVMDetectorCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
		<property name="jobDetail" ref="HangJVMDetectorJobDetail" />
		<property name="cronExpression" value="0 0/5 * ? * *" />
	</bean>	
	<bean id="HangJVMDetectorJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
		<property name="targetObject" ref="HangJVMDetector" />
		<property name="targetMethod" value="execute" />
		<property name="concurrent" value="false" />
	</bean>	
	<bean id="HangJVMDetector" class="com.citifutures.foam.scheduler.HangJVMDetector">
		<property name="mailSender" ref="mailSender" />
		<property name="hangJVMMailMessage" ref="HangJVMMailMessage" />
		<property name="heartBeatHandler" ref="HeartBeatHandlerImpl" />
		<property name="hangMinute" value="2" />
		
	</bean>

相关推荐