diff --git a/core/src/main/java/org/springframework/plugin/core/support/PluginRegistryFactoryBean.java b/core/src/main/java/org/springframework/plugin/core/support/PluginRegistryFactoryBean.java index c10bef2..fcdd934 100644 --- a/core/src/main/java/org/springframework/plugin/core/support/PluginRegistryFactoryBean.java +++ b/core/src/main/java/org/springframework/plugin/core/support/PluginRegistryFactoryBean.java @@ -26,7 +26,10 @@ import org.springframework.beans.BeansException; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.BeanFactoryAware; import org.springframework.beans.factory.FactoryBean; +import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.ListableBeanFactory; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; import org.springframework.lang.NonNull; import org.springframework.lang.Nullable; import org.springframework.plugin.core.OrderAwarePluginRegistry; @@ -39,7 +42,7 @@ import org.springframework.plugin.core.PluginRegistry; * @author Oliver Gierke */ public class PluginRegistryFactoryBean, S> - implements FactoryBean>, BeanFactoryAware { + implements FactoryBean>, BeanFactoryAware, ApplicationContextAware, InitializingBean { private Collection> exclusions = Collections.emptySet(); private @Nullable Class type; @@ -77,6 +80,16 @@ public class PluginRegistryFactoryBean, S> this.factory = factory; } + /** + * @see ApplicationContextAware#setApplicationContext(ApplicationContext) + * @deprecated since 4.0, in favor of {@link #setBeanFactory(BeanFactory)}. + */ + @Override + @Deprecated + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + setBeanFactory(applicationContext); + } + /* * (non-Javadoc) * @see org.springframework.beans.factory.FactoryBean#getObject() @@ -113,4 +126,14 @@ public class PluginRegistryFactoryBean, S> public boolean isSingleton() { return true; } + + /** + * @see InitializingBean#afterPropertiesSet() + * @deprecated since 4.0, not needed anymore. + */ + @Override + @Deprecated + public void afterPropertiesSet() { + // Only here for backwards-compatibility + } }