提交 73dd6c28 编写于 作者: J Juergen Hoeller

reintroduced "removeAllListeners()" method since Spring DM uses it

上级 707d2ed7
...@@ -68,6 +68,11 @@ public abstract class AbstractApplicationEventMulticaster ...@@ -68,6 +68,11 @@ public abstract class AbstractApplicationEventMulticaster
this.defaultRetriever.applicationListenerBeans.add(listenerBeanName); this.defaultRetriever.applicationListenerBeans.add(listenerBeanName);
} }
public void removeAllListeners() {
this.defaultRetriever.applicationListeners.clear();
this.defaultRetriever.applicationListenerBeans.clear();
}
public final void setBeanFactory(BeanFactory beanFactory) { public final void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory; this.beanFactory = beanFactory;
} }
......
...@@ -43,6 +43,13 @@ public interface ApplicationEventMulticaster { ...@@ -43,6 +43,13 @@ public interface ApplicationEventMulticaster {
*/ */
void addApplicationListenerBean(String listenerBeanName); void addApplicationListenerBean(String listenerBeanName);
/**
* Remove all listeners registered with this multicaster.
* <p>After a remove call, the multicaster will perform no action
* on event notification until new listeners are being registered.
*/
void removeAllListeners();
/** /**
* Multicast the given application event to appropriate listeners. * Multicast the given application event to appropriate listeners.
* @param event the event to multicast * @param event the event to multicast
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册