This commit is contained in:
Rossen Stoyanchev 2019-06-21 06:51:59 +01:00
parent c6a2c89408
commit 7f1d5d790e
1 changed files with 5 additions and 4 deletions

View File

@ -267,10 +267,6 @@ public abstract class AbstractMethodMessageHandler<T>
private void initHandlerMethods() {
if (this.applicationContext == null) {
logger.warn("No ApplicationContext available for detecting beans with message handling methods.");
return;
}
if (this.handlers != null) {
for (Object handler : this.handlers) {
detectHandlerMethods(handler);
@ -281,6 +277,11 @@ public abstract class AbstractMethodMessageHandler<T>
logger.warn("[" + getBeanName() + "] Auto-detection of message handling methods is off.");
return;
}
if (this.applicationContext == null) {
logger.warn("No ApplicationContext available " +
"for auto-detection of beans with message handling methods.");
return;
}
for (String beanName : this.applicationContext.getBeanNamesForType(Object.class)) {
if (!beanName.startsWith(SCOPED_TARGET_NAME_PREFIX)) {
Class<?> beanType = null;