Context Close
命令执行逻辑通过 Spring Boot 的 ApplicationRunner
Bean 发生。通常,Spring ApplicationContext
在这些 Runner Bean 处理后会自动关闭,除非有某些内容使其保持活动状态,如 @EnableScheduling
,或者从广义上讲,有一些线程不会自动死亡。
Command execution logic happens via Spring Boot’s ApplicationRunner
beans.
Normally Spring ApplicationContext
closes automatically after these runner
beans has been processed unless there is something what keeps it alive like
use of @EnableScheduling
or generally speaking there are threads which
don’t die automatically.
可以添加配置属性 spring.shell.context.close
,它为 ApplicationReadyEvent
注册 ApplicationListener
,并在 Shell 完成其执行逻辑后请求上下文关闭。
It is possible to add configuration property spring.shell.context.close
which registers ApplicationListener
for ApplicationReadyEvent
and requests
context close after shell has completed its execution logic.
spring:
shell:
context:
close: true
此设置默认情况下未启用。 |
This setting is not enabled by default. |