ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
[TOC] ``` <!--quartz依赖--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-quartz</artifactId> </dependency> ``` Springboot自动装配了啥? - 自动装配类:`org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration` - 默认属性:`org.springframework.boot.autoconfigure.quartz.QuartzProperties` ## 自问自答 `org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration#customize` ## Quartz的启动过程 org.quartz.ee.jmx.jboss.QuartzService#startService ![](https://img.kancloud.cn/31/4e/314e0c6f221aeac6004d10ce4109fe73_600x498.png) 若quartz是配置在spring中,当服务器启动时,就会装载相关的bean。SchedulerFactoryBean实现了InitializingBean接口,因此在初始化bean的时候,会执行afterPropertiesSet方法, 该方法将会调用SchedulerFactory(DirectSchedulerFactory或者StdSchedulerFactory,通常用StdSchedulerFactory)创建Scheduler。