Spring Boot 2.0 Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

How it works...

@EnableScheduling, as many other annotations that we have discussed and will discuss in this book, is not a Spring Boot; it is a Spring Context module annotation. Similar to the @SpringBootApplication and @EnableAutoConfiguration annotations, this is a meta-annotation and internally imports  SchedulingConfiguration via the @Import(SchedulingConfiguration.class) instruction, which can be found inside ScheduledAnnotationBeanPostProcessor that will be created by the imported configuration and will scan the declared Spring beans for the presence of the @Scheduled annotations. For every annotated method without arguments, the appropriate executor thread pool will be created. It will manage the scheduled invocation of the annotated method.