spring-quartz.xml 2.58 KB
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="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-4.0.xsd">
		
	<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
	<property name="applicationContextSchedulerContextKey" value="applicationContextKey" />
	<property name="schedulerName" value="CRM-SCHEDULER"></property>
	<property name="dataSource" ref="dataSource" />
	<property name="configLocation" value="classpath:quartz/quartz.properties" />
	<property name="waitForJobsToCompleteOnShutdown" value="true"></property>
	<property name="triggers">  
        <list>  
            <ref bean="quartzConditionTagTrigger"/>
			<ref bean="quartzTemplateTagTrigger"/>
        </list>  
    </property>
	</bean>
	
    
    <bean id="quartzConditionTagTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="name" value="ConditionTagTrigger"/>
        <property name="group" value="DAILY"/>
        <property name="cronExpression" value="0 0 1 * * ? *"/>
        <property name="jobDetail" ref="quartzConditionTagJob"/>
    </bean>
	
	<bean id="quartzConditionTagJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
        <property name="name" value="ConditionTagJob"/>
        <property name="group" value="DAILY"/>
        <property name="jobClass" value="cn.runsa.crmapp.customer.task.CustomerConditionTagTask"/>
        <property name="description" value="\u6BCF\u65E5\u5347\u7EA7\u4EFB\u52A1"/>
    </bean>
    
    <bean id="quartzTemplateTagTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
        <property name="name" value="TemplateTagTrigger"/>
        <property name="group" value="DAILY"/>
        <property name="cronExpression" value="0 0 1 * * ? *"/>
        <property name="jobDetail" ref="quartzTemplateTagJob"/>
    </bean>
	
	<bean id="quartzTemplateTagJob" class="org.springframework.scheduling.quartz.JobDetailFactoryBean">
        <property name="name" value="TemplateTagJob"/>
        <property name="group" value="DAILY"/>
        <property name="jobClass" value="cn.runsa.crmapp.customer.task.CustomerTemplateTagTask"/>
        <property name="description" value="\u6BCF\u65E5\u5347\u7EA7\u4EFB\u52A1"/>
    </bean>
</beans>