Polishing
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -130,8 +130,8 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
|
||||
@Override
|
||||
public void multicastEvent(final ApplicationEvent event, @Nullable ResolvableType eventType) {
|
||||
ResolvableType type = (eventType != null ? eventType : resolveDefaultEventType(event));
|
||||
for (final ApplicationListener<?> listener : getApplicationListeners(event, type)) {
|
||||
Executor executor = getTaskExecutor();
|
||||
Executor executor = getTaskExecutor();
|
||||
for (ApplicationListener<?> listener : getApplicationListeners(event, type)) {
|
||||
if (executor != null) {
|
||||
executor.execute(() -> invokeListener(listener, event));
|
||||
}
|
||||
|
||||
@@ -92,24 +92,24 @@ import org.springframework.util.ReflectionUtils;
|
||||
* to detect special beans defined in its internal bean factory:
|
||||
* Therefore, this class automatically registers
|
||||
* {@link org.springframework.beans.factory.config.BeanFactoryPostProcessor BeanFactoryPostProcessors},
|
||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor BeanPostProcessors}
|
||||
* {@link org.springframework.beans.factory.config.BeanPostProcessor BeanPostProcessors},
|
||||
* and {@link org.springframework.context.ApplicationListener ApplicationListeners}
|
||||
* which are defined as beans in the context.
|
||||
*
|
||||
* <p>A {@link org.springframework.context.MessageSource} may also be supplied
|
||||
* as a bean in the context, with the name "messageSource"; otherwise, message
|
||||
* resolution is delegated to the parent context. Furthermore, a multicaster
|
||||
* for application events can be supplied as "applicationEventMulticaster" bean
|
||||
* for application events can be supplied as an "applicationEventMulticaster" bean
|
||||
* of type {@link org.springframework.context.event.ApplicationEventMulticaster}
|
||||
* in the context; otherwise, a default multicaster of type
|
||||
* {@link org.springframework.context.event.SimpleApplicationEventMulticaster} will be used.
|
||||
*
|
||||
* <p>Implements resource loading through extending
|
||||
* <p>Implements resource loading by extending
|
||||
* {@link org.springframework.core.io.DefaultResourceLoader}.
|
||||
* Consequently treats non-URL resource paths as class path resources
|
||||
* (supporting full class path resource names that include the package path,
|
||||
* e.g. "mypackage/myresource.dat"), unless the {@link #getResourceByPath}
|
||||
* method is overwritten in a subclass.
|
||||
* method is overridden in a subclass.
|
||||
*
|
||||
* @author Rod Johnson
|
||||
* @author Juergen Hoeller
|
||||
@@ -390,7 +390,7 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
|
||||
else {
|
||||
applicationEvent = new PayloadApplicationEvent<>(this, event);
|
||||
if (eventType == null) {
|
||||
eventType = ((PayloadApplicationEvent) applicationEvent).getResolvableType();
|
||||
eventType = ((PayloadApplicationEvent<?>) applicationEvent).getResolvableType();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user