11<?xml version =" 1.0" encoding =" UTF-8" ?>
2- <beans xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3- xmlns:task=" http://www.springframework.org/schema/task" xmlns : context =" http://www.springframework.org/schema/context"
4- xsi:schemaLocation=" http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd
2+ <beans xmlns =" http://www.springframework.org/schema/beans"
3+ xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns : task =" http://www.springframework.org/schema/task"
4+ xmlns:context=" http://www.springframework.org/schema/context"
5+ xsi:schemaLocation="
6+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
7+ http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.1.xsd
58 http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.1.xsd" >
69
10+ <context : property-placeholder location =" classpath:springScheduled.properties" />
11+
712 <!-- Configure the scheduler -->
813 <task : scheduler id =" myScheduler" pool-size =" 10" />
914
10- <bean id =" myscheduler" name =" myscheduler"
11- class=" org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler" >
12- </bean >
15+ <bean id =" myscheduler"
16+ class=" org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler" />
1317
1418 <!-- Configure the fixedDealy, fixedRate or cron based schduled tasks -->
19+ <bean id =" schedulingWithXmlConfig" class =" org.baeldung.scheduling.SchedulingWithXmlConfig" />
20+
1521 <task : scheduled-tasks scheduler =" myScheduler" >
16- <task : scheduled ref =" beanA " method =" methodA " fixed-delay =" 5000 " initial-delay =" 1000" />
17- <task : scheduled ref =" beanB " method =" methodB " fixed-rate =" 5000 " />
18- <task : scheduled ref =" beanC " method =" methodC " cron =" */5 * * * * MON-FRI " />
22+ <task : scheduled ref =" schedulingWithXmlConfig " method =" scheduleFixedDelayTask " fixed-delay =" ${fixedDelay.in.milliseconds} " initial-delay =" 1000" />
23+ <task : scheduled ref =" schedulingWithXmlConfig " method =" scheduleFixedRateTask " fixed-rate =" ${fixedRate.in.milliseconds} " />
24+ <task : scheduled ref =" schedulingWithXmlConfig " method =" scheduleTaskUsingCronExpression " cron =" ${cron.expression} " />
1925 </task : scheduled-tasks >
2026</beans >
0 commit comments