From 28565e25fa6e93bc3ea16d7f9e5fbf0127261cc7 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 6 Aug 2018 19:45:06 +0200 Subject: [PATCH] Javadoc references for resetBeanDefinition Issue: SPR-17126 --- .../beans/factory/support/DefaultListableBeanFactory.java | 6 ++++++ .../factory/support/MergedBeanDefinitionPostProcessor.java | 3 +++ 2 files changed, 9 insertions(+) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 5e5bf365fe6..caab0eef84d 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -959,7 +959,13 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto /** * Reset all bean definition caches for the given bean, * including the caches of beans that are derived from it. + *

Called after an existing bean definition has been replaced or removed, + * triggering {@link #clearMergedBeanDefinition}, {@link #destroySingleton} + * and {@link MergedBeanDefinitionPostProcessor#resetBeanDefinition} on the + * given bean and on all bean definitions that have the given bean as parent. * @param beanName the name of the bean to reset + * @see #registerBeanDefinition + * @see #removeBeanDefinition */ protected void resetBeanDefinition(String beanName) { // Remove the merged bean definition for the given bean, if already created. diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/MergedBeanDefinitionPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/MergedBeanDefinitionPostProcessor.java index a58b927923f..34209cc27c4 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/MergedBeanDefinitionPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/MergedBeanDefinitionPostProcessor.java @@ -42,14 +42,17 @@ public interface MergedBeanDefinitionPostProcessor extends BeanPostProcessor { * @param beanDefinition the merged bean definition for the bean * @param beanType the actual type of the managed bean instance * @param beanName the name of the bean + * @see AbstractAutowireCapableBeanFactory#applyMergedBeanDefinitionPostProcessors */ void postProcessMergedBeanDefinition(RootBeanDefinition beanDefinition, Class beanType, String beanName); /** * A notification that the bean definition for the specified name has been reset, * and that this post-processor should clear any metadata for the affected bean. + *

The default implementation is empty. * @param beanName the name of the bean * @since 5.1 + * @see DefaultListableBeanFactory#resetBeanDefinition */ default void resetBeanDefinition(String beanName) { }