Package org.openspaces.core.properties
Class BeanLevelPropertyBeanPostProcessor
java.lang.Object
org.openspaces.core.properties.BeanLevelPropertyBeanPostProcessor
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor
public class BeanLevelPropertyBeanPostProcessor
extends Object
implements org.springframework.beans.factory.config.BeanPostProcessor
A Spring
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.- Author:
- kimchy
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBeanLevelPropertyBeanPostProcessor(BeanLevelProperties beanLevelProperties) Constructs a new bean level bean post processor based on the provided bean level properties. -
Method Summary
Modifier and TypeMethodDescriptionpostProcessAfterInitialization(Object bean, String beanName) A no op, just returned the bean itself.postProcessBeforeInitialization(Object bean, String beanName) Post process a given bean.
-
Constructor Details
-
BeanLevelPropertyBeanPostProcessor
Constructs a new bean level bean post processor based on the provided bean level properties.- Parameters:
beanLevelProperties- The bean level properties to be used for injection
-
-
Method Details
-
postProcessBeforeInitialization
public Object postProcessBeforeInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException Post process a given bean. If the bean implementsBeanLevelPropertiesAwareof if it contains a field that has the annotationBeanLevelPropertiesContextthe providedBeanLevelPropertieswill be injected to it. If the bean implementsBeanLevelMergedPropertiesAwareof if it contains a field that has the annotationBeanLevelMergedPropertiesContextthen the merged properties based on the provided beanName will be injected (usingBeanLevelProperties.getMergedBeanProperties(String)).- Specified by:
postProcessBeforeInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Parameters:
bean- The bean to possibly perform injection ofBeanLevelPropertiesbeanName- The bean name- Returns:
- The bean unmodified
- Throws:
org.springframework.beans.BeansException
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException A no op, just returned the bean itself.- Specified by:
postProcessAfterInitializationin interfaceorg.springframework.beans.factory.config.BeanPostProcessor- Throws:
org.springframework.beans.BeansException
-