public class DynamicThreadPoolAnnotationUtil extends Object
DynamicThreadPoolAnnotationUtil 是为了适配低版本 SpringBoot.
Spring version >= 5.2.0 下述方法才是有效的, 等同于 SpringBoot version 2.2.0.RELEASE
ListableBeanFactory.findAnnotationOnBean(java.lang.String, java.lang.Class)
但这不是一个优雅的实现方式, 因为其中用到了很多强类型转换, 不确定后续 Spring 升级是否会受影响. 不过, 可以确定的是 Spring version < 5.3.14 是没问题的, 等同于 SpringBoot version < 2.6.2
| 构造器和说明 |
|---|
DynamicThreadPoolAnnotationUtil() |
public static <A extends Annotation> A findAnnotationOnBean(String beanName, Class<A> annotationType)
A - beanName - annotationType - Copyright © 2022. All rights reserved.