关于Spring中对Quartz的配置


<bean id = "test" class="com.luna.TestQuartz">
    </bean>
    <bean id = "testJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
    	<property name = "targetObject">
    		<ref bean="test"/>
    	</property>
    	<property name = "targetMethod">
    		<value>testMothod</value>
    	</property>
    </bean>
    <bean id = "testTrigger" class = "org.springframework.scheduling.quartz.SimpleTriggerBean">
    	<property name = "jobDetail" ref="testJob"/>
    	<property name = "startDelay">
    		<value>2000</value>
    	</property>
    	<property name = "repeatInterval">
    		<value>600000</value>
    	</property>
    </bean>
    <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> 
		<property name="triggers"> 
		<list> 
		<ref bean="testTrigger"/> 
		</list> 
		</property> 
	</bean> 

猜你喜欢

转载自primeton-livemail-tw.iteye.com/blog/1093883