Spring timer (1), spring timer (
1. spring application. xml configuration file
1 <? Xml version = "1.0" encoding = "UTF-8"?> 2 <beans xmlns = "http://www.springframework.org/schema/beans" xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" 3 xmlns: tx = "http://www.springframework.org/schema/tx" xmlns: aop = "http://www.springframework.org/schema/aop" 4 xmlns: context = "http://www.springframework.org/schema/context" xmlns: dwr = "http://www.directwebremoting.org/schema/spring-dwr" 5 xsi: schemaLocation = "http://www.springframework.o Rg/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 6 http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd 7 http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd 8 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1. Xsd 9 http://www.directwebremoting.org/schema/spring-dwr http://www.directwebremoting.org/schema/spring-dwr-3.0.xsd "> 10 <bean id =" ××× DaemonJob "11 class =" org. springframework. scheduling. quartz. jobDetailBean "> 12 <property name =" jobClass "13 value =" com. ×××. ×××. Daemon. ××× Daemon "/> 14 15 <property name =" jobDataAsMap "> 16 <map> 17 18 </map> 19 </property> 20 </bean> 21 22 <bean id = "×××daemonjobtrigger" 23 class = "org. springframework. scheduling. quartz. simpleTriggerBean "> 24 25 <property name =" jobDetail "ref =" ××× DaemonJob "/> 26 <property name =" repeatInterval "value =" 300000 "/> 27 <property name = "startDelay" value = "1000"/> 28 </bean> 29 30 <bean class = "org. springframework. scheduling. quartz. schedulerFactoryBean "> 31 <property name =" triggers "> 32 <list> 33 <ref bean =" ××× DaemonJobTrigger "/> 34 </list> 35 </property> 36 </bean> 37 38 39 </beans>View Code