Class SmartConfigurationPropertiesRebinder

java.lang.Object
org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
com.alibaba.cloud.nacos.refresh.SmartConfigurationPropertiesRebinder
All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>

public class SmartConfigurationPropertiesRebinder extends org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
Extend ConfigurationPropertiesRebinder.

Spring team doesn't seem to support single ConfigurationPropertiesBean refresh.

SmartConfigurationPropertiesRebinder can refresh specific ConfigurationPropertiesBean base on the change keys.

NOTE: We still use Spring's default behavior (full refresh) as default behavior, This feature can be considered an advanced feature, it may not be as stable as the default behavior.

Since:
2021.0.1.1
Author:
freeman
  • Constructor Summary

    Constructors
    Constructor
    Description
    SmartConfigurationPropertiesRebinder(org.springframework.cloud.context.properties.ConfigurationPropertiesBeans beans)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event)
     
    void
    setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
     

    Methods inherited from class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder

    getBeanNames, getErrors, getNeverRefreshable, rebind, rebind, rebind

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.springframework.context.ApplicationListener

    supportsAsyncExecution
  • Constructor Details

    • SmartConfigurationPropertiesRebinder

      public SmartConfigurationPropertiesRebinder(org.springframework.cloud.context.properties.ConfigurationPropertiesBeans beans)
  • Method Details

    • setApplicationContext

      public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
      Specified by:
      setApplicationContext in interface org.springframework.context.ApplicationContextAware
      Overrides:
      setApplicationContext in class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
      Throws:
      org.springframework.beans.BeansException
    • onApplicationEvent

      public void onApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event)
      Specified by:
      onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>
      Overrides:
      onApplicationEvent in class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder