mirror of
https://gitee.com/dromara/hutool.git
synced 2025-07-15 14:04:33 +08:00
Merge pull request #2139 from lishangbu/v5-dev
SpringUtil提供重载方法支持Spring 4.2+新特性:Spring 事件发布增加Object类型事件
This commit is contained in:
commit
f1b32cb8b0
@ -259,7 +259,7 @@ public class SpringUtil implements BeanFactoryPostProcessor, ApplicationContextA
|
||||
/**
|
||||
* 发布事件
|
||||
*
|
||||
* @param event the event to publish
|
||||
* @param event 待发布的事件,事件必须是{@link ApplicationEvent}的子类
|
||||
* @since 5.7.12
|
||||
*/
|
||||
public static void publishEvent(ApplicationEvent event) {
|
||||
@ -267,6 +267,19 @@ public class SpringUtil implements BeanFactoryPostProcessor, ApplicationContextA
|
||||
applicationContext.publishEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布事件
|
||||
* Spring 4.2+ 版本事件可以不再是{@link ApplicationEvent}的子类
|
||||
*
|
||||
* @param event 待发布的事件
|
||||
* @since 5.7.21
|
||||
*/
|
||||
public static void publishEvent(Object event) {
|
||||
if (null != applicationContext) {
|
||||
applicationContext.publishEvent(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user