org.springframework.boot.context.properties.source

Interface ConfigurationPropertyCaching



  • public interface ConfigurationPropertyCaching
    Interface that can be used to control configuration property source caches.
    Since:
    2.3.0
    • Method Detail

      • enable

        void enable()
        Enable caching with an unlimited time-to-live.
      • disable

        void disable()
        Disable caching.
      • setTimeToLive

        void setTimeToLive(java.time.Duration timeToLive)
        Set amount of time that an item can live in the cache. Calling this method will also enable the cache.
        Parameters:
        timeToLive - the time to live value.
      • clear

        void clear()
        Clear the cache and force it to be reloaded on next access.
      • get

        static ConfigurationPropertyCaching get(org.springframework.core.env.Environment environment)
        Get for all configuration property sources in the environment.
        Parameters:
        environment - the spring environment
        Returns:
        a caching instance that controls all sources in the environment
      • get

        static ConfigurationPropertyCaching get(org.springframework.core.env.Environment environment,
                                                java.lang.Object underlyingSource)
        Get for a specific configuration property source in the environment.
        Parameters:
        environment - the spring environment
        underlyingSource - the underlying source that must match
        Returns:
        a caching instance that controls the matching source
      • get

        static ConfigurationPropertyCaching get(java.lang.Iterable<ConfigurationPropertySource> sources,
                                                java.lang.Object underlyingSource)
        Get for a specific configuration property source in the specified configuration property sources.
        Parameters:
        sources - the configuration property sources
        underlyingSource - the underlying source that must match
        Returns:
        a caching instance that controls the matching source