List of usage examples for org.springframework.context.event ApplicationEventMulticaster removeApplicationListenerBean
void removeApplicationListenerBean(String listenerBeanName);
From source file:org.springframework.context.support.ApplicationListenerDetector.java
@Override public void postProcessBeforeDestruction(Object bean, String beanName) { if (bean instanceof ApplicationListener) { try {// w w w.j a v a 2s .c om ApplicationEventMulticaster multicaster = this.applicationContext.getApplicationEventMulticaster(); multicaster.removeApplicationListener((ApplicationListener<?>) bean); multicaster.removeApplicationListenerBean(beanName); } catch (IllegalStateException ex) { // ApplicationEventMulticaster not initialized yet - no need to remove a listener } } }