zoukankan      html  css  js  c++  java
  • org.springframework.context.event.AbstractApplicationEventMulticaster

    private Collection<ApplicationListener<?>> retrieveApplicationListeners(ResolvableType eventType, Class<?> sourceType, AbstractApplicationEventMulticaster.ListenerRetriever retriever) {
    LinkedList allListeners = new LinkedList();
    Object beanFactory = this.retrievalMutex;
    LinkedHashSet listeners;
    LinkedHashSet listenerBeans;
    synchronized(this.retrievalMutex) {
    listeners = new LinkedHashSet(this.defaultRetriever.applicationListeners);
    listenerBeans = new LinkedHashSet(this.defaultRetriever.applicationListenerBeans);
    }

    Iterator beanFactory1 = listeners.iterator();

    while(beanFactory1.hasNext()) {
    ApplicationListener listener = (ApplicationListener)beanFactory1.next();
    if(this.supportsEvent(listener, eventType, sourceType)) {
    if(retriever != null) {
    retriever.applicationListeners.add(listener);
    }

    allListeners.add(listener);
    }
    }

    if(!listenerBeans.isEmpty()) {
    BeanFactory beanFactory2 = this.getBeanFactory();
    Iterator listener2 = listenerBeans.iterator();

    while(listener2.hasNext()) {
    String listenerBeanName = (String)listener2.next();

    try {
    Class listenerType = beanFactory2.getType(listenerBeanName);
    if(listenerType == null || this.supportsEvent(listenerType, eventType)) {
    ApplicationListener listener1 = (ApplicationListener)beanFactory2.getBean(listenerBeanName, ApplicationListener.class);
    if(!allListeners.contains(listener1) && this.supportsEvent(listener1, eventType, sourceType)) {
    if(retriever != null) {
    retriever.applicationListenerBeans.add(listenerBeanName);
    }

    allListeners.add(listener1);
    }
    }
    } catch (NoSuchBeanDefinitionException var13) {
    ;
    }
    }
    }

    AnnotationAwareOrderComparator.sort(allListeners);
    return allListeners;
    }


    org.springframework.context.event.AbstractApplicationEventMulticaster

  • 相关阅读:
    电路原理图基本知识概述(转)
    数字电路笔记
    模拟电路笔记
    ROS笔记一
    STM32笔记三
    电子元件笔记
    STM32笔记二
    C语言相关知识
    利用sql报错帮助进行sql注入
    kali下纯文本与窗口环境切换
  • 原文地址:https://www.cnblogs.com/softidea/p/5727242.html
Copyright © 2011-2022 走看看