Spring 调度器 - 如何知道调度器状态? [活跃或不活跃]

Spring Scheduler - How to know the Scheduler Status? [Active or Inactive]

我正在使用 Spring boot 2.0.0。对于 Spring 调度程序,在我的启动 class 中实施 org.springframework.scheduling.annotation.SchedulingConfigurer 并且我从 UI 到 API 服务启动调度程序。调度程序 运行 正常。

我如何知道当前 运行ning 调度程序状态?如果我再次尝试 运行 相同的调度程序,如何配置任何错误或异常,以便我们知道它已经 运行ning?

我不知道是否有一些内置功能,但您仍然可以在调度程序启动和停止时设置一个 AtomicBoolean 并创建 web 服务来获取值。