Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 为什么@EnableScheduling在默认情况下未启用?_Java_Spring_Spring Boot_Spring Scheduled - Fatal编程技术网

Java 为什么@EnableScheduling在默认情况下未启用?

Java 为什么@EnableScheduling在默认情况下未启用?,java,spring,spring-boot,spring-scheduled,Java,Spring,Spring Boot,Spring Scheduled,在Spring中使用@Scheduled注释调度任务时,我们还需要在存在@springbootplication的主方法中包含@EnableScheduling 为什么默认情况下不启用此选项?例如,为什么@SpringBootApplication,它本身已经是一个just include@EnableScheduling?是因为我不知道这个注释有一些副作用吗?@EnableScheduling要求存在一个任务调度器,如果没有它,它会爆炸。要使用哪个任务计划程序很难确定。除此之外还有@Enabl

在Spring中使用
@Scheduled
注释调度任务时,我们还需要在存在
@springbootplication
的主方法中包含
@EnableScheduling


为什么默认情况下不启用此选项?例如,为什么
@SpringBootApplication
,它本身已经是一个just include
@EnableScheduling
?是因为我不知道这个注释有一些副作用吗?

@EnableScheduling
要求存在一个
任务调度器
,如果没有它,它会爆炸。要使用哪个任务计划程序很难确定。除此之外还有
@EnableAsync
您可以有一个异步调度方法,然后呢。并非每个应用程序都需要调度(或访问多线程)。@M.Deinum这应该是一个答案。
@EnableScheduling
要求存在
任务调度程序
,如果没有它,它会爆炸。要使用哪个任务计划程序很难确定。除此之外还有
@EnableAsync
您可以有一个异步调度方法,然后呢。并非每个应用程序都需要调度(或访问多线程)。@M.Deinum这应该是一个答案。