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;}
时间: 2024-10-13 12:07:14

org.springframework.context.event.AbstractApplicationEventMulticaster的相关文章

【转】java.lang.ClassNotFoundException: org.springframework.context.event.GenericApplicationListener

http://www.cnblogs.com/softidea/p/6064091.html Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener From the above error, application is unable to find the class defined from the jar dependencies. Ge

java.lang.ClassNotFoundException: org.springframework.context.event.GenericApplicationListener ----good

Caused by: java.lang.NoClassDefFoundError: org/springframework/context/event/GenericApplicationListener From the above error, application is unable to find the class defined from the jar dependencies. GenericApplicationListener is added from spring v

Context namespace element &#39;annotation-config&#39; and its parser class [org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser]

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class pa

org.springframework.context.ApplicationContextAware使用理解

一.这个接口有什么用? 当一个类实现了这个接口(ApplicationContextAware)之后,这个类就可以方便获得ApplicationContext中的所有bean.换句话说,就是这个类可以直接获取spring配置文件中,所有有引用到的bean对象. 二.怎么用? 举个例子吧: 例如我有一个方法类AppUtil,这个方法类中需要使用到的ApplicationContext中的某个bean(companyService). 1.因为spring要建立属于自己的容器,就必须要加载自己的配置

java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

***************************错误提示************************************************ SEVERE: A child container failed during start java.util.concurrent.ExecutionException:org.apache.catalina.LifecycleException: Failed to start component[StandardEngine[Cat

Mingyang.net:org.springframework.context.annotation.ConflictingBeanDefinitionException

org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'configController' for bean class [net.mingyang.modules.system.ConfigController] conflicts with existing, non-compatible bean definition of same

Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextAware

1.错误描述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 0:25:53 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 using

[org.springframework.context.annotation.AnnotationConfigBeanDefinitionParser] are only available on

<2015-4-10 下午02时55分35秒 CST> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerifica

Context namespace element &#39;component-scan&#39; and its parser class [org.springframework.context.annotation.ComponentScanBeanDefinitionParser] are only available on JDK 1.5 and higher

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [applicationContext.xml]; nested exception is java.lang.IllegalStateException: Context