Top Description Inners Constructors Methods
org.springframework.context.support

pack-priv final Class PostProcessorRegistrationDelegate

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collection, .Comparator, .HashSet, .LinkedHashSet, .List, .Set, java.util.function.BiConsumer, org.apache.commons.logging.Log, .LogFactory, org.springframework.beans.PropertyValue, org.springframework.beans.factory.config.BeanDefinition, .BeanDefinitionHolder, .BeanFactoryPostProcessor, .BeanPostProcessor, .ConfigurableListableBeanFactory, .ConstructorArgumentValues.ValueHolder, .TypedStringValue, org.springframework.beans.factory.support.AbstractBeanDefinition, .AbstractBeanFactory, .BeanDefinitionRegistry, .BeanDefinitionRegistryPostProcessor, .BeanDefinitionValueResolver, .DefaultListableBeanFactory, .MergedBeanDefinitionPostProcessor, .RootBeanDefinition, org.springframework.core.OrderComparator, .Ordered, .PriorityOrdered, org.springframework.core.metrics.ApplicationStartup, .StartupStep, org.springframework.lang.Nullable

Delegate for AbstractApplicationContext's post-processor handling.
Authors
Juergen Hoeller, Sam Brannen, Stephane Nicoll
Since
4.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
PostProcessorRegistrationDelegate.BeanPostProcessorChecker

BeanPostProcessor that logs an info message when a bean is created during BeanPostProcessor instantiation, i.e. when a bean is not eligible for getting processed by all BeanPostProcessors.

private static class

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static void
invokeBeanDefinitionRegistryPostProcessors(Collection<? extends BeanDefinitionRegistryPostProcessor> postProcessors, BeanDefinitionRegistry registry, ApplicationStartup applicationStartup)

Invoke the given BeanDefinitionRegistryPostProcessor beans.

public static void
private static void
invokeBeanFactoryPostProcessors(Collection<? extends BeanFactoryPostProcessor> postProcessors, ConfigurableListableBeanFactory beanFactory)

Invoke the given BeanFactoryPostProcessor beans.

pack-priv static void
invokeMergedBeanDefinitionPostProcessors(DefaultListableBeanFactory
the bean factory to use
beanFactory
)

Selectively invoke MergedBeanDefinitionPostProcessor instances registered in the specified bean factory, resolving bean definitions and any attributes if necessary as well as any inner bean definitions that they may contain.

pack-priv static <
the post-processor type
T extends BeanPostProcessor
>
List<T>

Returns:

a list of sorted post-processors for the specified type
loadBeanPostProcessors
(ConfigurableListableBeanFactory
the bean factory to use
beanFactory
,
Class<T>
the post-processor type
beanPostProcessorType
)

Load and sort the post-processors of the specified type.

public static void
private static void
registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, List<? extends BeanPostProcessor> postProcessors)

Register the given BeanPostProcessor beans.

private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PostProcessorRegistrationDelegateback to summary
private PostProcessorRegistrationDelegate()

Method Detail

invokeBeanDefinitionRegistryPostProcessorsback to summary
private static void invokeBeanDefinitionRegistryPostProcessors(Collection<? extends BeanDefinitionRegistryPostProcessor> postProcessors, BeanDefinitionRegistry registry, ApplicationStartup applicationStartup)

Invoke the given BeanDefinitionRegistryPostProcessor beans.

invokeBeanFactoryPostProcessorsback to summary
public static void invokeBeanFactoryPostProcessors(ConfigurableListableBeanFactory beanFactory, List<BeanFactoryPostProcessor> beanFactoryPostProcessors)
invokeBeanFactoryPostProcessorsback to summary
private static void invokeBeanFactoryPostProcessors(Collection<? extends BeanFactoryPostProcessor> postProcessors, ConfigurableListableBeanFactory beanFactory)

Invoke the given BeanFactoryPostProcessor beans.

invokeMergedBeanDefinitionPostProcessorsback to summary
pack-priv static void invokeMergedBeanDefinitionPostProcessors(DefaultListableBeanFactory beanFactory)

Selectively invoke MergedBeanDefinitionPostProcessor instances registered in the specified bean factory, resolving bean definitions and any attributes if necessary as well as any inner bean definitions that they may contain.

Parameters
beanFactory:DefaultListableBeanFactory

the bean factory to use

loadBeanPostProcessorsback to summary
pack-priv static <T extends BeanPostProcessor> List<T> loadBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, Class<T> beanPostProcessorType)

Load and sort the post-processors of the specified type.

Parameters
<T>
the post-processor type
beanFactory:ConfigurableListableBeanFactory

the bean factory to use

beanPostProcessorType:Class<T>

the post-processor type

Returns:List<T>

a list of sorted post-processors for the specified type

registerBeanPostProcessorsback to summary
public static void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, AbstractApplicationContext applicationContext)
registerBeanPostProcessorsback to summary
private static void registerBeanPostProcessors(ConfigurableListableBeanFactory beanFactory, List<? extends BeanPostProcessor> postProcessors)

Register the given BeanPostProcessor beans.

