diff --git a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java index a02c052f7af..15347f90fce 100644 --- a/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java +++ b/spring-integration-core/src/main/java/org/springframework/integration/aop/PublisherAnnotationBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2021 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. @@ -20,8 +20,8 @@ import org.springframework.beans.factory.BeanCreationException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanNameAware; -import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.NoUniqueBeanDefinitionException; +import org.springframework.beans.factory.SmartInitializingSingleton; /** * Post-processes beans that contain the @@ -40,7 +40,7 @@ */ @SuppressWarnings("serial") public class PublisherAnnotationBeanPostProcessor extends AbstractBeanFactoryAwareAdvisingPostProcessor - implements BeanNameAware, InitializingBean { + implements BeanNameAware, SmartInitializingSingleton { private String defaultChannelName; @@ -74,7 +74,7 @@ public void setBeanFactory(BeanFactory beanFactory) { } @Override - public void afterPropertiesSet() { + public void afterSingletonsInstantiated() { try { this.beanFactory.getBean(PublisherAnnotationBeanPostProcessor.class); }