GigaSpaces XAP 9.7.2 API

org.openspaces.core.properties
Class BeanLevelPropertyBeanPostProcessor

java.lang.Object
  extended by org.openspaces.core.properties.BeanLevelPropertyBeanPostProcessor
All Implemented Interfaces:
BeanPostProcessor

public class BeanLevelPropertyBeanPostProcessor
extends Object
implements 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:
BeanLevelProperties, BeanLevelMergedPropertiesAware, BeanLevelPropertiesAware

Constructor Summary
BeanLevelPropertyBeanPostProcessor(BeanLevelProperties beanLevelProperties)
          Constructs a new bean level bean post processor based on the provided bean level properties.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 Detail

postProcessBeforeInitialization

public Object postProcessBeforeInitialization(Object bean,
                                              String beanName)
                                       throws 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 BeanPostProcessor
Parameters:
bean - The bean to possibly perform injection of BeanLevelProperties
beanName - The bean name
Returns:
The bean unmodified
Throws:
BeansException

postProcessAfterInitialization

public Object postProcessAfterInitialization(Object bean,
                                             String beanName)
                                      throws BeansException
A no op, just returned the bean itself.

Specified by:
postProcessAfterInitialization in interface BeanPostProcessor
Throws:
BeansException

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.