Spring 定时器:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN"
"http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<!-- Spring定时器 -->
<!-- 被调度的bean -->
<bean id="zhang"
class="com.doone.sp.information.listener.SPTime">
<property name="sp_InformationService"
ref="sp_InformationService"/>
<property name="tlsmsFacade" ref="tlsmsFacade"/>
<property name="mailFacade" ref="mailFacade"/>
<property name="complainService" ref="complainService"/>
</bean>
<!-- 指定任务中执行的方法:fixedTime,把任务类的注入给Spring -->
<bean id="zhangweiTime"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailF
actoryBean" >
<property name="targetObject" >
<ref local="zhang"/>
</property>
<property name="targetMethod" >
<value>fixedTime</value>
</property>
</bean>
<!-- 设置定时器时间,为每天早上10点执行 -->
<bean id="crozhangwei"
class="org.springframework.scheduling.quartz.CronTriggerBean" >
<property name="jobDetail" >
<ref bean="zhangweiTime"/>
</property>
<property name="cronExpression" >
<value>0 00 10 * * ? *</value>
</property>
</bean>
<!-- 执行定时器 -->
<bean lazy-init="false"
class="org.springframework.scheduling.quartz.SchedulerFactoryBean"
>
<property name="triggers" >
<list>
<ref bean="crozhangwei" />