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 with ConfigurationProperties 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 by DiscriminatedPropertyAccessor. 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.