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

  • 相关阅读:
    HDU2546(01背包)
    HDU4283(KB22-G)
    POJ1651(KB-E)
    POJ2955(KB22-C 区间DP)
    POJ3264(KB7-G RMQ)
    POJ3468(KB7-C 线段树)
    POJ3616(KB12-R dp)
    Ubuntu16.04安装opencv for python/c++
    华中农业大学第五届程序设计大赛网络同步赛-L
    华中农业大学第五届程序设计大赛网络同步赛-K
  • 原文地址:https://www.cnblogs.com/softidea/p/5727242.html
Copyright © 2011-2022 走看看