Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

480面构建泛型事件 #93

Open
KingS770234358 opened this issue Mar 27, 2021 · 2 comments
Open

480面构建泛型事件 #93

KingS770234358 opened this issue Mar 27, 2021 · 2 comments

Comments

@KingS770234358
Copy link

我没看错的话,在480面构建泛型事件的例子中,构建泛型事件的代码和构建用户事件监听器的代码完全重复。

@KingS770234358
Copy link
Author

实际的代码应该在
thinking-in-spring-boot-samples/spring-framework-samples/spring-framework-5.0.x-sample/src/main/java/thinking/in/spring/boot/samples/spring5/context/event/GenericEventListenerBootstrap.java
最下面

@DamianSheldon
Copy link

DamianSheldon commented Jan 19, 2022

P483 的对比情况表中说 ApplicationListener 不支持泛型事件,P491 则说“两种途径均能监听一种或多种事件,并且支持泛型事件。”,ApplicationListener 应该是支持泛型事件,只是由于接口泛型范围的限制不能像 @EventListener 直接监听类似事件源 User 对象吧。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants