applicationContext-quartz.xml 2.4 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:util="http://www.springframework.org/schema/util" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context"
	xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx"
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="
			http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
            http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd  
            http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">

		<!-- <description>定时任务调度配置</description> -->
	
		<bean id="jobInvokeBean" class="com.sibu.orderHelper.integralWeb.quart.ScheduleTask"></bean>
		
		<bean id="generateRoomStock"  
			class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  
			<property name="targetObject" ref="jobInvokeBean"/>  
			<property name="targetMethod" value="generateRoomStock" />  
			<property name="concurrent" value="false" />
		</bean>  
		
		
		<bean id="generateRoomStockCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">  
			<property name="jobDetail" ref="generateRoomStock" />  
			<property name="cronExpression" value="0 0/30 3-5 * * ?" />  
		</bean> 
		
		<!-- 定时发送入住前通知短信 -->
		<bean id="sendCheckinNoticeMessage"  
			class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">  
			<property name="targetObject" ref="jobInvokeBean"/>  
			<property name="targetMethod" value="sendCheckinHotelNoticeMessage" />  
			<property name="concurrent" value="false" />
		</bean>
		
		<bean id="sendCheckinNoticeMessageCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">  
			<property name="jobDetail" ref="sendCheckinNoticeMessage" />  
			<property name="cronExpression" value="0 0 8 * * ?" />  
		</bean>



	<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
			<property name="triggers">  
			<list>  
				<ref bean="generateRoomStockCronTrigger" />  
				<ref bean="sendCheckinNoticeMessageCronTrigger" />
			</list>  
			</property>  
		</bean>  
</beans>