当前位置:网站首页>Autowired注解用于List时的现象解析
Autowired注解用于List时的现象解析
2022-07-06 23:17:00 【kgduu】
1、现象
在一个处理链中,有多个AbstractHandler,一个是管理处理链的集合CompositeHandler。Handler1,Handler2, CompositeHandler是AbstractHandler的实现类。其中CompositeHandler实现为
@Component
@Slf4j
public class CompositeHandler extends AbstractHandler {
@Autowired
private List<AbstractHandler> handlers;
@Override
public int handlerOrder() {
// TODO Auto-generated method stub
return 0;
}
@PostConstruct
public void init() {
log.info("handlers:{}", handlers);
}
日志输出handlers只有2个,分别是Handler1, Handler2。为什么会是这种现象呢?
2、分析
DefaultListableBeanFactory在解析依赖List时,获取满足指定类型的候选beanNames,会过滤与当前beanName相等的。


边栏推荐
- 01 machine learning related regulations
- 第一篇论文的写作流程
- Decorator basic learning 02
- Using thread class and runnable interface to realize the difference between multithreading
- LinkedBlockingQueue源码分析-初始化
- Techniques d'utilisation de sublime
- [736. LISP syntax parsing]
- 【Android Kotlin协程】利用CoroutineContext实现网络请求失败后重试逻辑
- [ArcGIS tutorial] thematic map production - population density distribution map - population density analysis
- Appium practice | make the test faster, more stable and more reliable (I): slice test
猜你喜欢
![[Android kotlin collaboration] use coroutinecontext to realize the retry logic after a network request fails](/img/e0/04f06d464e77012fbfc919e07cbb66.png)
[Android kotlin collaboration] use coroutinecontext to realize the retry logic after a network request fails

基于Bevy游戏引擎和FPGA的双人游戏

U++ 游戏类 学习笔记
[email protected]映射关系问题"/>接口间调用为什么要用json、fastjson怎么赋值的、fastjson [email protected]映射关系问题

ThinkPHP关联预载入with

高手勿进!写给初中级程序员以及还在大学修炼的“准程序员”的成长秘籍

No experts! Growth secrets for junior and intermediate programmers and "quasi programmers" who are still practicing in Universities

指针与数组在函数中输入实现逆序输出

U++ metadata specifier learning notes

Inventory host list in ansible (I wish you countless flowers and romance)
随机推荐
Ansible中的inventory主机清单(预祝你我有数不尽的鲜花和浪漫)
STM32F103 realize IAP online upgrade application
Ansible概述和模块解释(你刚走过了今天,而扑面而来的却是昨天)
The most complete learning rate adjustment strategy in history LR_ scheduler
01机器学习相关规定
全链路压测:影子库与影子表之争
JS variable case output user name
指针与数组在函数中输入实现逆序输出
AttributeError: module ‘torch._ C‘ has no attribute ‘_ cuda_ setDevice‘
带你遨游银河系的 10 种分布式数据库
记录一次压测经验总结
拿到PMP认证带来什么改变?
PLC Analog output analog output FB analog2nda (Mitsubishi FX3U)
Knapsack problem (01 knapsack, complete knapsack, dynamic programming)
SQL injection - secondary injection and multi statement injection
Addressable 预下载
PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
《四》表单
STM32F103ZE+SHT30检测环境温度与湿度(IIC模拟时序)
Window scheduled tasks