Org.springframework.context.event.AbstractApplicationEventMulticaster

Source: Internet
Author: User

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

Org.springframework.context.event.AbstractApplicationEventMulticaster

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.