<!-- 定时器 -->
<bean id="myTimer" class="service.Log_Service"></bean>
<!-- 定时器配置 -->
<bean id="timeDitail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="myTimer"></property><!-- 指定任务类 -->
<property name="targetMethod" value="Timer"></property> <!--指定任务方法-->
</bean>
<!-- 定义时间间隔触发器 -->
<bean id="timeTigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="timeDitail"></property>
<property name="cronExpression">
<value>0/60 * * * * ?</value>
</property>
</bean>
<!-- 启动定时器 -->
<bean id="startJob" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="timeTigger"/>
</list>
</property>
</bean>
<bean id="myTimer" class="service.Log_Service"></bean>
<!-- 定时器配置 -->
<bean id="timeDitail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="myTimer"></property><!-- 指定任务类 -->
<property name="targetMethod" value="Timer"></property> <!--指定任务方法-->
</bean>
<!-- 定义时间间隔触发器 -->
<bean id="timeTigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="timeDitail"></property>
<property name="cronExpression">
<value>0/60 * * * * ?</value>
</property>
</bean>
<!-- 启动定时器 -->
<bean id="startJob" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="timeTigger"/>
</list>
</property>
</bean>