Deprecate applyBeanPostProcessorsBefore/AfterInitialization
Closes gh-30974
This commit is contained in:
@@ -297,7 +297,10 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
|
||||
* @throws BeansException if any post-processing failed
|
||||
* @see BeanPostProcessor#postProcessBeforeInitialization
|
||||
* @see #ORIGINAL_INSTANCE_SUFFIX
|
||||
* @deprecated as of 6.1, in favor of implicit post-processing through
|
||||
* {@link #initializeBean(Object, String)}
|
||||
*/
|
||||
@Deprecated(since = "6.1")
|
||||
Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
|
||||
throws BeansException;
|
||||
|
||||
@@ -314,7 +317,10 @@ public interface AutowireCapableBeanFactory extends BeanFactory {
|
||||
* @throws BeansException if any post-processing failed
|
||||
* @see BeanPostProcessor#postProcessAfterInitialization
|
||||
* @see #ORIGINAL_INSTANCE_SUFFIX
|
||||
* @deprecated as of 6.1, in favor of implicit post-processing through
|
||||
* {@link #initializeBean(Object, String)}
|
||||
*/
|
||||
@Deprecated(since = "6.1")
|
||||
Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
|
||||
throws BeansException;
|
||||
|
||||
|
||||
@@ -411,6 +411,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
return initializeBean(beanName, existingBean, null);
|
||||
}
|
||||
|
||||
@Deprecated(since = "6.1")
|
||||
@Override
|
||||
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName)
|
||||
throws BeansException {
|
||||
@@ -426,6 +427,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
return result;
|
||||
}
|
||||
|
||||
@Deprecated(since = "6.1")
|
||||
@Override
|
||||
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName)
|
||||
throws BeansException {
|
||||
@@ -1092,6 +1094,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* @param mbd the bean definition for the bean
|
||||
* @return the shortcut-determined bean instance, or {@code null} if none
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Nullable
|
||||
protected Object resolveBeforeInstantiation(String beanName, RootBeanDefinition mbd) {
|
||||
Object bean = null;
|
||||
@@ -1755,6 +1758,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* @see #invokeInitMethods
|
||||
* @see #applyBeanPostProcessorsAfterInitialization
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
protected Object initializeBean(String beanName, Object bean, @Nullable RootBeanDefinition mbd) {
|
||||
invokeAwareMethods(beanName, bean);
|
||||
|
||||
@@ -1886,6 +1890,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||
* object obtained from FactoryBeans (for example, to auto-proxy them).
|
||||
* @see #applyBeanPostProcessorsAfterInitialization
|
||||
*/
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected Object postProcessObjectFromFactoryBean(Object object, String beanName) {
|
||||
return applyBeanPostProcessorsAfterInitialization(object, beanName);
|
||||
|
||||
@@ -472,11 +472,13 @@ class StubWebApplicationContext implements WebApplicationContext {
|
||||
public void applyBeanPropertyValues(Object existingBean, String beanName) throws BeansException {
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Object applyBeanPostProcessorsBeforeInitialization(Object existingBean, String beanName) {
|
||||
return existingBean;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public Object applyBeanPostProcessorsAfterInitialization(Object existingBean, String beanName) {
|
||||
return existingBean;
|
||||
|
||||
Reference in New Issue
Block a user