File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
spring-shell-docs/src/main/asciidoc Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ [[using-shell-customization-contextclose]]
2+ === Context Close
3+
4+ Command execution logic happens via Spring Boot's `ApplicationRunner` beans.
5+ Normally Spring `ApplicationContext` closes automatically after these runner
6+ beans has been processed unless there is something what keeps it alive like
7+ use of `@EnableScheduling` or generally speaking there are threads which
8+ don't die automatically.
9+
10+ It is possible to add configuration property `spring.shell.context.close`
11+ which registers `ApplicationListener` for `ApplicationReadyEvent` and requests
12+ context close after shell has completed its execution logic.
13+
14+ [source, yaml]
15+ ----
16+ spring:
17+ shell:
18+ context:
19+ close: true
20+ ----
21+
22+ NOTE: This setting is not enabled by default.
23+
Original file line number Diff line number Diff line change @@ -10,3 +10,5 @@ include::using-shell-customization-logging.adoc[]
1010include::using-shell-customization-commandnotfound.adoc[]
1111
1212include::using-shell-customization-singlecommand.adoc[]
13+
14+ include::using-shell-customization-contextclose.adoc[]
You can’t perform that action at this time.
0 commit comments