Class ConfigurationPropertiesRebinder
java.lang.Object
org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder
- All Implemented Interfaces:
EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<EnvironmentChangeEvent>
@Component
@ManagedResource
public class ConfigurationPropertiesRebinder
extends Object
implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<EnvironmentChangeEvent>
Listens for
EnvironmentChangeEvent and rebinds beans that were bound to the
Environment using @ConfigurationProperties. When these beans are re-bound and
re-initialized, the changes are available immediately to any component that is using
the @ConfigurationProperties bean.- Author:
- Dave Syer, Yanming Zhou
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionA map of bean name to errors when instantiating the bean.voidvoidrebind()booleanWARNING: This method rebinds beans from any context in the hierarchy using the main application context.booleanvoidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
ConfigurationPropertiesRebinder
-
-
Method Details
-
setApplicationContext
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-
getErrors
-
rebind
@ManagedOperation public void rebind() -
rebind
-
rebind
WARNING: This method rebinds beans from any context in the hierarchy using the main application context.- Parameters:
type- bean type to rebind.- Returns:
- true, if successful.
-
getNeverRefreshable
-
getBeanNames
-
onApplicationEvent
- Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<EnvironmentChangeEvent>
-