Files
spring-shell/spring-shell-docs/modules/ROOT/pages/using-shell-customization-contextclose.adoc
Janne Valkealahti af519b5766 Context close docs
- Relates #863
2023-09-12 08:08:39 +03:00

26 lines
830 B
Plaintext

[[using-shell-customization-contextclose]]
= Context Close
:page-section-summary-toc: 1
ifndef::snippets[:snippets: ../../test/java/org/springframework/shell/docs]
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.
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.
[source, yaml]
----
spring:
shell:
context:
close: true
----
NOTE: This setting is not enabled by default.