exit

open fun exit(context: ApplicationContext, exitCodeGenerators: Array<ExitCodeGenerator>): Int

Static helper that can be used to exit a SpringApplication and obtain a code indicating success (0) or otherwise. Does not throw exceptions but should print stack traces of any encountered. Applies the specified ExitCodeGenerators in addition to any Spring beans that implement ExitCodeGenerator. When multiple generators are available, the first non-zero exit code is used. Generators are ordered based on their Ordered implementation and @Order annotation.

Return

the outcome (0 if successful)

Parameters

context

the context to close if possible

exitCodeGenerators

exit code generators