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 Details

    • BeanLevelPropertyBeanPostProcessor

      public BeanLevelPropertyBeanPostProcessor(BeanLevelProperties beanLevelProperties)
      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 implements 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)).
      Specified by:
      postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
      Parameters:
      bean - The bean to possibly perform injection of BeanLevelProperties
      beanName - 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:
      postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
      Throws:
      org.springframework.beans.BeansException