A question about Spring's InstantiationAwareBeanPostProcessor interface?

InstantiationAwareBeanPostProcessor, about Spring calls its related interface before the bean object is instantiated, for example, interface:

postProcessBeforeInstantiation

about this interface, there is an explanation in the documentation:

Apply this BeanPostProcessor before the target bean gets instantiated.The returned bean object may bea proxy to use instead of the target bean,effectively suppressing default instantiation of the target bean.

means that the interface can also return proxy objects, so here comes the problem:

generally, our Aop proxy objects are generated in the postProcessAfterInitialization method of BeanPostProcessor

    /**
     * Create a proxy with the configured interceptors if the bean is
     * identified as one to proxy by the subclass.
     * @see -sharpgetAdvicesAndAdvisorsForBean
     */
    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        if (bean != null) {
            Object cacheKey = getCacheKey(bean.getClass(), beanName);
            if (!this.earlyProxyReferences.contains(cacheKey)) {
                return wrapIfNecessary(bean, beanName, cacheKey);
            }
        }
        return bean;
    }

where wrapIfNecessary is the method for generating proxy objects

ask everyone, so why the postProcessBeforeInstantiation in InstantiationAwareBeanPostProcessor may also return the proxy object? In what scenarios will there be such a need?

Jun.12,2021

also in Spring AOP, there are generated proxies.

public Object postProcessBeforeInstantiation(Class<?> beanClass, String beanName) throws {

..................
    // Create proxy here if we have a custom TargetSource.
    // Suppresses unnecessary default instantiation of the target bean:
    // The TargetSource will handle target instances in a custom fashion.
    TargetSource targetSource = getCustomTargetSource(beanClass, beanName);
    if (targetSource != null) {
        if (StringUtils.hasLength(beanName)) {
            this.targetSourcedBeans.add(beanName);
        }
        Object[] specificInterceptors = getAdvicesAndAdvisorsForBean(beanClass, beanName, targetSource);
        Object proxy = createProxy(beanClass, beanName, specificInterceptors, targetSource);
        this.proxyTypes.put(cacheKey, proxy.getClass());
        return proxy;
    }

    return null;
}
Menu