类 EventPublisherContextUtil
- java.lang.Object
-
- xyz.xiezc.ioc.starter.common.context.impl.EventPublisherContextUtil
-
- 所有已实现的接口:
EventPublisherContext
public class EventPublisherContextUtil extends Object implements EventPublisherContext
事件监听处理的相关逻辑,
-
-
构造器概要
构造器 构造器 说明 EventPublisherContextUtil()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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
public List<ApplicationListener> getApplicationListener(String eventName)
从接口复制的说明:EventPublisherContextAdd a listener to be notified of all events.- 指定者:
getApplicationListener在接口中EventPublisherContext- 参数:
eventName- the listener to add
-
addApplicationListener
public void addApplicationListener(String eventName, ApplicationListener listener)
从接口复制的说明:EventPublisherContextAdd a listener to be notified of all events.- 指定者:
addApplicationListener在接口中EventPublisherContext- 参数:
eventName- the listener to addlistener- the listener to add
-
removeApplicationListener
public void removeApplicationListener(String eventName)
从接口复制的说明:EventPublisherContextRemove a listener from the notification list.- 指定者:
removeApplicationListener在接口中EventPublisherContext- 参数:
eventName- the listener to remove
-
removeAllListeners
public void removeAllListeners()
从接口复制的说明:EventPublisherContextRemove all listeners registered with this multicaster.After a remove call, the multicaster will perform no action on event notification until new listeners are registered.
- 指定者:
removeAllListeners在接口中EventPublisherContext
-
publisherEvent
public void publisherEvent(ApplicationEvent event)
从接口复制的说明:EventPublisherContextMulticast the given application event to appropriate listeners. if possible as it provides better support for generics-based events.- 指定者:
publisherEvent在接口中EventPublisherContext- 参数:
event- the event to multicast
-
-