-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
25 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
spring-shell-docs/src/main/asciidoc/using-shell-customization-contextclose.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[[using-shell-customization-contextclose]] | ||
=== Context Close | ||
|
||
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. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters