摘要: // 静态代码块:注册JVM关闭钩子(备用保障) static { Runtime.getRuntime().addShutdownHook(new Thread(() -> { if (pool == null) return; if (!pool.isShutdown()) { shutdown 阅读全文
posted @ 2026-02-10 17:39 庶旁 阅读(2) 评论(0) 推荐(0)
摘要: @Configuration 配合 @Bean 与 @Service 等组件扫描注解(如 @Component、@Controller、@Repository)都是 Spring 中用于将类注册为 Bean 的方式,但它们在设计意图、使用场景和底层机制上存在本质区别。 核心区别总结 特性 @Conf 阅读全文
posted @ 2026-02-10 11:38 庶旁 阅读(5) 评论(0) 推荐(0)