Class DiscriminatedConfigurationPropertiesBeanPostProcessor
- java.lang.Object
-
- com.broadleafcommerce.common.extension.environment.DiscriminatedConfigurationPropertiesBeanPostProcessor
-
- All Implemented Interfaces:
org.springframework.beans.factory.config.BeanPostProcessor
public class DiscriminatedConfigurationPropertiesBeanPostProcessor extends Object implements org.springframework.beans.factory.config.BeanPostProcessor
BeanPostProcessor that identifies components annotated withConfigurationProperties
and sets up a proxy that circumvents the default property handling in favor of dynamic retrieval from the Spring environment. Furthermore, the property name may be embellished with tenant related information, if applicable, harvested from the current request context. This allows for discriminated property retrieval as defined byDiscriminatedPropertyAccessor
. Lastly, this property handling is sensitive to config server environment refresh, by virtue of direct interaction with the environment. Note a cache is employed that is invalidated upon config server refresh.
-
-
Constructor Summary
Constructors Constructor Description DiscriminatedConfigurationPropertiesBeanPostProcessor(DiscriminatedConfigurationPropertiesMethodCallProcessor processor, List<DiscriminatedPropertyIncludeFilterSupplier> includeFilters, List<DiscriminatedPropertyExcludeFilterSupplier> excludeFilters)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
postProcessAfterInitialization(Object bean, String beanName)
-
-
-
Constructor Detail
-
DiscriminatedConfigurationPropertiesBeanPostProcessor
public DiscriminatedConfigurationPropertiesBeanPostProcessor(DiscriminatedConfigurationPropertiesMethodCallProcessor processor, List<DiscriminatedPropertyIncludeFilterSupplier> includeFilters, List<DiscriminatedPropertyExcludeFilterSupplier> excludeFilters)
-
-
Method Detail
-
postProcessAfterInitialization
public Object postProcessAfterInitialization(Object bean, String beanName) throws org.springframework.beans.BeansException
- Specified by:
postProcessAfterInitialization
in interfaceorg.springframework.beans.factory.config.BeanPostProcessor
- Throws:
org.springframework.beans.BeansException
-
-