Spring事件驱动模块图
2020-08-03 00:52:34 15 举报
spring事件驱动
作者其他创作
大纲/内容
ListenerCacheKey
Set<ApplicationListener<?>> applicationListeners
实现
ApplicationEvent
AbstractApplicationEventMulticaster
具体实现add和remove监听器
getAll
依赖
SimpleApplicationEventMulticaster具体实现广播操作(可异步)
multicastEvent(ApplicationEvent event)
hashCode相等
put
ListenerRetriever
hashCode() {\t\t\treturn this.eventType.hashCode() * 29 + ObjectUtils.nullSafeHashCode(this.sourceType);\t\t}
hashCode方法
未找到
具体实现ApplicationListener2
onApplicationEvent(E event)
ApplicationListener
继承
ApplicationEventMulticaster
addApplicationListener(ApplicationListener<?> listener)removeApplicationListener(ApplicationListener<?> listener)
具体实现ApplicationListener1
根据这个key去map查找value
value
add/remove
ApplicationEventPublisher
publishEvent(ApplicationEvent event)
收藏
收藏
0 条评论
回复 删除
下一页