Spring event应用

当咱们在实现某些特定业务逻辑时,一般会经过发送事件的方式实现代码解耦,这也是观察者模式的一种体现。从spring 3.0.5为咱们实现了用annotation实现event和eventListner。 一个事件包含:事件发布、监听、和事件源。在spring中咱们能够经过ApplicationContext的publishEvent方法去发布事件;经过实现实现ApplicationListener接
相关文章
相关标签/搜索