@Async @Scheduled 调度

时间:2025-05-06 12:44:09
  • <?xml version="1.0" encoding="UTF-8"?>
  • <beans xmlns="/schema/beans" xmlns:xsi="http:///2001/XMLSchema-instance"
  • xmlns:jee="/schema/jee"
  • xmlns:tx="/schema/tx"
  • xmlns:context="/schema/context"
  • xmlns:aop="/schema/aop"
  • xmlns:task="/schema/task"
  • xsi:schemaLocation="/schema/beans /schema/beans/spring-beans-3.
  • /schema/tx /schema/tx/spring-tx-3.
  • /schema/jee /schema/jee/spring-jee-3.
  • /schema/context /schema/context/spring-context-3.
  • /schema/aop /schema/aop/spring-aop-3.
  • /schema/task /schema/task/spring-task-3."
  • default-lazy-init="true" default-autowire="byName">
  • <!-- 配置注解扫描 -->
  • <context:annotation-config />
  • <!-- 自动扫描的包名 -->
  • <context:component-scan base-package="" />
  • <!-- Spring定时器注解开关-->
  • <task:annotation-driven />
  • <!-- 此处对于定时时间的配置会被注解中的时间配置覆盖,因此,以注解配置为准 -->
  • <task:scheduled-tasks scheduler="myScheduler">
  • <task:scheduled ref="scheduledTaskManager" method="autoCardCalculate" cron="1/5 * * * * *"/>
  • </task:scheduled-tasks>
  • <task:scheduler id="myScheduler" pool-size="10"/>
  • <aop:aspectj-autoproxy />
  • <!-- 加载配置文件 -->
  • <bean id="propertyConfigurer" class="">
  • <property name="locations">
  • <list>
  • <value>classpath:</value>
  • </list>
  • </property>
  • </bean>
  • </beans>