当前位置:网站首页>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相等的。
边栏推荐
- U++4 接口 学习笔记
- npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
- Full link voltage test: the dispute between shadow database and shadow table
- 带你遨游银河系的 10 种分布式数据库
- Servicemesh mainly solves three pain points
- 3. Type of fund
- 高数中值定理总结
- 一文搞懂常见的网络I/O模型
- Inventory host list in ansible (I wish you countless flowers and romance)
- Analysis -- MySQL statement execution process & MySQL architecture
猜你喜欢
为什么很多人对技术债务产生误解
批量归一化(标准化)处理
LabVIEW在打开一个新的引用,提示内存已满
01 machine learning related regulations
Pointer and array are input in function to realize reverse order output
记录一次压测经验总结
The sooner you understand the four rules of life, the more blessed you will be
pmp真的有用吗?
PMP证书有没有必要续期?
Ansible报错:“msg“: “Invalid/incorrect password: Permission denied, please try again.“
随机推荐
2039: [蓝桥杯2022初赛] 李白打酒加强版 (动态规划)
精彩速递|腾讯云数据库6月刊
[Yugong series] go teaching course 005 variables in July 2022
动态生成表格
npm ERR! 400 Bad Request - PUT xxx - “devDependencies“ dep “xx“ is not a valid dependency name
记录一次压测经验总结
Addressable 预下载
与利润无关的背包问题(深度优先搜索)
[736. LISP syntax parsing]
Leetcode(417)——太平洋大西洋水流问题
Understand common network i/o models
3. Type of fund
Why do many people misunderstand technical debt
【最佳网页宽度及其实现】「建议收藏」
Pointer and array are input in function to realize reverse order output
01机器学习相关规定
《二》标签
app内嵌h5---iphone软键盘遮挡输入文字
Servicemesh mainly solves three pain points
STM32F103ZE+SHT30检测环境温度与湿度(IIC模拟时序)