接口 ConfigurationPropertyCaching
public interface ConfigurationPropertyCaching
Interface that can be used to control configuration property source caches.
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Harry Yang
-
方法概要
修饰符和类型方法说明voidclear()Clear the cache and force it to be reloaded on next access.voiddisable()Disable caching.voidenable()Enable caching with an unlimited time-to-live.static ConfigurationPropertyCachingget(cn.taketoday.core.env.Environment environment) Get for all configuration property sources in the environment.static ConfigurationPropertyCachingGet for a specific configuration property source in the environment.static ConfigurationPropertyCachingget(Iterable<ConfigurationPropertySource> sources) Get for all specified configuration property sources.static ConfigurationPropertyCachingget(Iterable<ConfigurationPropertySource> sources, Object underlyingSource) Get for a specific configuration property source in the specified configuration property sources.voidsetTimeToLive(Duration timeToLive) Set amount of time that an item can live in the cache.
-
方法详细资料
-
enable
void enable()Enable caching with an unlimited time-to-live. -
disable
void disable()Disable caching. -
setTimeToLive
Set amount of time that an item can live in the cache. Calling this method will also enable the cache.- 参数:
timeToLive- the time to live value.
-
clear
void clear()Clear the cache and force it to be reloaded on next access. -
get
Get for all configuration property sources in the environment.- 参数:
environment- the Framework environment- 返回:
- a caching instance that controls all sources in the environment
-
get
static ConfigurationPropertyCaching get(cn.taketoday.core.env.Environment environment, @Nullable Object underlyingSource) Get for a specific configuration property source in the environment.- 参数:
environment- the Framework environmentunderlyingSource- theunderlying sourcethat must match- 返回:
- a caching instance that controls the matching source
-
get
Get for all specified configuration property sources.- 参数:
sources- the configuration property sources- 返回:
- a caching instance that controls the sources
-
get
static ConfigurationPropertyCaching get(Iterable<ConfigurationPropertySource> sources, @Nullable Object underlyingSource) Get for a specific configuration property source in the specified configuration property sources.- 参数:
sources- the configuration property sourcesunderlyingSource- theunderlying sourcethat must match- 返回:
- a caching instance that controls the matching source
-