org.springframework.context.support.ReloadableResourceBundleMessageSource.clearCache()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.springframework.context.support.ReloadableResourceBundleMessageSource.clearCache方法的一些代码示例,展示了ReloadableResourceBundleMessageSource.clearCache的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ReloadableResourceBundleMessageSource.clearCache方法的具体详情如下:
包路径:org.springframework.context.support.ReloadableResourceBundleMessageSource
类名称:ReloadableResourceBundleMessageSource
方法名:clearCache

ReloadableResourceBundleMessageSource.clearCache介绍

[英]Clear the resource bundle cache. Subsequent resolve calls will lead to reloading of the properties files.
[中]清除资源包缓存。后续的解析调用将导致重新加载属性文件。

代码示例

代码示例来源:origin: spring-projects/spring-framework

/**
 * Clear the resource bundle caches of this MessageSource and all its ancestors.
 * @see #clearCache
 */
public void clearCacheIncludingAncestors() {
  clearCache();
  if (getParentMessageSource() instanceof ReloadableResourceBundleMessageSource) {
    ((ReloadableResourceBundleMessageSource) getParentMessageSource()).clearCacheIncludingAncestors();
  }
}

代码示例来源:origin: stackoverflow.com

ReloadableResourceBundleMessageSource rs = Global.getBean("messageSource", ReloadableResourceBundleMessageSource.class);
rs.clearCache();

代码示例来源:origin: org.springframework/spring-context

/**
 * Clear the resource bundle caches of this MessageSource and all its ancestors.
 * @see #clearCache
 */
public void clearCacheIncludingAncestors() {
  clearCache();
  if (getParentMessageSource() instanceof ReloadableResourceBundleMessageSource) {
    ((ReloadableResourceBundleMessageSource) getParentMessageSource()).clearCacheIncludingAncestors();
  }
}

代码示例来源:origin: com.asual.summer/summer-core

public void setLocations(String[] locations) {
  super.setLocations(locations);
  rbms.clearCache();
  rbms.setBasenames(locations);
}

代码示例来源:origin: apache/servicemix-bundles

/**
 * Clear the resource bundle caches of this MessageSource and all its ancestors.
 * @see #clearCache
 */
public void clearCacheIncludingAncestors() {
  clearCache();
  if (getParentMessageSource() instanceof ReloadableResourceBundleMessageSource) {
    ((ReloadableResourceBundleMessageSource) getParentMessageSource()).clearCacheIncludingAncestors();
  }
}

代码示例来源:origin: asual/summer

public void setLocations(String[] locations) {
  super.setLocations(locations);
  rbms.clearCache();
  rbms.setBasenames(locations);
}

代码示例来源:origin: com.asual.summer/summer-core

rbms.clearCache();
rbms.setBasenames(fileBasenames.toArray(new String[fileBasenames.size()]));

代码示例来源:origin: asual/summer

rbms.clearCache();
rbms.setBasenames(fileBasenames.toArray(new String[fileBasenames.size()]));

代码示例来源:origin: org.owasp.webgoat/webgoat-container

/**
 * <p>updatePluginResources.</p>
 *
 * @param propertyFile a {@link java.nio.file.Path} object.
 */
public static void updatePluginResources(final Path propertyFile) {
  pluginLabels.setBasename("WebGoatLabels");
  pluginLabels.setFallbackToSystemLocale(false);
  pluginLabels.setUseCodeAsDefaultMessage(true);
  pluginLabels.setResourceLoader(new ResourceLoader() {
    @Override
    public Resource getResource(String location) {
      try {
        return new UrlResource(propertyFile.toUri());
      } catch (MalformedURLException e) {
        throw new RuntimeException(e);
      }
    }
    @Override
    public ClassLoader getClassLoader() {
      return Thread.currentThread().getContextClassLoader();
    }
  });
  pluginLabels.clearCache();
}

相关文章

微信公众号

最新文章

更多

ReloadableResourceBundleMessageSource类方法