使用spring定时器实现方法定时执行

xml version="1.0" encoding="UTF-8"?>
xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:oscache="http://www.springmodules.org/schema/oscache"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
      http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
      http://www.springframework.org/schema/mvc
      http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
      http://www.springframework.org/schema/context
      http://www.springframework.org/schema/context/spring-context-3.2.xsd
      http://www.springframework.org/schema/aop
      http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
      http://www.springframework.org/schema/tx
      http://www.springframework.org/schema/tx/spring-tx-3.2.xsd ">




        
        id="SpringJobSchedulerFactoryBean" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            name="triggers">
                
                    bean="CronTriggerBean5"/>    
                
            
            name="taskExecutor" ref="executor" />
        

        
        
        
        id="CronTriggerBean5" class="org.springframework.scheduling.quartz.CronTriggerBean">
            name="jobDetail" ref="SpringQtzJobMethod5">
            name="cronExpression" value="0/5 * * * * ?">
        



        
        id="SpringQtzJob5" class="com.quartz.OrderSettleDetail"/>
        id="SpringQtzJobMethod5"         class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
            name="targetObject">
                bean="SpringQtzJob5"/>
            

            name="targetMethod"> 
                execute     
            
        

你可能感兴趣的:(spring)