<!-- 定时器 -->
<bean name="jobDetail" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.fangdi.landaudit.process.affiche.ExportProjects" />
</bean>
<bean name="wordToFtp" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="com.fangdi.landaudit.process.util.WordToFtp"></property>
</bean>
<bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="jobDetail" />
<property name="cronExpression" value="0 30 20 ? * MON-FRI" />
</bean>
<bean id="wordToFtpTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="wordToFtp"></property>
<property name="cronExpression" value="0 35 16 ? * *"></property>
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="cronTrigger" />
<ref bean="wordToFtpTrigger"/>
</list>
</property>
</bean>
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class Test implements Job{
public void execute(JobExecutionContext arg0) throws JobExecutionException {
try {
createDoc();
} catch (UnsupportedEncodingException e) {
log.info(e.getMessage());
e.printStackTrace();
}
}
}