Skip to content

Commit 5739df4

Browse files
committed
Context close docs
- Backport #863 - Relates #866
1 parent b9be826 commit 5739df4

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+

spring-shell-docs/src/main/asciidoc/using-shell-customization.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ include::using-shell-customization-logging.adoc[]
1010
include::using-shell-customization-commandnotfound.adoc[]
1111

1212
include::using-shell-customization-singlecommand.adoc[]
13+
14+
include::using-shell-customization-contextclose.adoc[]

0 commit comments

Comments
 (0)