Class ConfigProviderConfigurer

java.lang.Object
dev.orne.config.spring.ConfigProviderConfigurer
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.config.BeanPostProcessor, org.springframework.context.EnvironmentAware

@API(status=INTERNAL, since="1.0") public class ConfigProviderConfigurer extends Object implements org.springframework.context.EnvironmentAware, org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.beans.factory.config.BeanPostProcessor
Bean factory post processor that provides a ConfigProvider customized per Spring context configuration.
Since:
1.0
Version:
1.0, 2025-11
Author:
(w) Iker Hernaez
  • Field Details

    • AUTO_CONFIG

      public static final String AUTO_CONFIG
      The name of the automatic Config bean.
      See Also:
    • AUTO_CONFIG_PROVIDER

      public static final String AUTO_CONFIG_PROVIDER
      The name of the automatic ConfigProvider bean.
      See Also:
    • environment

      protected org.springframework.core.env.Environment environment
      The Spring environment.
    • beanFactory

      protected org.springframework.beans.factory.ListableBeanFactory beanFactory
      The bean factory.
    • appConfigProviderBeanName

      protected String appConfigProviderBeanName
      The application provided configuration provider bean name.
    • customizerBeanName

      protected String customizerBeanName
      The application provided configuration provider customizer bean name.
    • configProvider

      protected ConfigProvider configProvider
      The configuration provider.
    • ownConfigProvider

      protected ConfigProviderImpl ownConfigProvider
      The created configuration provider.
  • Constructor Details

    • ConfigProviderConfigurer

      public ConfigProviderConfigurer()
      Creates a new instance.
  • Method Details

    • setEnvironment

      public void setEnvironment(org.springframework.core.env.Environment environment)
      Specified by:
      setEnvironment in interface org.springframework.context.EnvironmentAware
    • postProcessBeanFactory

      public void postProcessBeanFactory(@NotNull @NotNull org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) throws org.springframework.beans.BeansException
      Detects application provided ConfigProvider and ConfigProviderCustomizer beans.
      Specified by:
      postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
      Throws:
      org.springframework.beans.BeansException
    • postProcessAfterInitialization

      @NotNull public @NotNull Object postProcessAfterInitialization(@NotNull @NotNull Object bean, @NotNull @NotNull String beanName) throws org.springframework.beans.BeansException
      Registers
      Specified by:
      postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessor
      Throws:
      org.springframework.beans.BeansException
    • getConfigProvider

      @NotNull public @NotNull ConfigProvider getConfigProvider()
      Creates and exposes the automatically created Config bean, if any.
      Returns:
      The automatically created ConfigProvider bean.
    • createConfigProvider

      @NotNull protected @NotNull ConfigProviderImpl createConfigProvider()
      Creates a new configuration provider.
      Returns:
      The new configuration provider.
    • createDefaultConfig

      @NotNull protected @NotNull Config createDefaultConfig()
      Creates a Spring based default configuration.
      Returns:
      The default configuration.