ApplicationContextAwareProcessor.java
package org.springframework.context.support; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedAction; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.EmbeddedValueResolver; import org.springframework.context.ApplicationContextAware; import org.springframework.context.ApplicationEventPublisherAware; import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.EmbeddedValueResolverAware; import org.springframework.context.EnvironmentAware; import org.springframework.context.MessageSourceAware; import org.springframework.context.ResourceLoaderAware; import org.springframework.lang.Nullable; import org.springframework.util.StringValueResolver; /** * {@link BeanPostProcessor} implementation that supplies the {@code ApplicationContext}, * {@link org.springframework.core.env.Environment Environment}, or * {@link StringValueResolver} for the {@code ApplicationContext} to beans that * implement the {@link EnvironmentAware}, {@link EmbeddedValueResolverAware}, * {@link ResourceLoaderAware}, {@link ApplicationEventPublisherAware}, * {@link MessageSourceAware}, and/or {@link ApplicationContextAware} interfaces. * * <p>Implemented interfaces are satisfied in the order in which they are * mentioned above. * * <p>Application contexts will automatically register this with their * underlying bean facto