sortPostProcessorsback to summary
private static void sortPostProcessors(List<?> postProcessors, ConfigurableListableBeanFactory beanFactory)
org.springframework.context.support back to summary

private final Class PostProcessorRegistrationDelegate.BeanPostProcessorChecker

extends Object
implements BeanPostProcessor
Class Inheritance
  • java.lang.Object
  • org.springframework.context.support.PostProcessorRegistrationDelegate.BeanPostProcessorChecker
All Implemented Interfaces
org.springframework.beans.factory.config.BeanPostProcessor

BeanPostProcessor that logs an info message when a bean is created during BeanPostProcessor instantiation, i.e. when a bean is not eligible for getting processed by all BeanPostProcessors.

Field Summary

Modifier and TypeField and Description
private final ConfigurableListableBeanFactory
private final int
private static final Log
private final String[]

Constructor Summary

AccessConstructor and Description
public
BeanPostProcessorChecker(ConfigurableListableBeanFactory beanFactory, String[] postProcessorNames, int beanPostProcessorTargetCount)

Method Summary

Modifier and TypeMethod and Description
private boolean
public Object
postProcessAfterInitialization(Object
the new bean instance
bean
,
String
the name of the bean
beanName
)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

public Object
postProcessBeforeInitialization(Object
the new bean instance
bean
,
String
the name of the bean
beanName
)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanFactoryback to summary
private final ConfigurableListableBeanFactory beanFactory
beanPostProcessorTargetCountback to summary
private final int beanPostProcessorTargetCount
loggerback to summary
private static final Log logger
postProcessorNamesback to summary
private final String[] postProcessorNames

Constructor Detail

BeanPostProcessorCheckerback to summary
public BeanPostProcessorChecker(ConfigurableListableBeanFactory beanFactory, String[] postProcessorNames, int beanPostProcessorTargetCount)

Method Detail

isInfrastructureBeanback to summary
private boolean isInfrastructureBean(String beanName)
postProcessAfterInitializationback to summary
public Object postProcessAfterInitialization(Object bean, String beanName)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Doc from org.springframework.beans.factory.config.BeanPostProcessor.postProcessAfterInitialization.

Apply this BeanPostProcessor to the given new bean instance after any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

In case of a FactoryBean, this callback will be invoked for both the FactoryBean instance and the objects created by the FactoryBean (as of Spring 2.0). The post-processor can decide whether to apply to either the FactoryBean or created objects or both through corresponding bean instanceof FactoryBean checks.

This callback will also be invoked after a short-circuiting triggered by a InstantiationAwareBeanPostProcessor#postProcessBeforeInstantiation method, in contrast to all other BeanPostProcessor callbacks.

The default implementation returns the given bean as-is.

Parameters
bean:Object

the new bean instance

beanName:String

the name of the bean

Returns:Object

the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked

Annotations
@Override
postProcessBeforeInitializationback to summary
public Object postProcessBeforeInitialization(Object bean, String beanName)

Overrides default org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Doc from org.springframework.beans.factory.config.BeanPostProcessor.postProcessBeforeInitialization.

Apply this BeanPostProcessor to the given new bean instance before any bean initialization callbacks (like InitializingBean's afterPropertiesSet or a custom init-method). The bean will already be populated with property values. The returned bean instance may be a wrapper around the original.

The default implementation returns the given bean as-is.

Parameters
bean:Object

the new bean instance

beanName:String

the name of the bean

Returns:Object

the bean instance to use, either the original or a wrapped one; if null, no subsequent BeanPostProcessors will be invoked

Annotations
@Override
org.springframework.context.support back to summary

private final Class PostProcessorRegistrationDelegate.MergedBeanDefinitionPostProcessorInvoker

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.context.support.PostProcessorRegistrationDelegate.MergedBeanDefinitionPostProcessorInvoker

Field Summary

Modifier and TypeField and Description
private final DefaultListableBeanFactory

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
private void
private void
private Class<?>
private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beanFactoryback to summary
private final DefaultListableBeanFactory beanFactory

Constructor Detail

MergedBeanDefinitionPostProcessorInvokerback to summary
private MergedBeanDefinitionPostProcessorInvoker(DefaultListableBeanFactory beanFactory)

Method Detail

invokeMergedBeanDefinitionPostProcessorsback to summary
private void invokeMergedBeanDefinitionPostProcessors()
postProcessRootBeanDefinitionback to summary
private void postProcessRootBeanDefinition(List<MergedBeanDefinitionPostProcessor> postProcessors, String beanName, Class<?> beanType, RootBeanDefinition bd)
postProcessValueback to summary
private void postProcessValue(List<MergedBeanDefinitionPostProcessor> postProcessors, BeanDefinitionValueResolver valueResolver, Object value)
resolveBeanTypeback to summary
private Class<?> resolveBeanType(AbstractBeanDefinition bd)
resolveInnerBeanDefinitionback to summary
private void resolveInnerBeanDefinition(BeanDefinitionValueResolver valueResolver, BeanDefinition innerBeanDefinition, BiConsumer<String, RootBeanDefinition> resolver)
resolveTypeStringValueback to summary
private void resolveTypeStringValue(TypedStringValue typedStringValue)