From e9cd48108b5ee9ecf188977310d72eecd0b2428f Mon Sep 17 00:00:00 2001 From: qibaoguang Date: Sun, 8 Feb 2015 21:47:59 +0800 Subject: [PATCH] Update 22.7. Application exit.md --- IV. Spring Boot features/22.7. Application exit.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/IV. Spring Boot features/22.7. Application exit.md b/IV. Spring Boot features/22.7. Application exit.md index e69de29..959eef0 100644 --- a/IV. Spring Boot features/22.7. Application exit.md +++ b/IV. Spring Boot features/22.7. Application exit.md @@ -0,0 +1,5 @@ +### 22.7. Application退出 + +每个SpringApplication在退出时为了确保ApplicationContext被优雅的关闭,将会注册一个JVM的shutdown钩子。所有标准的Spring生命周期回调(比如,DisposableBean接口或@PreDestroy注解)都能使用。 + +此外,如果beans想在应用结束时返回一个特定的退出码(exit code),可以实现org.springframework.boot.ExitCodeGenerator接口。