接口 EventPublisherContext
-
- 所有已知实现类:
EventPublisherContextUtil
public interface EventPublisherContext事件监听器接口 管理类
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 voidaddApplicationListener(String eventName, ApplicationListener listener)Add a listener to be notified of all events.List<ApplicationListener>getApplicationListener(String eventName)Add a listener to be notified of all events.voidpublisherEvent(ApplicationEvent event)Multicast the given application event to appropriate listeners.voidremoveAllListeners()Remove all listeners registered with this multicaster.voidremoveApplicationListener(String eventName)Remove a listener from the notification list.
-
-
-
方法详细资料
-
getApplicationListener
List<ApplicationListener> getApplicationListener(String eventName)
Add a listener to be notified of all events.- 参数:
eventName- the listener to add
-
addApplicationListener
void addApplicationListener(String eventName, ApplicationListener listener)
Add a listener to be notified of all events.- 参数:
listener- the listener to addeventName- the listener to add
-
removeApplicationListener
void removeApplicationListener(String eventName)
Remove a listener from the notification list.- 参数:
eventName- the listener to remove
-
removeAllListeners
void removeAllListeners()
Remove all listeners registered with this multicaster.After a remove call, the multicaster will perform no action on event notification until new listeners are registered.
-
publisherEvent
void publisherEvent(ApplicationEvent event)
Multicast the given application event to appropriate listeners. if possible as it provides better support for generics-based events.- 参数:
event- the event to multicast
-
-