spring-boot - spring boot 中生命周期阶段号的来源
问题描述
停止 SpringBoot 应用程序时,可以看到如下所示的 INFO 日志消息。那个阶段数是从哪里来的?
o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483647
解决方案
Spring Framework 在org.springframework.context.SmartLifecycle接口中默认将该值设置为 2147483647
int DEFAULT_PHASE = Integer.MAX_VALUE;
确认:
jshell> Integer.MAX_VALUE
$1 ==> 2147483647
推荐阅读
- amazon-web-services - 将 AWSGlue 用作 Hive Metastore,其中数据位于 S3 中
- python-3.x - 如何在集群 (qsub) 中重新启动失败的 PBS 作业?
- xml - Jmeter自动添加标签
- jquery - 使用 jQuery 在悬停时显示链接
- r - TermDocumentMatrix 没有响应 Tokenizer
- regex - 使用“匹配”的不区分大小写的正则表达式匹配
- c# - 在 Windows 上将 nde.js 和 puppeteer 作为衍生进程运行会出现错误 puppeteer.launch is not a function
- dask - Dask 上的性能和数据操作
- node.js - Nodemailer sendMail功能完成后发送确认响应?
- r - r:以编程方式规范化和命名变量