Package com.alibaba.cloud.nacos.refresh
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
ConstructorsConstructorDescriptionSmartConfigurationPropertiesRebinder(org.springframework.cloud.context.properties.ConfigurationPropertiesBeans beans) -
Method Summary
Modifier and TypeMethodDescriptionvoidonApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
getBeanNames, getErrors, getNeverRefreshable, rebind, rebind, rebindMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Overrides:
setApplicationContextin classorg.springframework.cloud.context.properties.ConfigurationPropertiesRebinder- Throws:
org.springframework.beans.BeansException
-
onApplicationEvent
public void onApplicationEvent(org.springframework.cloud.context.environment.EnvironmentChangeEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.cloud.context.environment.EnvironmentChangeEvent>- Overrides:
onApplicationEventin classorg.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
-