public class BeanLevelPropertyBeanPostProcessor extends Object implements org.springframework.beans.factory.config.BeanPostProcessor
BeanPostProcessor
that process beans that implement BeanLevelPropertiesAware
or BeanLevelMergedPropertiesAware
based on the provided BeanLevelProperties
.
In addition, beans that contain a field that has the annotation BeanLevelPropertiesContext
will be injected with the BeanLevelProperties
. Beans that
contain a field that has the annotation BeanLevelMergedPropertiesContext
will be injected
with the merged Properties
based on the provided beanName.BeanLevelProperties
,
BeanLevelMergedPropertiesAware
,
BeanLevelPropertiesAware
Constructor and Description |
---|
BeanLevelPropertyBeanPostProcessor(BeanLevelProperties beanLevelProperties)
Constructs a new bean level bean post processor based on the provided bean level properties.
|
Modifier and Type | Method and Description |
---|---|
Object |
postProcessAfterInitialization(Object bean,
String beanName)
A no op, just returned the bean itself.
|
Object |
postProcessBeforeInitialization(Object bean,
String beanName)
Post process a given bean.
|
public BeanLevelPropertyBeanPostProcessor(BeanLevelProperties beanLevelProperties)
beanLevelProperties
- The bean level properties to be used for injectionpublic Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
BeanLevelPropertiesAware
of if it
contains a field that has the annotation BeanLevelPropertiesContext
the provided
BeanLevelProperties
will be injected to it. If the bean implements BeanLevelMergedPropertiesAware
of if it contains a field that has the annotation BeanLevelMergedPropertiesContext
then the merged properties based on the provided beanName
will be injected (using BeanLevelProperties.getMergedBeanProperties(String)
).postProcessBeforeInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
bean
- The bean to possibly perform injection of BeanLevelProperties
beanName
- The bean nameorg.springframework.beans.BeansException
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
postProcessAfterInitialization
in interface org.springframework.beans.factory.config.BeanPostProcessor
org.springframework.beans.BeansException
Copyright © GigaSpaces.