Class ConfigurationChangeDetector

java.lang.Object
org.springframework.cloud.kubernetes.commons.config.reload.ConfigurationChangeDetector
Direct Known Subclasses:
PollingConfigMapChangeDetector, PollingSecretsChangeDetector

public abstract class ConfigurationChangeDetector extends Object
This is the superclass of all beans that can listen to changes in the configuration and fire a reload.
Author:
Nicola Ferraro
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected org.springframework.core.env.ConfigurableEnvironment
     
    protected org.apache.commons.logging.Log
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfigurationChangeDetector(org.springframework.core.env.ConfigurableEnvironment environment, ConfigReloadProperties properties, ConfigurationUpdateStrategy strategy)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    changed(List<? extends org.springframework.core.env.MapPropertySource> left, List<? extends org.springframework.core.env.MapPropertySource> right)
     
    boolean
    changed(org.springframework.core.env.MapPropertySource left, org.springframework.core.env.MapPropertySource right)
    Determines if two property sources are different.
    protected <S extends org.springframework.core.env.PropertySource<?>>
    S
    findPropertySource(Class<S> sourceClass)
    Finds one registered property source of the given type, logging a warning if multiple property sources of that type are available.
    <S extends org.springframework.core.env.PropertySource<?>>
    List<S>
    findPropertySources(Class<S> sourceClass)
     
    protected List<org.springframework.core.env.MapPropertySource>
    locateMapPropertySources(org.springframework.cloud.bootstrap.config.PropertySourceLocator propertySourceLocator, org.springframework.core.env.Environment environment)
    Returns a list of MapPropertySource that correspond to the current state of the system.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      protected org.apache.commons.logging.Log log
    • environment

      protected org.springframework.core.env.ConfigurableEnvironment environment
    • properties

      protected ConfigReloadProperties properties
    • strategy

      protected ConfigurationUpdateStrategy strategy
  • Constructor Details

  • Method Details

    • reloadProperties

      public void reloadProperties()
    • changed

      public boolean changed(org.springframework.core.env.MapPropertySource left, org.springframework.core.env.MapPropertySource right)
      Determines if two property sources are different.
      Parameters:
      left - left map property sources
      right - right map property sources
      Returns:
      true if source has changed
    • changed

      public boolean changed(List<? extends org.springframework.core.env.MapPropertySource> left, List<? extends org.springframework.core.env.MapPropertySource> right)
    • findPropertySource

      protected <S extends org.springframework.core.env.PropertySource<?>> S findPropertySource(Class<S> sourceClass)
      Finds one registered property source of the given type, logging a warning if multiple property sources of that type are available.
      Type Parameters:
      S - property source type
      Parameters:
      sourceClass - class for which property sources will be searched for
      Returns:
      matched property source
    • findPropertySources

      public <S extends org.springframework.core.env.PropertySource<?>> List<S> findPropertySources(Class<S> sourceClass)
      Type Parameters:
      S - property source type
      Parameters:
      sourceClass - class for which property sources will be found
      Returns:
      finds all registered property sources of the given type
    • locateMapPropertySources

      protected List<org.springframework.core.env.MapPropertySource> locateMapPropertySources(org.springframework.cloud.bootstrap.config.PropertySourceLocator propertySourceLocator, org.springframework.core.env.Environment environment)
      Returns a list of MapPropertySource that correspond to the current state of the system. This only handles the PropertySource objects that are returned.
      Parameters:
      propertySourceLocator - Spring's property source locator
      environment - Spring environment
      Returns:
      a list of MapPropertySource that correspond to the current state of the system