spring任务调度配置方法
以下是spring完成的配置文件,只需在applicationContext.xml中引入这个xml就可以了
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
??? http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd">
<bean id="schedulerFactoryBean"
? />
?? </list>
? </property>
</bean>
<bean id="cornTrigger"
? />
? </property>
? <property name="cronExpression">
?? <value>* 30 * 1 * ?</value>
? </property>
</bean>
<!-- 定义个调度方案的ID-->
<bean id="ftpUpload"
? ref="backup"/>
<!-- 调度的类的bean的中的方法-->
? <property name="targetMethod" value="backupTodayFile" />
</bean>
?<!-- 调度的类的bean-->
<bean id="backup" class="com.ylink.jzcg.services.handle.ControlHandle"></bean>
</beans>
?